# Norm

Norm[expr]

gives the norm of a number, vector, or matrix.

Norm[expr,p]

gives the norm.

# Details and Options # Examples

open allclose all

## Basic Examples(2)

Norm of a vector:

Norm of a complex number:

## Scope(3)

v is a vector of integers:

Use exact arithmetic to compute the norm:

Use approximate machine-number arithmetic:

Use 35-digit precision arithmetic:

s is a SparseArray representation of v:

The norm is always real even when the input is complex:

## Generalizations & Extensions(6)

The -norm:

The -norm:

Norm of a matrix, equal to the largest singular value:

The 1-norm and -norm, respectively, for matrices:

The Frobenius norm for matrices:

Symbolic matrix norms for a real parameter :

## Applications(3)

Estimate the mean distance from the origin to random points in the unit square:

Compare to the asymptotic result:

Solve an ill-conditioned linear system with a known solution: Get the norm of the residual:

Get the norm of the actual error:

Approximate the solution of using spatial points and time steps:

Find two solutions with fixed where the second has twice as many time steps:

Estimate the error by the norm of the difference:

Extrapolate to a better solution from the first-order convergence of the backward Euler method:

Compute a more accurate solution with NDSolve:

Compare the errors in the three solutions:

## Properties & Relations(4)

The norm of v is equal to the square root of the Dot product : is a decreasing function of :

The horizontal asymptote is the -norm, equal to Max[Abs[v]]:

The matrix 2-norm is the maximum 2-norm of m.v for all unit vectors v:

This is also equal to the largest singular value of :

The Frobenius norm is the same as the norm made up of the vector of the elements:

## Possible Issues(2)

It is expensive to compute the 2-norm for large matrices:

If you need only an estimate, the 1-norm or -norm are very fast:

Norms of general vectors contain Abs:

## Neat Examples(2)

Unit balls for using 1, 2, 3, and norms:

Different norm functions: