Math's Four Operations: Abstraction And Dimension Explained

by Marco 60 views

I've been curious about the four arithmetic operations of mathematics for a long time. Have we been simply recognizing the four arithmetic operations that we use in calculations every day only as calculation tools? While looking at the formula of physical force F = ma, I wondered, why do we have to multiply m and a? I was curious about whether we could understand the four arithmetic operations in terms of the synthesis and decomposition of information from the fact that multiplying mass and acceleration defines new information, force F.

Abstraction: The Greatest Invention of Mathematics

Abstraction is mathematics' greatest invention. Guys, think about it: three apples, three people, three seconds – we represent all of these with the single, abstract concept of '3'. The moment we transform concrete objects from the real world into abstract symbols called numbers, we gain a powerful tool for manipulating information. This is where the magic starts, folks!

# Abstraction of concrete things
apples = 3      # 3 apples
people = 3      # 3 people
seconds = 3     # 3 seconds

# All can apply the same abstract operation
total = apples + people  # 6 (meaning depends on the context)

The four arithmetic operations are the most basic tools for manipulating this abstracted information. Addition, subtraction, multiplication, division – these four operations aren't just tools for calculating numbers. They are fundamental transformation tools for synthesizing and decomposing information, expanding and shrinking dimensions. Let's dive in!

I started to understand this from two perspectives. Addition and subtraction are responsible for combining and separating information, while multiplication and division are responsible for expanding and shrinking dimensions.

Combining and Separating Information: Addition and Subtraction

Addition: The Combination of Information

Addition is an operation that gathers scattered pieces of information into one. But it's not just a simple increase in numerical value. It's a process where information that existed independently is combined to create new information with new meaning. For example, adding monthly sales figures gives you quarterly sales. This is where individual pieces of information scattered along the time axis are integrated into information with a new perspective called 'quarter'.

In programming, the reduce operation on an array is a typical example of this combination of information. The information held by individual elements is transformed into a single, aggregated piece of information. Think of it like combining all the ingredients to bake a cake – you get a whole new delicious thing!

// Combine monthly sales into quarterly sales
const monthlyRevenue = [100, 150, 200];
const quarterlyRevenue = monthlyRevenue.reduce((sum, value) => sum + value, 0);
console.log(quarterlyRevenue); // 450

// Information scattered along the time axis is integrated into a new perspective called 'quarter'

However, it's important to note that addition doesn't always mean 'increase'. Adding a negative number actually decreases the value. This shows that addition is a 'directional combination'. Thinking about vector addition makes this easy to understand. When vectors in different directions are added to create a resultant vector, the direction and magnitude information of each vector is preserved and combined. So, addition is about combining stuff, but also considering how you combine it!

balance = 1000
expense = -300  # Expenses are negative
new_balance = balance + expense  # 700
# It's addition, but it actually represents a decrease
// Addition of 2D vectors
const vector1 = {x: 3, y: 4};
const vector2 = {x: -1, y: 2};
const result = {
    x: vector1.x + vector2.x,  // 2
    y: vector1.y + vector2.y   // 6
};
// Information from different directions is combined

Subtraction: Extracting Difference Information

Subtraction is an operation that separates a part from the whole. However, we shouldn't understand this as just simple 'removal'. The essence of subtraction is 'extracting difference information through comparison'.

Subtracting yesterday's temperature from today's temperature gives you new information called 'temperature change'. Subtracting expenses from the total budget gives you information called 'available budget'. Like this, subtraction quantifies the relationship between two pieces of information and provides new insights. It’s like figuring out how much you've grown by comparing your height now to your height last year.

# Measure temperature change
today_temp = 25
yesterday_temp = 20
temp_change = today_temp - yesterday_temp  # 5
print(f"Temperature change: {temp_change} degrees Celsius increase")

# Obtained new information about the difference between two points in time

This is why the difference operation is important in data analysis. By finding the differences between consecutive values in time series data, you can discover hidden information about the data's changing trends. It's like spotting a pattern in stock prices by looking at how much they change each day.

import numpy as np

# Difference of time series data
prices = np.array([100, 105, 103, 108, 110])
changes = np.diff(prices)  # [5, -2, 5, 2]
# Extracted trend information from price data

Expanding and Shrinking Dimensions: Multiplication and Division

Multiplication: Creating New Dimensions or Transforming Dimensions

The most amazing characteristic of multiplication is that it expands dimensions. Let's look at the area of a rectangle to understand what this means. Multiplying a width of 5 meters by a height of 3 meters gives you 15 square meters. The important thing to note here is the unit. Two 1-dimensional units called meters (m) are multiplied to create a 2-dimensional unit called square meters (m²). This isn't just a simple numerical calculation; it's a transformation of dimensions. Think about it like this: you start with lines, and multiplication gives you a surface!

# 1-dimensional × 1-dimensional = 2-dimensional
width = 5    # m (meters)
height = 3   # m (meters)
area = width * height  # 15 m² (square meters)

# The unit changed from m to m² - the dimension expanded!

Let's go back to the F = ma formula. Mass (kg) is information about the 'amount of substance' an object has. Acceleration (m/s²) is information about the 'rate of change of motion'. Multiplying these two independent pieces of information creates information of a completely new dimension called force (N). The fact that the unit called Newton (N) itself is defined as kg·m/s² is the result of this dimensional combination. It’s like mixing two colors to get a completely new one!

# Combination of independent physical quantities
mass = 10           # kg (amount of substance)
acceleration = 9.8  # m/s² (rate of change of motion)
force = mass * acceleration  # 98 N (Newtons)

# Two independent pieces of information are combined to create new dimensional information called 'force'

However, multiplication doesn't always expand dimensions. Multiplying by 0.5 actually reduces the size. This shows that multiplication also plays a role in 'scaling'. Reducing a photo by 50%, doubling the volume – all of this is scaling transformation through multiplication. So, multiplication isn't just about making things bigger; it’s about changing their scale.

# Scaling (reduction)
original_size = 100
scale_factor = 0.5
reduced_size = original_size * scale_factor  # 50
# It's multiplication, but the size is reduced

# Reversing direction
velocity = 10
direction = -1
new_velocity = velocity * direction  # -10
# Multiplication changed the direction

The Cartesian product in a database is a good example of the dimension-expanding characteristic of multiplication. If a color table has 3 rows and a size table has 4 rows, the Cartesian product of the two tables creates 12 combinations. Two pieces of 1-dimensional information are combined to create a 2-dimensional matrix.

-- Product of color table (3) and size table (4)
-- Result: 12 combinations (3 × 4 = 12)
SELECT * FROM colors CROSS JOIN sizes;
-- Two 1-dimensional pieces of information became a 2-dimensional matrix

Division: Normalization

Division decomposes complex information into unit information. The reason this is called 'normalization' is that it transforms information of different scales into a comparable form. Think about the formula: Speed = Distance ÷ Time. This transforms the information of running 100 meters in 10 seconds into normalized information of '10 meters per second'. Now, even if someone else ran 200 meters in 25 seconds, you can easily compare them with the normalized value of 8 meters per second. It’s about making things fair for comparison!

# Speed = Distance ÷ Time
distance = 100  # m
time = 10      # s
speed = distance / time  # 10 m/s

# 'Total distance traveled' is normalized to 'distance per unit time'

GDP per capita is a perfect example of normalization through division. The GDP of the United States is larger than that of China, but a different picture emerges when looking at GDP per capita divided by population. Division transforms the information of 'total amount' into information of 'per individual', making true comparison possible. It’s about finding out how well each person is doing, not just how well the whole country is doing!

Calculating the average is also dimension reduction.

const scores = [85, 90, 78, 92, 88];
const average = scores.reduce((a, b) => a + b) / scores.length;
console.log(average);  // 86.6

// Compressed 5-dimensional information (5 scores) into 1-dimensional information (average)

This is why data normalization is essential in machine learning. By normalizing features with different units like height (cm) and weight (kg) into values between 0 and 1, algorithms can treat all features equally. It’s about preventing one feature from dominating just because it has bigger numbers!

# Min-Max normalization
def normalize(value, min_val, max_val):
    return (value - min_val) / (max_val - min_val)

# Transform an arbitrary range to between 0 and 1
data = [10, 50, 30, 80, 100]
min_val, max_val = min(data), max(data)
normalized = [normalize(x, min_val, max_val) for x in data]
# [0.0, 0.44, 0.22, 0.78, 1.0]

Vector Operations: A Dramatic Example of Dimensional Transformation

Vector operations show the essence of dimensional transformation most clearly. The dot product compresses high dimensions into a scalar, while the cross product creates new dimensions. Let's take a closer look at how these two operations transform information.

Dot Product: Compressing Multidimensional Information into a Scalar

The dot product (inner product) of vectors is a dramatic example of dimension reduction. The dot product of two 3-dimensional vectors results in a single number. Looking closely at this process, we discover an amazing fact. The dot product operation multiplies corresponding components and then adds them all together. For example, the dot product of [1, 2, 3] and [4, 5, 6] is 1×4 + 2×5 + 3×6 = 32. Here, multiplication combines the information of each dimension, and addition integrates all dimensions into one. Multiplication and addition work together to reduce dimensions. It’s like squishing a 3D object into a single point!

It's important to understand the geometric meaning of this process. The dot product result is the product of the length of one vector and the length of the projection of the other vector onto that vector's direction. Expressed as a formula, it's a·b = |a| × |b| × cos(θ). Here, θ is the angle between the two vectors. cos(θ) encodes the direction information. If they are in the same direction, cos(0°) = 1; if they are perpendicular, cos(90°) = 0; and if they are in opposite directions, cos(180°) = -1. It's like measuring how much two vectors agree with each other!

import numpy as np

# Two 3-dimensional vectors
vector_a = np.array([1, 2, 3])
vector_b = np.array([4, 5, 6])

# Dot product: 3-dimensional × 3-dimensional → 0-dimensional
dot_product = np.dot(vector_a, vector_b)
print(f"Dot product result: {dot_product}")  # 32

# Calculation process: 1×4 + 2×5 + 3×6 = 32
# Multiplication and addition worked together to reduce dimensions!

The scalar value created by the dot product indicates how much the two vectors are pointing in the same direction. The dot product of parallel vectors is large, the dot product of perpendicular vectors is 0, and the dot product of vectors in opposite directions is negative. Complex multidimensional direction information is compressed into a single number. This is awesome!

Let's think about why this is important in machine learning. Each neuron in a neural network calculates the dot product of the input vector and the weight vector. The weights represent the pattern the neuron is trying to detect. The more similar the input is to this pattern, the larger the dot product value. Complex pattern matching in hundreds of dimensions is compressed into a single activation value. It’s like finding a specific ingredient in a complex recipe and measuring how much of it is there!

# Calculate the angle between two vectors
def angle_between(v1, v2):
    cos_angle = np.dot(v1, v2) / (np.linalg.norm(v1) * np.linalg.norm(v2))
    return np.degrees(np.arccos(cos_angle))

# Parallel vectors
parallel_a = np.array([1, 0])
parallel_b = np.array([2, 0])
print(f"Dot product of parallel vectors: {np.dot(parallel_a, parallel_b)}")  # 2 (positive)

# Perpendicular vectors
perpendicular_a = np.array([1, 0])
perpendicular_b = np.array([0, 1])
print(f"Dot product of perpendicular vectors: {np.dot(perpendicular_a, perpendicular_b)}")  # 0

# Opposite direction vectors
opposite_a = np.array([1, 0])
opposite_b = np.array([-1, 0])
print(f"Dot product of opposite direction vectors: {np.dot(opposite_a, opposite_b)}")  # -1 (negative)

The fact that the dot product of perpendicular vectors is 0 has a special meaning. It means that the two vectors are completely independent. The information of one vector doesn't contribute to the other vector at all. This is why we use orthogonal coordinate systems. Because the x, y, and z axes are perpendicular to each other, the information of each axis is maintained independently. It's like having separate, non-overlapping channels of information!.

Why is this important? Think about a text search engine. Documents are represented as vectors in thousands of dimensions, and the search query is also made into a vector of the same dimension. Finding the dot product (cosine similarity) of the two vectors gives you the relevance of the document to the search query as a single score. Complex information in thousands of dimensions is compressed into a simple number between 0 and 1, allowing you to sort documents by rank. It's like boiling down a whole library to a single score that tells you how relevant a book is to your question!

In actual search engines, TF-IDF (Term Frequency-Inverse Document Frequency) vectors are used. Each word becomes a dimension, and its value represents the importance of the word. Words that appear frequently but are common to all documents (e.g., 'and', 'but') have low values. Unique words that only appear in specific documents have high values. The cosine similarity of vectors created this way determines the search ranking.

# Calculate cosine similarity
def cosine_similarity(vec1, vec2):
    return np.dot(vec1, vec2) / (np.linalg.norm(vec1) * np.linalg.norm(vec2))

# Represent documents as vectors (word frequency)
# [python, java, AI, web, data]
doc1 = np.array([3, 0, 4, 0, 2])  
doc2 = np.array([2, 0, 5, 0, 3])  # Similar topic
doc3 = np.array([0, 4, 0, 3, 0])  # Different topic

sim_1_2 = cosine_similarity(doc1, doc2)
sim_1_3 = cosine_similarity(doc1, doc3)

print(f"Document 1 - Document 2 Similarity: {sim_1_2:.2f}")  # 0.98 (Very Similar)
print(f"Document 1 - Document 3 Similarity: {sim_1_3:.2f}")  # 0.00 (Completely Different)

Why does cosine similarity normalize the dot product by the vector size? To remove the influence of document length. Long documents have many words, so the vector size is large. Without normalization, long documents would have high similarity with each other. Normalization allows you to measure pure content similarity regardless of document length. It's like comparing the density of two objects instead of their total mass!

In physics, Work = Force · Displacement is also a dot product. 3-dimensional information of the force vector and the displacement vector is compressed into a scalar value of energy. Here, what's important is the relationship between the direction of the force and the direction of movement. If they are in the same direction, it's positive work; if they are in the opposite direction, it's negative work. It’s all about direction!

Think about lifting luggage up the stairs. The force is upwards, and the movement is upwards. Since the two vectors are in the same direction, it's positive work. Energy is consumed. Conversely, when going down, gravity acts downwards, and movement is downwards. Gravity does positive work. We actually receive energy. This is why going downhill is easier.

Cross Product: Creating New Dimensions

The cross product of vectors does the exact opposite. Taking the cross product of two 3-dimensional vectors creates a new 3-dimensional vector that is perpendicular to both of those vectors. The number of dimensions is maintained, but a completely new direction is created. It's like taking two lines and creating a plane that's perfectly aligned to both of them!

It's important to understand the geometric meaning of the cross product. It creates a vector perpendicular to the plane created by the two vectors. The direction follows the right-hand rule. If you curl the fingers of your right hand from the first vector to the second vector, the direction your thumb is pointing is the direction of the cross product. Remember the right hand rule from physics, guys? :)

Taking the cross product of the x-axis unit vector [1, 0, 0] and the y-axis unit vector [0, 1, 0] results in the z-axis unit vector [0, 0, 1]. A third piece of directional information is created from two pieces of directional information. This means an expansion from a 2-dimensional plane to 3-dimensional space. It's like magic!

# Cross product of 3-dimensional vectors
vector_x = np.array([1, 0, 0])  # x-axis
vector_y = np.array([0, 1, 0])  # y-axis

# Cross product: new vector perpendicular to two vectors
cross_product = np.cross(vector_x, vector_y)
print(f"x × y = {cross_product}")  # [0 0 1] (z-axis)

# If you change the order, the direction is reversed
reverse_cross = np.cross(vector_y, vector_x)
print(f"y × x = {reverse_cross}")  # [0 0 -1] (-z-axis)

The magnitude of the cross product is equal to the area of the parallelogram created by the two vectors: |a × b| = |a| × |b| × sin(θ). sin(θ) indicates how close the two vectors are to being perpendicular. If they are parallel, sin(0°) = 0, and the cross product is the zero vector. If they are perpendicular, sin(90°) = 1, and the magnitude of the cross product is maximized. *It’s like measuring the amount of