# Robust-first Computing Wiki

dev:quiz_ulam

### Table of Contents

There are some interesting things to Think before we run it on the MFM simulator. We can do such thinking like quizzes.

### Here is quiz# 1

What would be the short and long term behavior if you started a simulation with a filled circle of the Box atoms (occupying perhaps 4% of the grid sites) in the center of an otherwise empty grid? What would you expect see to over 1K, 10K, 100K AEPS?

Answer: I start with two boxes side by side. There are four possible formations. In some cases, their interactive swapping will let them jump out of the box. I guess in the short term, like 1K AEPS, they can stay in the circle. But after 10K AEPS, they may spread out. Maybe still in small clusters or pairs. After a very long time, 100K AEPS, they can find some place and do their box move on their own.

Left 30kAEPS Right:100kAEPS

Comments There are a few more key insights. For example, under what conditions could two interacting Boxes split up and both start doing clean non-interacting boxes on their own? It is as another kind of neutral dynamics, like this one.

### More about Box

Under what condition will some Boxes dance alone and some other dance in pair? We guess if we put a solid circle of Boxes in the middle of the canvas, after a very long time, maybe months, years or decades, all the Boxes dance alone except there is a last pair of them.

Is this pair of Boxes stay together forever? No, When the pair randomly walk around and pass by a single Box, one of the pair maybe dropped out and the single one will be picked up. Isn't it interesting? A Box is trapped in a 2 by 2 area, however when two of them are together, they are not bound to a fixed position any more and they begin to walk.

#### The moves of a single Box

A Box repeats the west, north, east, east pattern. After FOUR events, it returns to the origin location. When we are talking about move west, the Atom actually swap with its west neighbor Atom. This is same for the other three directions.

We can break down the pattern into x-direction moves and y-direction moves. The y direction-moves are actually irrelevant to x-direction moves. A Box returns to its origin x position after TWO 'Big events'–each big event is worth TWO normal events. So it is possible to focus just on one direction now and combine the transition of two directions later. Here we choose x-direction for analysis. Assume we can use a x-Half-Box Element to represent only the x-direction moves of Box. Actually we already have that Flip Element which moves one step back and forth along the x-axis.

Let's first make some short hand to record the move that Flip Atoms will take. For Atom a. We denote a moving west as a and a moving east as A. Similarly for Atom b, b means b moves west and B means b moves east. If we observe the moves of a standalone Atom a, the moves we record is aAaAaA….. When a and b are side by side, we can observe the moves of this pair. The record will look like aAaAbBbBabABbBbBaAbaAB….. due to the random and asynchronous feature of the MFM simulator.

Fortunately, we can simplify this string into one of the six basic patterns: aAbB, abAB, abBA, baAB, baBA, bBaA. Then we can see how this pair behaves under these six patterns.

Four out of the six patterns actually preserve the origin location of the pair of a and b. They are aAbB, abBA, baAB, bBaA. After four events, the pair returns to its start position. The abAB pattern will take the pair ONE step to the west and the baBA pattern will take the pair ONE step to the east. Now we see why a pair is no longer bound to the origin place and begins to move. This is a 1-D random walk with the probability of 1/6 to go west, chance of 1/6 to go east and chance of 2/3 to stay. The y-direction moves are just transposes of the x-direction moves. The combination of x-direction and y-direction moves will let the pair walk in the 2-D canvas and the pair will never stop.

The diagonal formations of a and b in 2-D space has no effect in moving the pair. Only the horizontal or vertical position of a and b can move the pair.

Will we have 3-D and other high dimensional MFM in the future? The spatial concept is so essential for the MFM, and if we have high dimensional MFM, this HD MFM seems to me maybe like the structure of human brain.

#### Observe Boxes

To collect data about how Boxes move we can create a new Pbox Element. This Pbox means pair of Boxes. A single Atom of Pbox behaves very similar to a Box. This new element is just for statistic usage. We observed that a single Box is trapped in a box range. It only swaps with Empty sites. On the other hand, if a pair is formed, one Box in this pair swaps with not only Empty but also another Box. According to this, we can use a counter Int(8) countAlone to record this difference. If a Box swaps with Empty, we reduce the value of countAlone. If a Box swaps with another Box, we increase this value.

We let a Box transform to a Pbox if its countAlone value is positive. We also let a Pbox transform to a Box if this value is less than -15. These threshold values comes from some experiments and can be tuned in the future.

At the start of out experiment, we put 1% Boxes. They began to interact immediately and most of them transformed to Pboxes in a short time. After some time, some Pboxes were dropped out of a pair and they became Boxes again. The transformation kept going. At some time, there was only one pair left.

The number of pairs is actually 1/2 of the number of Pbox. Then we get some pictures of the time for Boxes transform to Pbox and finally one one or two pairs are left walking.

### Boxes Experiments

Here are some more experiments on the dancing of Boxes and Pairs. We assume that a dancing Pair can leap further if it encounters some Boxes on its trail. This is possible because a standalone Box may replace one dancer of the Pair to form a new pair. And the visual effect seems that the Pair leaps from its origin position to the Box's position.

#### Base Case

We first observed how a single Pair moves without interacting with other Boxes. We put a Pair in the center of a square stage of 4 by 4 tiles (128*128=16384 sites). We let the Pair dance for 50 kAEPS. This size of the MFM simulator and the time length is set so because we hope the pair will not hit the boundary too much. We want to observe the natural position of the Pair as if it is dancing on a infinite large stage. However, 10 out of 51 experiments still got the Pair hit the boundary. We also tried bigger stage of 6 by 6 tiles. In this case, the AER decreased from 60 to 30. Although the Pair hit the boundary less, but this may be the result of the less event it acquired and the decreased distance it walked. So we finally used 4 by 4 stage in the following experiments.

We plot the 41 end-positions of the Pair as the picture. The left graph shows this base case of the Pair's random walks. The average distance that the Pair traverses is 46.9 with a standard deviation of 20.7 (The distance is measured as the mahattan distance in 41 runs).

Looks like we need a lot more data there, right? Yes, we need more data points.

#### Shot Case

We put a line of Boxes, east of the center of the 4 by 4 stage. The population of this line is relative dense because each Box in the line is only 3 sites away from its horizontal neighbor.

How this single trail can interact with the Pair? After 50 kAEPS. We found the end-positions are not scattered randomly as they are in the base case.They are interfered and over 42% of them are in the first quadrant. We have more situations of hit-boundary than the base case. We suppose this is because of the interactions of the Pair and the Boxes, 12 Out of 40 experiments had this result. Another interesting thing we observed is sometimes the interaction produced more Pairs. There are 2 experiments end with more than one Pairs. We need more experiments for the Shot Case because the much higher unexpected results of hit boundary and multiple Pairs. The middle graph shows this Shotgun case of the Pair's interfered walks. In the 26 experiments, the average distance that the Pair traversed is 41.8 and the standard deviation is 19.3. Almost the same average distance only the direction or the end-positions are affected because of the line of Boxes. We already ran 10 more experiments. We can merge the results soon.

The following pictures show the layout of our experiments. The left graph shows part of the layout of Shot Case experiment. Each Box in the line is 3 sites away from its neighbor. The middle graph shows part of the layout of Grid Case experiment. Each Box in the grid is 3 sites away from its vertical neighbor or horizontal neighbor. This dense population will create a chain reaction. The right graph shows part of the layout of Grid Case experiment. Each Box in the grid is 7 sites away from its vertical neighbor or horizontal neighbor.

#### Grid Case

This is the real party here. We put a lot of Boxes into the stage. They are dancing alone on a 8 by 8 grid (Each Box is horizontally and vertically 7 sites away from its neighbor.). There are more interactions between Pair and Boxes. We had to expand the distance of Boxes from 3 to 7. The short distance brought a chain reaction. More and more Pairs are produced and we cannot see how the origin Pair walks. The left graph is the chain reaction of a 4 by 4 grid (3 sites distance) after about 30kAEPS.

The intensive interactions let the Pair hit the boundary more often. Also the chance of produce more Pairs is greater. In 11 of the 32 runs, the Pair hit boundaries. In 4 of the 32 runs, more Pairs were created. So we have only 17 runs that produced the results we can use. The right graph shows this Grid case of the Pair's interfered walks. In the 17 experiments, the average distance that the Pair traversed is 48.0 and the standard deviation is 18.8. So we can at least say that the Boxes grid helped to extend the average mahattan distance that a Pair can traverse from around 40 to 50 (in 50kAEPS).

The left graph is 526 Base Case runs on 2 by 2 simulator after 12 kAEPS. Average distance for Shot Case is 18.8. Standard deviation is 9.9. The middle graph is 642 Shot Case runs for the same size and time. Average distance for Shot Case is 19.2. Standard deviation is 10.2.(This time Pairs do not seem to favor the 1st quadrant. We see better with more data points.) The right graph is 466 Grid Case runs. Average distance for Grid Case is 19.4. Standard deviation is 10.0. (This time the three layouts seemed to produce similar end-positions. )

nearly 1/4 data in the {2C2} experiments are invalid because of they hit the boundary. To rule out the influence of th missing data points(those hit the boundary), we ran the experiments on bigger simulator again. The left graph is 516 Base Case runs on {4C4} simulator after 10 kAEPS. Average distance for Base Case is 21.1. Standard deviation is 11.8. The middle graph is 604 Shot Case runs on {4C4} simulator. Average distance for Shot Case is 21.8. Standard deviation is 11.9. The right graph is 521 Grid Case runs on {4C4}. Average distance for Grid Case is 23.1. Standard deviation is 13.0.

In the bigger simulator and less time length, we had no data hitting the boundary. The {4C4} average distance we got seems greater than the {2C2} average distance. However, nearly 1/4 of the {2C2} data fell out of the edge. So the actual average distance in {2C2} should be greater than the data shows. In both experiments, we can see the grid helped to extend the range a Pair traversed. The extension in {2C2} seems to be less than 5% (from 18.8 to 19.4) because more data points fell out of the edge. In {4C4} experiments, the average distances are extended nearly by 9% (from 21.1 to 23.1). This shows that the some pulses that travel faster than walks are produced in the grid.

The end-positions of the experiments didn't show obvious bias. That's fair because of the initial layout of our experiments. When Boxes are evenly placed in grid pattern, they attract the Pairs evenly, which will produce no bias. When Boxes are placed in a line, they are too sparse to trap Pairs. This did not produce bias either. In the following experiment, we will place a bunch of Boxes in the 1st quadrant. This cluster of Boxes will attract the first Pair and produce more Pairs. Then, the end-positions will show obvious favor to the 1st quadrant.

The above graph is what we saw if we put the three pictures together. If the end-positions of Pairs are not surprising, how about the Boxes? Did they still remain in line or in grid? How they were messed up by the Pair?

Excluding runs that hit the boundary messes up the data. Should use a bigger grid, so that hitting the boundary is very rare. It will run slower but just use more machines. And we don't care if more pairs are created, right? We just wanted the distance to the farthest pair.

Q:20-Jun-2015 09:11:31PM-0600:Yes, we can use bigger simulator to find out the relative different outcomes of these three layout. I still have this question. The farthest pair maybe does not travel to this location. It's possible that this pair is formed somewhere and then travels to the farthest location. Do we count this new formed pairs?

A:20-Jun-2015 10:55:40PM-0600: When a pulse of electricity flows through a wire, do you think it's literally the same electrons coming out one end that went in the other end? The electrical pulse travels much faster than do individual electrons in the wire. The same thing here. There is no differerence between the first pair that starts the dynamics, and some later pair that the first pair takes part in creating by “cutting in” and so forth. For purposes of this experiment we only cared about how fast 'pboxness' can travel.

20-Jun-2015 11:58:06PM-0600 Thank you! That's much clear! We care about the pulse more than the individual one here. I am running a 6 by 6 Shot Case this night. I hope this experiment can show us more obvious bias because of the preset Boxes lines. In the previous experiments, we observed the line of Boxes may let the Pair favor the first quadrant. I don't know if this preference comes from the clockwise swap order of each Box. This time I put more Boxes in the first quadrant. I am hoping that the Pair will fall more often into the first quadrant than the other three areas. We can see the result tomorrow morning.

The new Shot Case layout helped to create a great bias. The result is as what we had expected. Almost 75% of the Pairs ended up at the first quadrant. Only this 6 by 6 tiles simulator runs quite slow on my 2 cores computer. It took near 50 minutes for a 50kAEPS run. When more Pairs were created, we simply measured the farthest Pair's location. Although we chose a much bigger simulator this time, The Pair hit the boundary in 8 experiments.

dev/quiz_ulam.txt · Last modified: 2015/06/28 11:52 by xychen