How to Put L1 and L2 on A Graphing Calculator
L1 and L2 norms are fundamental concepts in linear algebra and optimization. This guide explains how to graph these norms on a graphing calculator, including step-by-step instructions and a built-in visualization tool.
What Are L1 and L2 Norms?
Norms are functions that measure the size or length of vectors in a vector space. The L1 norm (also called Manhattan norm) and L2 norm (Euclidean norm) are two of the most commonly used norms.
L1 Norm: For a vector x = [x₁, x₂, ..., xₙ], the L1 norm is:
||x||₁ = |x₁| + |x₂| + ... + |xₙ|
L2 Norm: For the same vector x, the L2 norm is:
||x||₂ = √(x₁² + x₂² + ... + xₙ²)
The L1 norm represents the sum of absolute values, while the L2 norm represents the Euclidean distance from the origin. These norms have important applications in machine learning, statistics, and optimization.
Graphing L1 and L2 on a Calculator
Graphing calculators like the TI-84 or Desmos can help visualize these norms. The process involves defining the functions for L1 and L2 norms and then plotting them on the same graph.
Key Considerations
- The L1 norm is a diamond shape in 2D space
- The L2 norm is a circle in 2D space
- Both norms become more complex in higher dimensions
- Graphing calculators typically work best with 2D representations
Note: For higher dimensions, you may need to use specialized software or programming tools to visualize the norms properly.
Step-by-Step Instructions
-
Set Up Your Calculator
Turn on your graphing calculator and clear any existing data. Make sure it's in the graphing mode.
-
Define the L1 Norm Function
Enter the L1 norm formula for a 2D vector (x, y):
Y₁ = abs(x) + abs(y)
-
Define the L2 Norm Function
Enter the L2 norm formula for the same vector:
Y₂ = sqrt(x² + y²)
-
Set the Window Parameters
Adjust the window settings to show the norms clearly. For example:
- Xmin = -5, Xmax = 5
- Ymin = -5, Ymax = 5
- Xscl = 1, Yscl = 1
-
Graph the Functions
Select both Y₁ and Y₂ to graph and press the graph button. You should see a diamond shape (L1) and a circle (L2) centered at the origin.
-
Adjust for Different Norms
To see how the norms change with different values, you can modify the functions or use parametric equations.
Worked Example
Let's graph the L1 and L2 norms for a vector (2, 3).
Calculations
L1 norm: |2| + |3| = 5
L2 norm: √(2² + 3²) = √13 ≈ 3.605
Graph Interpretation
On the graph, the point (2, 3) will lie:
- On the L1 norm at a distance of 5 units from the origin
- On the L2 norm at a distance of approximately 3.605 units from the origin
This example demonstrates how the same point can have different "distances" depending on which norm you're using.
FAQ
Can I graph L1 and L2 norms on any graphing calculator?
Most scientific graphing calculators can handle these functions, but the exact steps may vary slightly depending on the model. The general approach remains the same.
What's the difference between L1 and L2 norms?
The L1 norm sums absolute values, while the L2 norm uses the square root of the sum of squares. This makes L2 more sensitive to large values and L1 more robust to outliers.
Can I graph higher-dimensional norms on a calculator?
Graphing calculators are primarily designed for 2D and 3D visualizations. For higher dimensions, you would typically need specialized software.