This course answers the questions, What is data visualization and What is the power of visualization? It also introduces core concepts such as dataset elements, data warehouses and exploratory querying, and combinations of visual variables for graphic usefulness, as well as the types of statistical graphs, tools that are essential to exploratory data analysis.

Associate Professor at Arizona State University in the School of Computing, Informatics & Decision Systems Engineering and Director of the Center for Accelerating Operational Efficiency School of Computing, Informatics & Decision Systems Engineering

K. Selcuk Candan

Professor of Computer Science and Engineering Director of ASU’s Center for Assured and Scalable Data Engineering (CASCADE)

It turns out that there are different ways to measure the length of a vector,

and we usually call these as norms,

norm of s vector, length of a vector.

And we measure the length of a vector in different ways.

So, we'll go over these and I will basically provide some examples

of why we have these different ways of measuring the vector,

and in which context they are used.

So, the first way to measure the distance of a vector is

called 1-norm or also known as L1 distance,

also known as Manhattan distance,

also known as a city block distance.

So let's take a look at an example.

In this example, we have,

two vectors, again V1 and V2.

We have distance vectors,

difference vectored between V1 and V2,

And we are trying to measure its length.

The definition of the 1-norm is that,

given these two vectors,

first find the difference in along the X basis vector,

then find their difference along the Y basis vector.

Take these absolute values of this differences and add them up.

So, that is the first definition of a length of a vector. Let's see an example.

So, in this case, we have vector V1 which is represented as 2,7.

We have another vector V2,

which is represented as 12,1.

The difference along X is 10 units.

The difference along Y is six units.

So, in this case we call the distance between these two vectors as 16 units.

Now what's the meaning of this?

Well the meaning of this essentially it goes to

this idea of Manhattan distance or city block distance.

So, this essentially, is if think of basically this as a city block,

and you have basically a city block with

10 miles on one side and six miles on the other side,

and you want to go walk from this corner to this other corner.

How many miles would you need to walk?

In this case, you would need to walk 16 miles.

So, this is the actual definition of the 1-norm distance.

And if you are measuring distances in 1-norm, essentially,

what we are doing is we are basically measuring

the differences along each of the components,

each of the bases vector separately,

and we are adding them up.

2-norm more commonly known as the

Euclidean distance L2 distance,operates a little bit differently.

So, let me see how it is defined.

In this case we again have a vector V1 and vector V2.

Vector V1 is defined as X1 along the first dimension and Y1 along the second dimension.

Vector 2 is defined with X2 along the first dimension and Y2 along the second dimension.

Once again, the difference long X is X1 minus X2.

The difference along Y is Y1 minus Y2.

But in this case instead of taking

the absolute values of these two terms and adding them up,

I am taking the squares of these individual distances,

I add the squared values,

and then I take square root of the sum.

So, let's see an example. So, we again have the same vectors that we had before.

Remember from before that in

this example the difference along the X dimension is 10 units,

the difference along the Y dimension is six units.

To compute Euclidean distance,

I am taking the square of six.

I'm also taking the square of 10.

I'm adding these two terms together,

I obtain 136, and then I take square root of it. It is 11.66.

So essentially, the intrusion of this is basically in the Euclidean space,

in a space defined by Euclidean distance vectors,

If I walk from this point to this point directly,

or if this was a city block,

if I could fly from this point to this point,

or if there was a tunnel in the city so I could

basically walk from this point to this point along the tunnel,

I would need to basically displace 11.66 units.

So, this is the definition of 2-norm and this is

how we measure distances in Euclidean spaces.

Note that 1-norm and 2-norm are different ways to measure distances.

But the one thing that you can notice if you sort of look causally is that

when we had 1-norm, the distance was 16,

when we have to arm the distance is 11.66 In fact,

what happened is that the overall distance became more

similar to the larger of the two values.

Before, the value was 16.

It had equal contribution from six and 10.

That's why the sum was 16.

But now in 2-norm the most of

the contribution comes from the largest term, the biggest difference.

So, this essentially, become how we decide in an application whether we use 1-norm,

or 2-norm, or 3-norm.

We are using 1-norm,

if we give the same amount of weight to all features in the space.

We give 2-norm if you want our distance to be more heavily weighted by the feature,

or by the basis vectors,

or by the dimension which have the largest difference.

In fact, in the extreme case,

we define what is known L infinity distance or infinity norm where once again

we compute the distances X1 minus X2 along x-axis,

Y1 minus Y2 along y-axis.

But in this case, instead of adding them up in any way,

we simply take the maximum of these two.

So, in the extreme case when we use infinity norm,

we have in this example six units difference along Y1 and Y2,

we have 10 unit of difference along X1 from X1 to X2.

The Infinity norm in this case,

is maximum of these two types Maximum of six and 10, It is 10.

So, note that essentially,

in this case the distance has no contribution from

the dimensions Y which has a small difference.

So in this example,

the difference in the Y direction could have been two,

could have been three, could there be one,

could have been five, it wouldn't matter.

The biggest contribution to the distance it would come from the unit 10,

the difference 10, and that's why the total distance would have been 10.

Now, as you can see there are different ways to define distances in a vector space.