Guozhen AIGlobal AI field notes and model intelligence

English translation

Example vectors

Published:

Category: Linear Algebra for AI Beginners

Read time: 3 min

Reads: 0

Lesson #19Views are counted together with the original Chinese articleImages are preserved from the source page

Concept Diagram: Orthogonal Vectors and Orthogonal Bases

An orthogonal basis functions like a set of mutually independent coordinate rulers. When representing vectors using such a basis, projections and reconstructions become transparent and intuitive.

Verification Diagram: Orthogonal Vectors and Orthogonal Bases

I will compute pairwise inner products. Orthogonality is not merely about appearing perpendicular—it is defined rigorously by an inner product equaling exactly zero.

Orthogonality is a fundamental concept in linear algebra—especially critical when working with high-dimensional data. A solid understanding of orthogonal vectors and orthogonal bases is essential for effectively applying AI and machine learning algorithms. This tutorial dives deeply into the definitions and properties of orthogonal vectors and orthogonal bases, illustrated with concrete examples.

Orthogonal Vectors

Let’s first recall the definition of the inner product. In the previous section, we introduced its key properties. Two vectors in an inner product space are said to be orthogonal if their inner product equals zero. Mathematically, given vectors u\mathbf{u} and v\mathbf{v}, they are orthogonal if and only if:

Orthogonal Vectors & Orthogonal Bases Decision Card

When learning orthogonal vectors and orthogonal bases, begin by reviewing: inner products, vector normalization (unit length), linear independence of basis vectors, projection computation, and coordinate representation.

u,v=0\langle \mathbf{u}, \mathbf{v} \rangle = 0

For example, in R3\mathbb{R}^3, vectors u=(1,0,0)\mathbf{u} = (1, 0, 0) and v=(0,1,0)\mathbf{v} = (0, 1, 0) are orthogonal because their inner product is:

u,v=10+01+00=0\langle \mathbf{u}, \mathbf{v} \rangle = 1 \cdot 0 + 0 \cdot 1 + 0 \cdot 0 = 0

Example: Application of Orthogonal Vectors

Suppose we have two vectors in the 2D plane: a=(2,3)\mathbf{a} = (2, 3) and b=(3,2)\mathbf{b} = (-3, 2). We can verify whether they are orthogonal:

a,b=2(3)+32=6+6=0\langle \mathbf{a}, \mathbf{b} \rangle = 2 \cdot (-3) + 3 \cdot 2 = -6 + 6 = 0

Since their inner product is zero, these two vectors are indeed orthogonal.

Orthogonal Bases

In a vector space, a basis is a set of linearly independent vectors such that any vector in the space can be expressed uniquely as a linear combination of them. A basis is called an orthogonal basis if every pair of distinct vectors in the set is orthogonal.

Linear Algebra Reading Roadmap Card

After finishing Orthogonal Vectors and Orthogonal Bases, take one minute to reflect: Are the core concepts clearly distinguished? Can you reproduce the practice steps? Can you restate the conclusions in your own words?

For instance, in three-dimensional space, the standard basis vectors e1=(1,0,0)\mathbf{e}_1 = (1, 0, 0), e2=(0,1,0)\mathbf{e}_2 = (0, 1, 0), and e3=(0,0,1)\mathbf{e}_3 = (0, 0, 1) form an orthogonal basis—because each pair is orthogonal and each vector has unit length.

Properties of Orthogonal Bases

A key property of orthogonal bases is normalization (or unit-length scaling). If we normalize each vector in an orthogonal basis—i.e., scale it to have length 1—we obtain an orthonormal basis, where every basis vector satisfies:

ei=1,i\|\mathbf{e}_i\| = 1, \quad \forall i

Example: Computing an Orthogonal Basis in Python

We can construct an orthogonal basis from a set of linearly independent vectors using the Gram–Schmidt process. Below is a simple implementation in Python:

import numpy as np

def gram_schmidt(vectors):
    orthogonal_vectors = []
    
    for v in vectors:
        for av in orthogonal_vectors:
            v -= np.dot(v, av) / np.dot(av, av) * av
        orthogonal_vectors.append(v)
    
    return np.array(orthogonal_vectors)

# Example vectors
vectors = np.array([[1, 1, 0], [1, 0, 1], [0, 1, 1]])

# Compute orthogonal basis
orthogonal_basis = gram_schmidt(vectors)

print("Original vectors:\n", vectors)
print("Orthogonal basis:\n", orthogonal_basis)

In this example, we define a set of input vectors and apply the Gram–Schmidt process to produce an orthogonal basis. The output is a set of mutually orthogonal vectors.

Orthogonal Vectors & Orthogonal Bases Application Review Card

If Orthogonal Vectors and Orthogonal Bases hasn’t fully clicked yet, revisit this card and walk through its four actionable steps.

Orthogonal Vectors & Orthogonal Bases Application Check Card

When reviewing Orthogonal Vectors and Orthogonal Bases, avoid tackling large projects upfront. Instead, start with a single, simple example to confirm whether the core logic is clear.

Summary

In this tutorial, we explored the significance and foundational concepts of orthogonal vectors and orthogonal bases. Orthogonality plays a vital role across many domains—including signal processing, dimensionality reduction, and machine learning. Identifying or constructing orthogonal bases simplifies computations and improves numerical stability. In the next installment, we’ll examine the practical importance of inner product spaces—with real-world applications and case studies. Stay tuned!

Continue

Keep reading from here

Browse English site

Reader Messages

Reader messages

Questions, corrections, extra sources, or hands-on results can be left here. No login is required.

Max 800 characters

To reduce spam, each message is checked for length, link count, and posting frequency.

0/800

Messages

0 messages
Loading messages...