Physics Tools
Physics Tools
Interactive demos and calculators for exploring physics and mathematics. These tools make abstract concepts tangible and demonstrate how we turn theoretical ideas into working code.
Overview
Physics and mathematics are the foundation of computing. These tools help us:
- Visualize abstract concepts
- Explore mathematical relationships
- Calculate complex scenarios
- Understand the universe through computation
Each tool is designed to be:
- Interactive — Real-time feedback and exploration
- Educational — Clear explanations of the underlying math
- Accurate — Mathematically correct implementations
- Beautiful — Visualizations that aid understanding
Available Tools
Boolean Function Solver
Interactive Truth Table Explorer
A comprehensive React-based tool for exploring all 16 two-input boolean functions and their properties. Originally developed as part of a conversation about boolean algebra and digital logic.
Key Features:
- Interactive truth table editor (click cells to toggle)
- Real-time visualization of all 16 boolean functions
- Walsh-Hadamard (Fourier) coefficient calculation
- Shannon entropy and information analysis
- NAND-based circuit synthesis
- 3D visualization of function properties
- Live solvers that run on every interaction
Use Cases:
- Digital logic design
- Boolean algebra education
- Circuit synthesis
- Quantum computing foundations
- Mathematical exploration
The Boolean Solver Story
The Boolean Function Solver was created during an extended conversation exploring the foundations of computing. It started with a simple question: “How do we visualize all possible 2-input boolean functions?”
What emerged was a complete mathematical framework for understanding boolean logic:
- Truth Tables as Geometry — Each function is a 2×2 grid pattern
- Visual Representation — Shaded cells represent TRUE outputs
- Mathematical Analysis — Walsh-Hadamard coefficients reveal spectral properties
- Information Theory — Shannon entropy quantifies information content
- Circuit Synthesis — Automatic NAND gate network generation
The tool demonstrates how pure mathematics can be turned into interactive software that’s both useful and educational.
Mathematical Foundations
Boolean Algebra Basics
A boolean function with n inputs has 2^n possible input combinations, and therefore 2^(2^n) possible functions.
For n=2:
- 4 input combinations: (0,0), (0,1), (1,0), (1,1)
- 16 possible functions (2^4)
Walsh-Hadamard Transform
The Walsh-Hadamard transform is the boolean analog of the Fourier transform. It decomposes a boolean function into its spectral components:
c0 = average value
c1 = coefficient for input A
c2 = coefficient for input B
c12 = coefficient for interaction A×B
These coefficients reveal:
- Linearity — How “linear” the function is
- Balance — Whether the function is balanced (equal 0s and 1s)
- Correlation — Relationships between inputs
Shannon Entropy
Measures the information content of a boolean function:
H = -Σ p(x) log2 p(x)
Where p(x) is the probability of each output value.
- H = 0 → Constant function (no information)
- H = 1 → Balanced function (maximum information for n=2)
Architecture
The Boolean Solver uses a React-based architecture with:
- State Management — Truth table state in React hooks
- Real Math — Pure JavaScript implementations of mathematical operations
- Real-time Calculation — All solvers run on every state change
- Responsive Design — Works on desktop and mobile
- Visual Feedback — Clear, color-coded representations
Code Structure
BooleanSolver (Component)
├── State: tableIndex (current truth table)
├── Handlers: toggleCell (edit truth table)
├── Calculations:
│ ├── computeWalsh (Fourier coefficients)
│ ├── shannonSplit (information analysis)
│ └── synthesizeNand (circuit synthesis)
└── Render:
├── Truth table editor
├── Gate selector
├── Walsh coefficients
├── Shannon analysis
└── Circuit synthesis
Usage Examples
Example 1: Understanding XOR
- Click the cells for XOR pattern: (0,1)=1, (1,0)=1
- See it identified as “XOR (differ)”
- View Walsh coefficients showing non-linearity
- See NAND synthesis: XOR = NAND(NAND(x1,x2), NAND(x1,x1), NAND(x2,x2))
Example 2: Finding Equivalent Functions
- Click random cells to create a function
- Note the gate name
- Click “XOR” preset
- Compare Walsh coefficients — different functions can have similar spectral properties
Example 3: Circuit Design
- Select “AND” function
- See minimal NAND synthesis: AND = NAND(NAND(x1,x2), NAND(x1,x2))
- Depth: 2 (two levels of NAND gates)
Performance
- Real-time — All calculations happen instantly on state change
- Efficient — Uses memoization to avoid redundant calculations
- Scalable — Architecture extends to n=3, n=4, etc.
- No dependencies — Pure JavaScript/React, no external libraries needed
Educational Value
This tool demonstrates:
- Boolean Algebra — All 16 functions and their relationships
- Digital Logic — How gates combine to create circuits
- Information Theory — Shannon entropy and information content
- Fourier Analysis — Boolean analog of signal processing
- Universal Computation — NAND is universal (can implement any function)
- Algorithmic Thinking — Solvers that find optimal solutions
Source Code
The complete source is available from the conversation archive:
View in conversation archive (archive/source/boolean-solver.jsx)
Or download:
# Extract from conversation archive
unzip /opt/aurora/work/conversation-archive.zip archive/source/boolean-solver.jsx
# Or view other related files
unzip /opt/aurora/work/conversation-archive.zip archive/source/ultimate-solver.jsx
unzip /opt/aurora/work/conversation-archive.zip archive/docs/01-boolean-truth-tables.md
Related
- Physics Section — Theoretical foundations
- Thermodynamics of Computation — Ben’s work on energy and information
- Aurora Tools — AI tools that use these concepts
- LLM Infrastructure — Model management tools
Mathematics is the language of the universe. Code is how we make it speak.
Boolean Solver - Interactive Truth Table Explorer
Boolean Solver
Interactive Truth Table Explorer with Walsh-Hadamard Transform, Shannon Split, and NAND Circuit Synthesis
Explore all boolean functions interactively — complete for n=0,1,2,3, including the trivial cases. Click cells to build any truth table and watch three live solvers analyze your function in real-time.
Overview
The Boolean Solver is an interactive React + Three.js tool that transforms abstract boolean algebra into a tangible, visual experience. It enables you to explore all possible boolean functions for n=0 through n=3 inputs (1, 4, 16, and 256 functions respectively) through direct manipulation of truth tables.