LogicLab
All shelves

Math & Algorithmic Logic — 8 tools

Where classical logic meets computer science: Boolean algebra on a 2D map, recursive calls you can watch grow, and a small Bayesian sandbox where you can poke evidence into the side of a graph and watch the posteriors shift.

  1. 1. Boolean Visualiser
  2. 2. Set Theory Venn Builder
  3. 3. Recursive Call-Stack
  4. 4. Complexity Estimator
  5. 5. Cellular Automaton
  6. 6. Bayesian Network
  7. 7. Game Theory Tournament
  8. 8. Sudoku Logical Hint
#17 Math & Algo

Boolean Expression Visualiser

3-variable Boolean function plotted on a 2D Karnaugh-style map. Each cell is a minterm; highlighted cells are the on-set.

Sum of products

Cells are placed on a 4×2 grid: rows for AB, columns for C. Order is Gray-code adjacent so neighbouring cells differ by exactly one variable.

#18 Math & Algo

Set Theory Venn Builder

Drop 10 numbers into sets A, B, C — drag chip between bins to define A∪B∪C, A∩C, A−B etc. We label every region.

Set A

Set B

Set C

Add chip:

Region labels

    #19 Math & Algo

    Recursive Call-Stack Visualiser

    Pick fib / factorial / hanoi. Watch frames push and pop. Tracked depth shows when a recursion is at risk of stack-overflow.

    Hanoi "moves" called recursively to count: M(n) = 2·M(n−1) + 1. Watch the depth grow exponentially — that's the lesson.

    #20 Math & Algo

    Algorithmic Complexity Estimator

    Paste a short snippet of code-like logic. Heuristic scorer returns a likely Big-O with a one-line justification.

    Heuristic patterns we recognise

    • One for → O(n)
    • Two nested loops → O(n²)
    • Inner loop halves n//=2 → O(log n)
    • Recursion with one branch / sub-n size → O(2ⁿ) or O(n log n)
    • Hash/dict/Set → O(1) avg
    #21 Math & Algo

    Cellular Automaton Explorer

    Wolfram's 1D rules (0–255) and Conway's Game of Life. Seed cells, watch evolution, capture the rule number from observed transitions.

    Rule 30 is a classic: chaotic, used in random-number generation. Rule 110 is Turing-complete.

    #22 Math & Algo

    Bayesian Belief-Network Sandbox

    A small pre-built network: Rain → Sprinkler → Wet Grass, with priors. Set evidence and see posterior updates via enumeration.

    Evidence (set truth or unknown)

    VariableP(true)Known?Value
    Rain0.20
    Sprinkler0.50
    Wet Grass?

    Joint enumeration

    We enumerate 2³ = 8 joint assignments, weight by the conditional probability table, condition on your evidence, and renormalise.

    #23 Math & Algo

    Game Theory Tournament

    Iterated Prisoner's Dilemma. Six strategies (TitForTat, Grim, Always Cooperate, Always Defect, Pavlov, Random) play a round-robin. Heatmap of total scores.

    Why TitForTat wins (mostly)

    Axelrod's tournament famously favoured strategies that were nice (start cooperating), retaliatory (defect when other defects), forgiving (return to cooperation quickly) and clear (predictable). Our implementation uses the standard payoffs (R=3, S=0, T=5, P=1) and shows the champion per scenario.

    Noise toggles are in our to-do list; today, simulations are noiseless.

    #24 Math & Algo

    Sudoku Logical Hint

    Fill a grid (or load a sample). The hint engine applies only logical techniques: naked single, hidden single, naked pair, box/line reduction. Each step is justified.

    If a puzzle is unsolvable by these techniques alone, the solver will stop and tell you. The full backtracking solver is in the dev console for the curious.

    Advertisement Ad slot below the shelf. Served by AdSense if approved.