Quick Foundation: Vector Spaces
Quick Foundation: Vector Spaces
Visualizing entities as points (represented by a list of numbers) in vector spaces
Single numbers (1D)
Single numbers (1D)
Simple case
Simple case
Which numbers are closer to each other?
{1,6,8,19,7,21}
Let’s visualize them:
In[]:=
NumberLinePlot[{1,6,8,19,7,21}]
Out[]=
Let’s make it a little more complex ...
Let’s make it a little more complex ...
Which numbers are closer to each other?
In[]:=
numbers=RandomSample[Join[RandomReal[{10,13},10],RandomReal[{25,28},10],RandomReal[{1,7},50],RandomReal[{30,40},50]]]
Out[]=
{4.25403,30.7142,4.40476,3.38755,27.2987,4.2708,33.8783,35.1643,3.65445,30.4027,6.71415,32.9827,5.04295,25.8938,5.02151,31.4623,37.6577,37.4142,37.4263,5.8794,39.8399,6.09207,11.2573,39.751,2.33068,12.9897,12.0145,35.1698,12.6782,6.23764,25.6059,4.71742,11.8758,38.4643,35.8929,10.3488,38.2154,38.387,39.7724,2.88453,39.8988,36.7053,12.4334,30.6617,35.0808,1.46546,6.76352,34.943,32.2342,4.19143,36.5207,38.1076,4.42879,3.21333,10.5117,38.7346,1.16713,3.35479,26.1201,37.8757,5.87449,35.6587,2.49167,37.9026,26.3139,30.591,1.52363,2.12388,12.2307,31.0935,37.3176,36.1359,5.95156,3.48053,26.5981,2.73265,34.4379,34.5808,2.72307,5.49883,2.09522,5.68567,4.26475,26.7614,2.86427,33.0831,10.0717,39.5081,2.00047,31.885,26.2624,35.3847,4.59589,31.3017,6.41973,6.87597,33.2252,2.43761,38.0704,38.6547,6.43457,27.5149,35.6866,2.54295,32.8419,26.4633,1.17287,33.6398,6.56969,1.57695,33.8738,3.73508,36.3462,4.42405,4.79996,2.75906,36.0912,1.15128,34.9463,3.48228}
Visualization helps:
In[]:=
NumberLinePlot[numbers]
Out[]=
Distance of one entity from another ...
Distance of one entity from another ...
What is the distance from one number to another?
In[]:=
21-19
Out[]=
2
In[]:=
21-1
Out[]=
20
Which number is further away from 21?
Pairs of numbers (2D)
Pairs of numbers (2D)
Simple example
Simple example
Let’s move to 2 dimensions.
Say something is represented by 2 numbers. Here are 4 such things:
Say something is represented by 2 numbers. Here are 4 such things:
{{1,3},{3,4},{7,7},{8,10}}
How far are they from each other?
Out[]=
Can you think of something represented by 2 numbers?
Can you think of something represented by 2 numbers?
Geographic coordinates: Latitude and Longitude
In[]:=
coordinates={{41.837,-87.681},{39.763,-89.670},{40.115,-88.273}};
In[]:=
GeoListPlot[GeoPosition/@coordinates,GeoRange->,GeoLabelsTrue]
Out[]=
Similar idea as the first example with pairs of numbers:
Similar idea as the first example with pairs of numbers:
Out[]=
Triplets (3D)
Triplets (3D)
N Dimensions
N Dimensions