title: A closer look at the soup
gradient: top_bottom black blue

# A closer look at the soup
<div style="float: right">
<img src="bluvenus.jpg">
</div>

Matt's soup from orbit:

* It's omnipresent
* It's omnitenerent (except possibly trans fats)
* ...and that's it.
<br/>
<br/>
<br/>
<br/>
<br/>
<br/>
<br/>
<br/>
<br/>
<br/>
<br/>
<br/>
<small>Note that while no concepts were irrevocably harmed in preparation of this presentation it does contain egregious abuse of notation and graphic scenes of undefended asymptotes.</small>

# Coming closer

<img src="soup2.jpg" width = 800>

# And closer

<img src="oil3.jpg" width = 800>

# .
<img src="spore_2.png" style = "float: left; position:absolute; top:0; left:0">

# Better, but we're still not there yet.

<img src="0508fig1.jpg" width = 600>

# Ah, here we are.

<img src="numbers.jpg" width = 1300 style = "float: left; position:absolute; top:0; left:0">

# A brief refresher course
<div style="float: right">
<img src="cos.png">
</div>

* Vectors have a geometric interpretation
* a&sdot;b = |a|&sdot;|b|&sdot;cos(&theta;) = &Sigma;a<sub>i</sub>&sdot;b<sub>i</sub>
 - a&sdot;a = |a|<sup>2</sup> = square of the length
* a&times;b = |a|&sdot;|b|&sdot;sin(&theta;)&sdot;(_a unit vector perpendicular to both a and b_)
 - Meaningless for n < 3
 - Coals to Newcastle for n > 3

* Integral of a distribution

<div style="float: right" ><img src="bell.png" width=200>
</div>

<div style="float: right"><img src="s-curve.png" width=200>
</div>

# Start with simple vectors

* One element in the range -1.0..1.0
<div style="float: left">
<img src="pm_real_abs_1.png">
<hr/>
|a| will be uniformly distributed over 0.0..1.0
</div>
<div style="float: right">
<img src="pm_real_dot_1.png">
<hr/>
a&sdot;b/|a||b| &asymp; 2&sdot;a&sdot;b
</div>

# For two dimensions

* Two elements &isin; -1.0..1.0

<div style="float: left" ><img src="pm_real_abs_1_2.png">
i<hr/>
The a<sub>i</sub>s making up |a| tend to average out.
</div>
<div style="float: right"><img src="pm_real_dot_1_2.png">
<hr/>
The a<sub>i</sub>&sdot;b<sub>i</sub> terms tend to cancel out
</div>

# Lots of dimensions, values still in -1.0..1.0

<div style="float: left" >
<img src="pm_real_abs.png">
<hr/>
|a| is generally pretty close to (&radic;n)/2
</div>

<div style="float: right">
<img src="pm_real_dot.png">
<hr/>
a&sdot;b is generally pretty close to 0
</div>

# Values in {-1,1}

* In one dimension, it's [1] or [-1]
 - |a| is always 1
 - a&sdot;b is 1 or -1
* In two, it's &isin; { [1,1], [1,-1], [-1,1], [-1,-1]} 
 - the corners of a square
 - |a| is &radic;2
 - a&sdot;b/|a||b| = 1 for 1/4, 0 for 1/2, -1 for the other 1/4
* In general
 - the corners of a hyper-cube
 - |a| is &radic;n in n dimensions
 - The dot product will distribute as (k n)

# Values &isin; {-1,1}, graphically

<div>
<div style="float: left" ><img src="pm_int_abs.png"></div>
<div style="float: right"><img src="pm_int_dot.png"></div>
</div>
<hr/>
<center>Loosely speaking, it looks a lot like the continuous case.</center>

# Values in {0,1}

<div style="float: left" ><img src="pos_int_abs.png"></div>
<div style="float: right"><img src="pos_int_dot.png"></div>

# Values in {0,1}, with 1s rare compared to 0s

<div style="float: left" ><img src="p_r_int_abs.png"></div>
<div style="float: right"><img src="p_r_int_dot.png"></div>

# Shameless sweeping generalization

There are scads of other options 

* {-1,0,1}
* {0,1,2,3,...255}
* {&plusmn;1, &plusmn;1/2, &plusmn;1/3...}
* etc. 

But when n gets large we pretty much always have:

* |a| &asymp; some constant (most of the time)
* a&sdot;b &asymp; 0 (most of the time)

# So what could we do with these?

Or better, what couldn't we do with them?

* Write abstruse papers for obscure journals
* Wrap fish
* Quantum mechanics
* Use them as GUID (for G &ne; "Global")
* Waste memory
* Concoct goofy presentations

# Fun cross product facts

* <b>a</b>&times;<b>b</b> = [ a<sub>2</sub>b<sub>3</sub>-a<sub>3</sub>b<sub>2</sub>, a<sub>3</sub>b<sub>1</sub>-a<sub>1</sub>b<sub>3</sub>, a<sub>1</sub>b<sub>2</sub>-a<sub>2</sub>b<sub>1</sub> ]
* if a&sdot; b = 0 and c = a&times;beta we can find c from a & b, b from a & c, and a from c & b
* Doesn't make sense except when n = 3
- Beyond quaternions
- If n is a multiple of 3 we can take the components in triples and write:

<img src="Cross_product_vector.png" style = "float: right" width = 300 foo = "; position:absolute; top:0; left:0">

a&times;b = [

  &nbsp; a<sub>2</sub>b<sub>3</sub>-a<sub>3</sub>b<sub>2</sub>, a<sub>3</sub>b<sub>1</sub>-a<sub>1</sub>b<sub>3</sub>, a<sub>1</sub>b<sub>2</sub>-a<sub>2</sub>b<sub>1</sub>, 

  &nbsp; a<sub>5</sub>b<sub>6</sub>-a<sub>6</sub>b<sub>5</sub>, a<sub>6</sub>b<sub>4</sub>-a<sub>4</sub>b<sub>6</sub>, a<sub>4</sub>b<sub>5</sub>-a<sub>5</sub>b<sub>6</sub>, 

  &nbsp; a<sub>8</sub>b<sub>9</sub>-a<sub>9</sub>b<sub>8</sub>, a<sub>9</sub>b<sub>6</sub>-a<sub>7</sub>b<sub>9</sub>, a<sub>7</sub>b<sub>8</sub>-a<sub>8</sub>b<sub>7</sub>,

  &nbsp; : 

  &nbsp; ]

# Consider two object c and c'

* c' := c&sdot;(1-&epsilon;) + (a&times;b)&sdot;&epsilon;
* c' is pretty close to c ( c&sdot;c' &asymp; |c|&sdot;|c'| )
* Given c' and a we can probably get b back:

 (c'&times;a)/&epsilon; = c&sdot;(1-&epsilon;)&times;a/&epsilon; + (a&times;b)&times;a &asymp; 0 + b

# One way to read this:

* c = an object
* a = a property name
* b = a value
* c' = "an object mostly just like c but if we ask it for something like a we'll get back something like b"
* c.a := b &rArr; c &larr; c&sdot;(1-&epsilon;) + (a&times;b)&sdot;&epsilon;
* c.a      &rArr;  (c'&times;a)/&epsilon; = c&sdot;(1-&epsilon;)&times;a/&epsilon; + (a&times;b)&sdot;&times;a

# TNSTAAFL

![](freelunch_thumb.jpg)

# But wait, there's less!

 c.a := b

 c.a := d

 c.a &rArr; b &cup; d

Starting over with e instead of c, we could try:

 e.a := b

 e.a := &not;b <i>(-1&sdot; the vector representing b)</i>

# Key encoding

Instead of: 

 c.a := b &rArr; c &larr; c&sdot;(1-&epsilon;) + (a&times;b)&sdot;&epsilon;

we probably really want something like:

 c.a := b &rArr; c &larr; c&sdot;(1-&epsilon;) + ((a&times;<sub>1</sub>k)&times;<sub>2</sub>b)&sdot;&epsilon;

Where &times;<sub>1</sub> and &times;<sub>2</sub> are cross-product analogues with different partitionings and k is an arbitrary vector.

This lets us distinguish c.a := b from c.b := a.

# Other reasons to structure the keys

* We can code more information in the linkage; by using different "k"s we could distinguish things like:
 * Keys
 * Indexes
 * Methods
 * Instance variables
* By "scrambling" like this we can also deal with cases where the key (or value) is the object itself.

# The null key encoding

So what does the null-encoding

 c' = c&sdot;(1-&epsilon;) + b&sdot;&epsilon;

mean?  

The a has dropped out entirely, and in general c' will have the same properties c had.  Only on issues where c is mute will b have any impact.

# Levels of interpretation

* Oth order: Color = (Red,Yellow,Blue)
* 1st order: struct { int x; int y; }
* 2nd order: javascript, anyone?
* Where next?
 * Smalltalk/Ruby inheritance
 * Matt's favorite, FSMs
 * Extending &not; to genera & difference
 * Turtles all the way down

# Relationships are objects

* A bare relationship is a triple {subject, role, value}
* But this is just a vector
* The role component has inheritance

  ... relative &larr; ancestor &larr; grandparent &larr; grandmother ...

* Relationships can be more structured (frames)
 * [the sum of 1 and 2 is 3]
 * Movie tropes
* Can be written as Prolog
* This is Matt's soup!

# Skipping a few hours of material

<img src="spiral-clock.jpg" width = 600>

# Bootstrapping the soup

* Assign a random vector to each thought/concept/category
* Using the declared structure as a guide
 * Iteratively adjust the vectors
 * Stop when they represent the desired structure

# Refinements

* Let them move a lot at first (large &epsilon;) and cool down as they converge
* Lock the structure eventually in with a small &epsilon;
* Or use the template to form standing waves
* Introduce thoughts incrementally and have old thoughts move more slowly

# Final outcome is basically the same

What you get is a density function over a Hilbert space.

![](primordial_soup.jpg)

# So where does that leave us?

* Spaces are composable
* Neighbors
 * Lots of them: 
  - i = 1, n = 2, |{r &le; i}| = 2
  - rises roughly as i<sup>n</sup> with some &pi;s
 * Very minor (but meaningful) differences
* Easy dot product circuit
* Find by pattern / unification / matching
* Analogues to modal reasoning models (temporal, counterfactual, intensional, provisional, etc.)
* Failure modes suggestively similar to known human mental failure modes.

# Finding our way in the soup

![](fog2.jpg)

# What does this mean?

![](one.png)

# How about this?

![](two.png)

# But this, on the other hand:

![](pair.png)

# One possibility

![](triangle.png)

# The other

![](pair_plus.png)

# We'll probably see things like this

![](chain.png)

# And this

![](cycle.png)
