> oyts > Examples
> oyts > Examples
by ZweiBieren Oyts - Examples "Oyts" on a blue field
 

Example match-replace

Suppose we begin with this oytspace

5 connected oyts -- one labelled "a"

and among the rules for the oyt labelled a is this

rule 12: two 2-oyts and two 0-oytsa 1-oyt

Rule 12 matches at a with the part in red

same as the fice oyts above, but those leading from a are highlit in red

When the rd part is replaced according to the sule, the space looks like this

still five oyts, but some pointers are deleted

List links

A list is a sequence of oyt structures. We can think of it as each node in a 1-D space using its second link to point to an oyt at the beginning of a bunch of oyts. But. Oyt links are indistinguishable. So how to we know which link is to the next link in the list and which is to an element of the list. The trick is to use multiple oyts at each location in the list. A "list link" can be made like this, where the link is circled in blue:

list link components with links to the list element and the next list link

The left oyt has two links, one to a 1-ary oyt and the other to a 2-ary oyt. The 1-ary oyt points to the next list link. The 2-ary oyt points to a 0-ary oyt and the list element. If the list element is a no-link oyt, both pointers from the 2-ary oyt point to 0-ary oyts. That they cannot be distinguished is not a problem because both are the same.

It is convenient to diagram a list link in fat blue arrows. The diagram above would then look like

simplified list link component with links to the list element and the next list link

A three element  list would be

3 list link components with elements

Integer addition

Suppose integers are represented in unary. A sum task can be an oyt-list with two 1D oyt strings for the two operands.

 xxxxx move from the bottom of one list to the bottom of the other.

The result is the same oyt-list but with only one string of oyts.

Division by a constant

Division by two in unary arithmetic means cutting the number in half. This can be done in oyts as an operator that traverses a list and deletes every other element.

Representing 2-D space

triangles

Creating a 2-D space

We can create a 2-D space from triangles by starting with a rule that converts nothing into 3 triangles. No oyt-link arrows are shown; proper linking is left as an exercise. You may need multiple oyts to represent each node in this space.

rule 0
¤ three equilateral triangles in a row with nodes labeled C H above and A E D below

The letters denote kinds o intersections. A has edges only to the right and northeast. There is only one A intersection. H has edges left, southwest, and southeast. And so on.

Rule 1 extends the bottom row to the right continuously by adding four edges and making two new triangles:

rule 1
equilateral triangle ending a row; right edge nodes are labeled H D
three equilateral triangles at end of row; last two top nodes are G H and bottom nodes are E D

Rule 2 extends upward along the left edge. Note that the graph replacement adds the same three-triangle unit as is added by rule zero.

rule 2
five equilateral triangles at left end of row; top nodes are labeled C G G
five equilateral triangles at left of row with three triangles above them; top two nodes labeled C H; middle nodes labeled B F J

Finally, the last rule, 3, extends to the right wherever a row is above a longer row. It adds three edges to make two new triangles.

rule 3
right end of row of triangles; it lies atop another unending row; cliff-edge node is H, cliff-bottom node is J, next node is G
same as right side, but with two triangles added to the top row; H is now G, J is F, G is J, and new node is H

This diagram depicts where the growth is

applying the rules to creat 2-D space

After a while we have the still growing space. (Exercise: what is wrong with this picture? Why will it not be a state of the oyt space?)

1/6 of plane tiled with equilateral triangles.

Warped space

One of the remarkable features of relativity is that space-time is warped. Oyts may or may not represent time, but they can depict warped space. Thinking of space as a collection of little points, connected like triangles.

space as a bunch of triangles

A warp in this space means thee are more or fewer triangles at some points:

triangulated space with some removed

More than two dimensions

It is left as an exercise to the reader to develop a 3-dimensional space from oyts. Hint: there are various ways of filling space with tetrahedra.

Simulating a field

A "field" in physics is defined at every point in space; it has a direction and a strength at each point. Do you remember when your eacher sprinkled iron filings on a sheet above a magnet? The filings lined up with the directions of the magnetic field. The stronger the field, the more filings gathered at each point. In fact, everywhere in space has a magnetic field, stronger on some places, weaker in others. The impact on that field by the earth is why compasses work and why space-travelling particles do not fry our brains.

To repreent a field in oyts, let every point in a space have a pointer to a field element. This element will then be three numbers giving the strength of the field in three "orthogonal" directions.

Simulating photons

A photon is said to be a particle of light. Photons stream from the sun, bringing energy to the earth. It turns out that photons can also be thought of as disturbances in the electrical and magnetic fields. A moving maget generates electricity and moving electricity generates magnetism. So a photon wiggles back and forth between the electric and magnetic fields as it travels. This behavior can be represented by taking the average value of surrounding values of one field and adjusting the opposite field. And averages are simply addition folloed by division by an integer constant.

 

 

 
Copyright © 2018 ZweiBieren, All rights reserved. Jan 27, 2018 20:59 GMT Page maintained by ZweiBieren