Chapter 11 of 11
Extending into Computation: Algorithms and Experiments
The final module invites you to treat your system as code: something that can be implemented, queried, and experimented with. Even without full programming, you will sketch algorithms and potential computational explorations of your architecture.
From Symbolic System to Computation
Treat Your System as Code
You designed a personal symbolic–mathematical system: Tree, letters, gates, Names. Now you will start treating that system as if it were code that can be implemented and queried.
No Programming Required
You do not need to write real software. Instead, you will describe algorithms in words or pseudocode and imagine how a computer could generate gates, Names, and Tree walks.
Why This Matters
If your system is precise enough to be coded, it is precise enough to be tested. Algorithms let you explore patterns, symmetries, and consequences you might not see by hand.
Roadmap for This Module
You will formalize your data structures, outline algorithms for gates and paths, design searches over Names, and sketch computational experiments and visualizations of your Tree.
Step 2 – Specify Your Data Structures
Why Data Structures?
Before you can describe algorithms, you must say what objects exist: letters, sefirot, gates, Names. In computing, these are your data structures.
Letters and Attributes
List your letters in order, like [A, B, G, D, ...]. Optionally attach attributes such as numeric value, element, or planet to each letter.
Sefirot and Positions
List your sefirot as labeled nodes: [Keter, Chokhmah, Binah, ...]. You can also assign coordinates or other attributes to each node.
Gates and Names
Gates are pairs of letters or sefirot. Names are sequences of letters. Decide if gate AB equals BA and how long your Names are.
Step 3 – Formalize Your System (Paper Exercise)
Step 3 – Formalize Your System (Paper Exercise)
Use this guided exercise to turn your system into something a computer could store.
Task A – Letters as a list
On paper or in a text editor, write:
- Your full letter set in order. Example format:
- `LETTERS = [A, B, G, D, ...]`
- For each letter, list at least one attribute. Example:
- `A: value=1, element=Fire`
- `B: value=2, element=Water`
Task B – Sefirot as nodes
- List your sefirot:
- `NODES = [Keter, Chokhmah, Binah, ...]`
- If you drew coordinates in earlier modules, attach them:
- `Keter: (0, 3)`
- `Chokhmah: (-1, 2)`
Task C – Gates and Names
- Write a sentence defining what counts as a gate in your system. For example:
- "A gate is an unordered pair of distinct letters. AB = BA."
- or "A gate is an ordered pair; AB is different from BA."
- Write a sentence defining a Name in your system. For example:
- "A Name is a sequence of 3 letters drawn from LETTERS, repetitions allowed."
Reflection prompt
- Is there any part of your system that is still vague or ambiguous when you try to write it this way?
- If yes, note it. Ambiguity is a hint that you may need to refine your definitions before coding.
Step 4 – Algorithm for Generating 231 Gates
Step 4 – Algorithm for Generating 231 Gates
Now translate the classic 231 Gates idea (or your variant) into an algorithm. We will use simple Python-like pseudocode. You do not need to run it; focus on the logic.
Unordered gates (AB = BA)
If you treat AB and BA as the same gate, you want all unordered pairs of distinct letters.
```python
LETTERS = ["A", "B", "G", "D", "H", "V", "Z", "Ch", "T", "Y", "K", "L", "M", "N", "S", "O", "P", "Tz", "Q", "R", "Sh", "Th"]
GATES = []
for i in range(len(LETTERS)):
for j in range(i + 1, len(LETTERS)):
gate = (LETTERS[i], LETTERS[j])
GATES.append(gate)
print(len(GATES)) # For 22 letters, this is 231
```
Key ideas:
- The inner loop starts at `i + 1`, so you never repeat a pair or pair a letter with itself.
- With 22 letters, this gives `22 * 21 / 2 = 231` gates.
Ordered gates (AB != BA)
If you treat AB and BA as different, you want all ordered pairs of distinct letters.
```python
LETTERS = ["A", "B", "G", "D", ...] # your letters
GATES = []
for i in range(len(LETTERS)):
for j in range(len(LETTERS)):
if i == j:
continue # skip identical letters
gate = (LETTERS[i], LETTERS[j])
GATES.append(gate)
print(len(GATES)) # For 22 letters, this is 22 * 21 = 462
```
Your task
- Decide whether your system uses unordered or ordered gates.
- Adapt the pseudocode above to match your definition (e.g., change LETTERS, allow or forbid repeats, etc.).
Step 5 – Tree Traversal and Walks
Tree as Graph
Your Tree can be seen as a graph: nodes are sefirot, edges are paths. Listing NODES and EDGES makes it possible to traverse the Tree algorithmically.
Edges as Pairs
Represent each connection as a pair of node names, like ("Keter", "Chokhmah"). A list of such pairs fully specifies your Tree's connectivity.
Depth-First Search Idea
Depth-first search walks from a start node to neighbors, going as far as possible before backtracking. It can find all simple paths between two sefirot.
Visualizing Walks
Picture your Tree on screen: nodes as circles, edges as lines. A traversal algorithm highlights one edge at a time, drawing a glowing path through the Tree.
Step 6 – Design a Search or Enumeration Experiment
Step 6 – Design a Search or Enumeration Experiment
Now you will plan one computational experiment on your system. Choose one of the scenarios below and outline it in your notes.
Option A – Exhaustive search over Names
Goal: Find all Names in your system that satisfy a pattern.
- Define the pattern. Examples:
- Names whose total numeric value is prime.
- Names that start with a letter from one pillar and end on another.
- Describe the algorithm in words:
- "Loop over all possible Names of length 3, compute their value, keep only those that are prime."
- Predict what you might discover:
- Clusters, gaps, or symmetries in where such Names appear.
Option B – Random walk on the Tree
Goal: Explore how a random path behaves.
- Define the rules:
- Start at Tiferet.
- At each step, randomly choose one connected sefirah.
- Record the sequence of visited nodes.
- Decide what to measure:
- How often do you visit each sefirah in 1000 steps?
- How long does it take, on average, to reach Malkhut from Keter?
Option C – Gate statistics
Goal: Analyze the distribution of gate attributes.
- Assign each letter a numeric value or category.
- For each gate, compute something (sum, difference, category pair).
- Look for patterns:
- Are some totals much more common than others?
- Do certain letter categories pair more often?
Write down your chosen option, rules, and what you expect to learn. This is your first computational research question about your own system.
Step 7 – Quick Check on Algorithms
Step 7 – Quick Check on Algorithms
Answer this question to check your understanding of gate generation and search.
You have 10 distinct letters and you define a gate as an unordered pair of **distinct** letters (AB = BA, no AA). How many gates are there, and which algorithm sketch correctly generates them?
- There are 45 gates; use two loops with j starting at i + 1.
- There are 90 gates; use two loops with j starting at 0, skipping i == j.
- There are 100 gates; use two loops from 0 to 9, including i == j.
- There are 10 gates; pick a random partner for each letter once.
Show Answer
Answer: A) There are 45 gates; use two loops with j starting at i + 1.
For unordered pairs of distinct items, the count is n*(n-1)/2. With n = 10, that is 10*9/2 = 45. The correct algorithm uses nested loops where j starts at i + 1, ensuring each pair appears exactly once and never pairs a letter with itself.
Step 8 – Review Key Terms
Step 8 – Review Key Terms
Use these flashcards to reinforce the main computational ideas from this module.
- Data structure
- A precise way to organize and store information (such as letters, sefirot, gates, Names) so that algorithms can operate on it.
- Algorithm
- A step-by-step, finite procedure for accomplishing a task, such as generating all gates or finding all paths between two sefirot.
- Enumeration
- Systematically listing all objects of a certain kind (e.g., all gates, all Names of a fixed length, all simple paths on the Tree).
- Random walk
- A path formed by repeatedly moving from the current node to a randomly chosen neighboring node, used to explore the dynamics of a graph.
- Depth-first search (DFS)
- A graph traversal method that explores as far as possible along each branch before backtracking, useful for finding all simple paths.
- Visualization
- A graphical representation (such as a plotted Tree with highlighted paths) that makes structures and patterns in your formal system easier to see.
Key Terms
- Gate
- In this context, a pair of letters (or sefirot) defined by your system, often used to represent connections or transitions.
- Algorithm
- A clearly specified, step-by-step procedure for solving a problem or performing a computation.
- Enumeration
- The process of listing all objects of a certain type according to explicit rules, typically so that none are missed or repeated.
- Random walk
- A sequence of moves on a graph where each step chooses a neighboring node at random, used to study probabilistic behavior on the Tree.
- Visualization
- Turning abstract structures (graphs, sequences, distributions) into images or animations to reveal patterns and symmetries.
- Data structure
- A formal way to store and organize elements of your system (letters, sefirot, gates, Names) so they can be manipulated by algorithms.
- Tree traversal
- Any systematic method for visiting nodes and edges of your Tree-as-graph, such as depth-first or breadth-first search.
- Depth-first search (DFS)
- A traversal algorithm that explores one branch of a graph as deeply as possible before backtracking to explore alternatives.