Everything on the site.

Big-O notationAlgorithms · Count the steps in real loops, then compare n, n log n, n² and 2ⁿ on a live chart.RecursionAlgorithms · Watch frames push and pop on the call stack for factorial and Fibonacci.BFS vs DFSAlgorithms · A queue against a stack: draw a graph and see which order each search visits it in.Sorting algorithmsAlgorithms · Seven sorts on the same input, with comparison, swap and write counts side by side.Binary searchAlgorithms · Halve the range, probe the middle, repeat: with lo, mid and hi drawn on the array.Sets, relations and functionsDiscrete maths · Shade any set expression on a Venn diagram and test a relation for its properties.Proof by inductionDiscrete maths · Four worked proofs revealed one step at a time, and a broken one to diagnose.CombinatoricsDiscrete maths · An exact nPr and nCr calculator, and a Pascal’s triangle that shows its own addition rule.Boolean algebraDiscrete maths · The laws, De Morgan, and normal forms, with a truth-table generator built in.Finite-state machinesTheory · Build a DFA in a table, see it drawn, and run strings through it one symbol at a time.Domain theoryTheory · Why recursion needs least fixed points, and how CPOs, Scott continuity and powerdomains supply them.Truth table generatorTools · Expression in, truth table out: with DNF, CNF, a minimal form and LaTeX.Graph traversal visualiserTools · Draw a graph, then animate BFS, DFS and Dijkstra with the frontier shown.Recursion tree visualiserTools · Paste a recursive function or a recurrence and see its call tree and call count.Gradient descentML maths · Drag the starting point, set the learning rate, and watch it converge or blow up.Vectors and embeddingsML maths · Bend the plane with a 2×2 matrix and measure how close toy word vectors are.Softmax and cross-entropyML maths · Edit the logits and watch the probabilities, the loss and the gradient update live.Attention mechanismML maths · Q, K and V for three tokens, a live score heatmap, and the weighted sum of values.Formatting a CS paper in LaTeXLaTeX · Page limits, \documentclass, front matter, theorem environments and the bibliography.Camera-ready checklistLaTeX · Fonts embedded, PDF/A, copyright form, source bundle, and why final versions get rejected.LaTeX templatesLaTeX · Where the official classes live, plus a minimal article template you can copy.Boolean algebra calculatorTools · A Boolean expression simplifier that names the law used at every step.K-map solverTools · Fill in a Karnaugh map and see the groups, the minimal SOP and POS, and the essential terms.Logic gate simulatorTools · Wire up gates, flip the switches, and get the truth table and expression of your circuit.Regex to NFA converterTools · Type a regular expression and watch Thompson’s construction build its NFA, fragment by fragment.NFA to DFA converterTools · Enter an NFA or a regex and step through the subset construction, then minimise the DFA.DFA simulatorTools · Edit a DFA, run strings through it step by step, batch-test them and share the machine as a link.Regular expressions to automataTheory · Regex to NFA to DFA to minimal DFA, worked through on one example with every set shown.The halting problemTheory · Why no program can tell whether every program halts, with the paradox program played out.Pigeonhole principleDiscrete maths · n pigeons, k holes: why some hole gets ⌈n/k⌉, and the surprising things that follows from it.Dijkstra’s algorithmAlgorithms · Shortest paths with a priority queue: a worked table, a proof, and a graph you can redraw.Hash functionsAlgorithms · Keys in, buckets out: hash a word four ways, then watch chaining and probing handle collisions.Sorting algorithm visualizerTools · Up to seven sorts race on the same data, then step through any one of them line by line.LaTeX table generatorTools · Type or paste a table, merge cells, pick booktabs, and copy clean tabular code.Combination calculatorTools · Exact nCr with the cancelling shown, combinations with repetition, and a full list for small n.Permutation calculatorTools · nPr, nʳ, anagrams like MISSISSIPPI and round-table seatings, with exact working.AlgorithmsSection · Step-through visualisations of sorting, searching, recursion, graph traversal, Dijkstra’s algorithm, hash functions and Big-O growth, with pseudocode that follows along.Discrete mathsSection · Sets, relations and functions, proof by induction, counting, the pigeonhole principle and Boolean algebra, explained with worked examples and interactive checkers.TheorySection · Finite-state machines, regular expressions and automata, the halting problem, and the mathematical semantics of programming languages, explained from first principles.ML mathsSection · Gradient descent, vectors and embeddings, softmax and cross-entropy, and attention, each with a formula, a worked numeric example and a live version.ToolsSection · Free browser tools: truth tables, Boolean simplification, K-maps, logic gates, nCr and nPr, regex to NFA to DFA, sorting and graph visualisers, and LaTeX tables.LaTeXSection · How to format a CS conference or workshop paper in LaTeX, a camera-ready checklist, and a minimal template you can adapt.
Free tool

DFA simulator: build a finite automaton and test strings

Build a deterministic finite automaton (DFA) and run strings through it. Edit the transition table, drag the states to tidy the diagram, step through a run one symbol at a time, and test a whole list of strings at once. When the machine is right, copy a link that opens it exactly as it is.

Interactive: DFA editor, step-by-step simulator and batch testerUpdated

DFA simulatorEdit the transition table, drag states to tidy the diagram, then run a string through it.

single characters, separated by commas

Pseudocode

  1. q ← start state
  2. for each symbol c of the input, left to right:
  3. if δ(q, c) is undefined: reject (fall into the dead state)
  4. q ← δ(q, c)
  5. accept if q is an accepting state, otherwise reject

Result

Run a string to see the verdict.

Checks

    Shortest accepted strings

    Test many strings

    How to use the simulator

    1. Start from a preset or from the default machine. The presets cover parity, divisibility, suffixes, substrings and a partial DFA.
    2. Set the alphabet: one to four single characters, separated by commas.
    3. Edit the table. Each row is a state. Pick the start state with the radio button, tick accepting states, rename states, and choose where each symbol leads. Leave a cell as “— (dead)” to send that move to an implicit dead state.
    4. Run a string. Type it and press Run, then use the controls (or the arrow keys and Space) to step forwards and backwards. The tape shows the symbol being read and the diagram highlights the transition taken.
    5. Batch-test by typing strings into the “Test many strings” box, one per line. An empty line tests the empty string ε.
    6. Share with “Copy share link”. The link holds the whole machine, including state positions, so nothing is stored on a server.

    What the checks tell you

    As you edit, the simulator checks the machine and lists:

    • Missing transitions. A DFA is strictly a total function δ:Q×Σ→Q\delta : Q \times \Sigma \to Q. Many textbooks allow a partial table and treat each missing move as going to a dead state, and so does the simulator. Fill in every cell if your course requires a complete DFA.
    • Unreachable states, which no input can reach from the start. They never affect the language and can be deleted.
    • Whether the DFA is minimal. The simulator runs Moore’s partition refinement in the background and tells you how many states an equivalent minimal DFA needs. If yours has more, two of its states are indistinguishable.
    • The shortest accepted strings, in length-then-alphabetical order. This is the quickest sanity check of a design: if ε appears and shouldn’t, the start state should not be accepting.

    Worked example: binary multiples of 3

    Choose the “Binary multiple of 3” preset. Each state stores the value read so far modulo 3, and reading bit bb in state rr moves to (2r+b) mod 3(2r + b) \bmod 3. On input 1001 (nine) the run visits r0 → r1 → r2 → r1 → r0 and ends in r0, so it accepts. The shortest accepted strings are ε, 0, 00, 11, 000, 011: every one is a multiple of 3 in binary (with leading zeros allowed), and ε counts as zero because the start state is accepting.

    Designing a DFA that passes the tests

    The key question is what does the machine need to remember? Each state should stand for one answer to that question. For “ends in ab” the answers are “nothing useful”, “just read a” and “just read ab”, so three states. A good habit is to write the meaning of each state as its name, as the presets do, and then check every transition against that meaning: “if I have just read a and now read b, I have just read ab”.

    Then test systematically. Include the empty string, the shortest strings that should be accepted, strings that are almost right (one symbol off), and a long string. The batch tester shows a tick or a cross for each, so a list of a dozen test strings catches most mistakes in seconds.

    DFA or NFA? This simulator is for deterministic machines: one next state per state and symbol. If your design needs several possible next states or ε-moves, it is an NFA. Build it in the NFA to DFA converter, which turns it into a DFA you can open here with one click. To start from a regular expression instead, use the regex to NFA converter.

    Formal definition

    A DFA is a 5-tuple (Q,Σ,δ,q0,F)(Q, \Sigma, \delta, q_0, F): a finite set of states, an alphabet, a transition function, a start state and a set of accepting states. It accepts a string w=w1w2⋯wnw = w_1 w_2 \cdots w_n when the run q0,δ(q0,w1),δ(δ(q0,w1),w2),…q_0, \delta(q_0, w_1), \delta(\delta(q_0, w_1), w_2), \dots ends in FF. The finite-state machines explainer covers this in detail, along with regular languages and what DFAs cannot do.

    References

    1. M. Sipser, Introduction to the Theory of Computation, 3rd ed., Cengage, 2012. Section 1.1.
    2. J. E. Hopcroft, R. Motwani and J. D. Ullman, Introduction to Automata Theory, Languages, and Computation, 3rd ed., Pearson, 2006. Chapter 2.