BRAGA

02 Writing02-02 Notes02-02-218

Zero Vector

Published 16 Apr 20266 min read
Contents
  1. 01Deep Breakdown
  2. 02Flowchart
  3. 03Real-world use
  4. 04The formula, piece by piece
  5. 05The formula in words
  6. 06Critical Concepts
  7. 07Step-by-step calculation (tiny example)
  8. 08Code examples
0⃗=0i⃗+0j⃗+0k⃗\vec{0} = 0\vec{i} + 0\vec{j} + 0\vec{k}
(1)

Deep Breakdown

What it tells me (Situation Awareness): The zero vector 0⃗=(0,0,0)\vec{0} = (0, 0, 0) is the unique vector with all components equal to zero. It is the additive identity of the vector space: v⃗+0⃗=v⃗\vec{v} + \vec{0} = \vec{v} for every v⃗\vec{v}. Geometrically, it has no direction and zero length. It is the "origin" as a vector. In DA/DS: the zero vector is the additive identity in vector spaces (zero bias before training, zero residual means perfect fit), the boundary condition for convergence (∣x⃗t−x⃗∗∣→0⃗|\vec{x}_t - \vec{x}^*| \to \vec{0}), and the initial value for accumulated gradient vectors or error vectors.

Flowchart

Zero vector: v =(0, 0, 0)PropertiesAdditive identity:v + 0 = vMagnitude: |0| =0No direction:unit vectorundefinedLinearlydependent withANY set ofvectorsWhen youencounter itResidual = 0:perfectpredictionsConvergence:delta_w - 0vectorInitialization:bias = 0,gradient = 0

Real-world use

Where it is used

Initializing weight vectors to zero before training, representing a null update (gradient step of zero when convergence is reached), representing a zero residual (perfect fit: predicted equals actual), as the neutral element in vector spaces, and as the boundary of linear dependence detection (v⃗−v⃗=0⃗\vec{v} - \vec{v} = \vec{0}).

Problem it solves

Every algebraic system needs an identity element. For vectors, addition needs a neutral element: adding it to any vector should change nothing. 0⃗\vec{0} is that element. It also defines the additive inverse: −v⃗-\vec{v} is defined as the unique vector satisfying v⃗+(−v⃗)=0⃗\vec{v} + (-\vec{v}) = \vec{0}.

How it solves the problem

All components are 0: 0i⃗+0j⃗+0k⃗=(0,0,0)0\vec{i} + 0\vec{j} + 0\vec{k} = (0,0,0).

For any v⃗=(v1,v2,v3)\vec{v} = (v_1, v_2, v_3): v⃗+0⃗=(v1+0,v2+0,v3+0)=(v1,v2,v3)=v⃗\vec{v} + \vec{0} = (v_1+0, v_2+0, v_3+0) = (v_1, v_2, v_3) = \vec{v}. ✓\checkmark

Example in a business

A DS monitors training convergence by tracking ∥Δw⃗t∥=∥w⃗t−w⃗t−1∥\|\Delta\vec{w}_t\| = \|\vec{w}_t - \vec{w}_{t-1}\|. When this norm approaches zero (the weight update vector approaches 0⃗\vec{0}), training has converged. The stopping criterion is: stop when ∥Δw⃗t∥<ϵ\|\Delta\vec{w}_t\| < \epsilon for some small tolerance ϵ>0\epsilon > 0. Here the zero vector is the target of convergence.

The formula, piece by piece

  • 0⃗\vec{0}: the zero vector; all components are 0
  • 0i⃗+0j⃗+0k⃗0\vec{i} + 0\vec{j} + 0\vec{k}: expanded form in standard basis; zero times any basis vector is zero
  • The shorthand 0⃗=(0,0,0)\vec{0} = (0, 0, 0) is the coordinate form in 3D; in nn dimensions it is 0⃗=(0,0,…,0)\vec{0} = (0, 0, \ldots, 0)
  • In NumPy: np.zeros(n) creates a zero vector of dimension nn

The formula in words

"A vector where every component is zero. It has no length and no direction. Adding it to any vector leaves that vector unchanged." Tiny example: v⃗=(5,−3,2)\vec{v} = (5, -3, 2). v⃗+0⃗=(5+0,−3+0,2+0)=(5,−3,2)=v⃗\vec{v} + \vec{0} = (5+0, -3+0, 2+0) = (5,-3,2) = \vec{v}. ✓\checkmark

Critical Concepts

  • Additive identity: v⃗+0⃗=v⃗\vec{v} + \vec{0} = \vec{v} for all v⃗\vec{v}.
  • Additive inverse: v⃗+(−v⃗)=0⃗\vec{v} + (-\vec{v}) = \vec{0}.
  • Magnitude is zero: ∣0⃗∣=0|\vec{0}| = 0. Unique: this is the only vector with zero magnitude.
  • No unit vector: 0^\hat{0} is undefined; cannot normalize the zero vector.
  • Any set containing 0⃗\vec{0} is linearly dependent: 1⋅0⃗=0⃗1 \cdot \vec{0} = \vec{0} gives a non-trivial linear combination summing to zero.
  • Scalar times zero vector: k⋅0⃗=0⃗k \cdot \vec{0} = \vec{0} for any scalar kk.
  • Zero vector times any scalar = zero vector: 0⋅v⃗=0⃗0 \cdot \vec{v} = \vec{0} for any v⃗\vec{v}.
  • In NumPy: np.zeros(3) for 3D; np.zeros(n) for nnD.

Use np.allclose(v, np.zeros_like(v)) to test if a vector is numerically zero.

Step-by-step calculation (tiny example)

Step 1: Verify additive identity property v⃗=(7,−2,4)\vec{v} = (7, -2, 4), 0⃗=(0,0,0)\vec{0} = (0, 0, 0).

Step 2: Perform the addition v⃗+0⃗=(7+0,−2+0,4+0)=(7,−2,4)\vec{v} + \vec{0} = (7+0, -2+0, 4+0) = (7, -2, 4).

Step 3: Confirm equal to original (7,−2,4)=v⃗(7, -2, 4) = \vec{v}. ✓\checkmark The zero vector added nothing — additive identity confirmed.

Code examples

Beginner example (Python)

python
import numpy as np   # -- Zero vector: properties and convergence check ---
n_dims = 5
zero_vec = np.zeros(n_dims)
v = np.array([7.0, -2.0, 4.0, 1.0, -3.0])   # Additive identity
print(f"v = {v}")
print(f"v + 0 = {v + zero_vec}")
print(f"Equal? : {np.allclose(v + zero_vec, v)}")   # Magnitude
print(f"\n|zero_vec| = {np.linalg.norm(zero_vec)}")   # 0.0 # Additive inverse
print(f"\nv + (-v) = {v + (-v)}")   # zero vector # Test if a vector is (approximately) zero
epsilon = 1e-8
small_v = np.array([1e-9, -2e-10, 3e-10, 0, 1e-11])
is_zero = np.linalg.norm(small_v) < epsilon
print(f"\nsmall_v near zero? {is_zero}")

Beginner example (R)

r
# -- Zero vector: additive identity and convergence ---
n_dims <- 5
zero_vec <- rep(0, n_dims)
v <- c(7, -2, 4, 1, -3)
cat("v :", v, "\n")
cat("v + 0 :", v + zero_vec, "\n")
cat("Equal? :", isTRUE(all.equal(v + zero_vec, v)), "\n")
cat("|zero_vec|:", sqrt(sum(zero_vec^2)), "\n")

# Additive inverse
cat("v + (-v) :", v + (-v), "\n")

# Near-zero test
epsilon <- 1e-8
small_v <- c(1e-9, -2e-10, 3e-10, 0, 1e-11)
cat("small_v near zero?", sqrt(sum(small_v^2)) < epsilon, "\n")

Professional example (Python)

python
import numpy as np
import pandas as pd
np.random.seed(42)

# -- Business scenario: convergence monitoring via weight update norms ---
# Track whether weight update vectors approach the zero vector during training.
# Stop when the L2 norm of the update drops below tolerance.
N_PARAMS = 10
N_EPOCHS = 50
LR = 0.1
TOLERANCE = 1e-4

# Simulate a convex loss: true weights to converge to
w_true = np.random.randn(N_PARAMS)
w = np.zeros(N_PARAMS)   # initialize to zero vector
convergence_log = []
for epoch in range(N_EPOCHS):
    gradient = 2 * (w - w_true) + np.random.normal(0, 0.01, N_PARAMS)   # noisy gradient
    delta_w = -LR * gradient
    w_new = w + delta_w
    delta_norm = np.linalg.norm(delta_w)   # norm of update vector (-> 0 at convergence)
    distance_from_true = np.linalg.norm(w_new - w_true)
    convergence_log.append({
        "epoch": epoch + 1,
        "delta_w_norm": round(delta_norm, 6),
        "dist_from_true": round(distance_from_true, 6),
        "converged": delta_norm < TOLERANCE,
    })
    w = w_new
    if delta_norm < TOLERANCE:
        print(f"Converged at epoch {epoch+1}: |delta_w| = {delta_norm:.2e} < {TOLERANCE}")
        break

log_df = pd.DataFrame(convergence_log)
print(log_df.tail(10).to_string(index=False))
print(f"\nFinal weight update vector (-> zero): {np.linalg.norm(w - w_true):.6f} from true")

Professional example (R)

r
# Convergence: norm of update -> 0 (approach zero vector)
set.seed(42)
N_PARAMS <- 10
N_EPOCHS <- 50
LR <- 0.1
TOLERANCE <- 1e-4
w_true <- rnorm(N_PARAMS)
w <- numeric(N_PARAMS)
for (epoch in 1:N_EPOCHS) {
  gradient <- 2 * (w - w_true) + rnorm(N_PARAMS, 0, 0.01)
  delta_w <- -LR * gradient
  w <- w + delta_w
  delta_norm <- sqrt(sum(delta_w^2))
  if (delta_norm < TOLERANCE) {
    cat(sprintf("Converged at epoch %d: |delta_w| = %.2e\n", epoch, delta_norm))
    break
  }
}
cat(sprintf("Final dist from true: %.6f\n", sqrt(sum((w - w_true)^2))))

Source: domain knowledge

#linear-algebra#vectors-and-dimensionality#vector-space-axioms-and-coordinates

Keyboard shortcuts

Single keys, ignored while typing in a field or with Cmd, Ctrl or Alt held.

0
Home
1 2 3 4
Work, Writing, Tools, About
j / k
Next / previous section on this page
n / p
Next / previous project or essay
u
Up one level
l
Deutsch
t
Light or dark theme
?
This list
Esc
Close