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

Truth table generator and logic calculator

A free truth table generator and logic calculator. Type a Boolean or propositional-logic expression and get its complete truth table, a column for every sub-expression, canonical and minimal DNF and CNF, and LaTeX you can paste into a paper. Everything runs in your browser.

Interactive: Boolean-expression parser and truth-table generatorUpdated

Truth table generator

Variables are names like A, p or x1. Operators: not ! ~ ¬ (or a postfix '),and & * ∧, or | + ∨, xor ^ ⊕,-> →, <-> ↔, nand, nor, constants 0 1. Up to 8 variables.

Check whether two expressions are equivalent

What this logic calculator does

Beyond printing the table, the generator answers the questions a truth table is usually built for:

  • Is it a tautology, a contradiction or a contingency? The badge above the table says whether the formula is true in every row, false in every row, or neither. A formula is satisfiable when at least one row is 1.
  • Are two formulas logically equivalent? The equivalence checker under the table compares them on every assignment and gives a counterexample when they differ.
  • What is the simplest equivalent formula? The minimal DNF and CNF are the shortest sum-of-products and product-of-sums forms. For the algebra behind a simplification, step by step, use the Boolean algebra calculator; to see the groups on a Karnaugh map, use the K-map solver.
  • Is an argument valid? Write the premises joined with and, then -> and the conclusion. The argument is valid exactly when that implication is a tautology, as in the worked example below.

How to write expressions

Variables are names that start with a letter: A, p, rain, x1. Several spellings are accepted for each operator, so you can paste formulas from most textbooks and programming languages.

OperatorType any ofBinds
notnot A, !A, ~A, ¬A, A'tightest
and, nandand, &, &&, *, ·, ∧; nand, ↑
xorxor, ^, ⊕
or, noror, |, ||, +, ∨; nor, ↓
implies->, =>, →, impliesgroups to the right
if and only if<->, <=>, ==, ↔, iffloosest
constants0, 1, true, false, ⊤, ⊥

So A or B and not C means A∨(B∧¬C)A \lor (B \land \lnot C), and A -> B -> C means A→(B→C)A \to (B \to C), the usual convention in logic. When in doubt, add parentheses; the generator prints back the expression it understood, with only the parentheses that are needed.

What the output means

  • Rows are listed in binary counting order, the first variable being the most significant bit, so row ii is the assignment whose bits spell ii. Tick “Start with 1s” for textbooks that put T first.
  • Sub-expression columns show each intermediate result, innermost first, so you can check a hand-written table column by column. The last column is the whole expression.
  • Canonical DNF is the OR of one minterm per row where the expression is 1, written Σm(… )\Sigma m(\dots) with the row numbers. Canonical CNF is the AND of one maxterm per row where it is 0, written ΠM(… )\Pi M(\dots).
  • Minimal DNF and CNF use as few terms as possible, then as few literals as possible. They are computed with the Quine–McCluskey method and an exact search over prime implicants.

Worked example: (A→B)∧(B→C)→(A→C)(A \to B) \land (B \to C) \to (A \to C)

This is the rule that implication chains: if A implies B and B implies C, then A implies C. It has 3 variables and 8 rows. The final column is 1 in every row, so it is a tautology: valid whatever A, B and C are. Its canonical DNF lists all eight minterms, its canonical CNF is empty (written 1), and both minimal forms are simply 1.

Using the LaTeX output

The table output is a plain tabular with a vertical rule between the variables and the computed columns, using only standard LaTeX, so it compiles in any document class. Formulas use \land, \lor, \lnot, \oplus, \rightarrow and \leftrightarrow. If your venue prefers \wedge and \vee, they are the same symbols. For a typeset table with nicer rules, load booktabs and replace \hline with \midrule; see the LaTeX templates guide.

Checking equivalence

Two expressions are equivalent when they agree on every assignment. Open “Check whether two expressions are equivalent” under the table to compare two formulas. When they differ, you get a specific counterexample, which is usually the fastest way to find a mistake in a simplification.

Limits The table is limited to 8 variables (256 rows) so that it stays readable, and the equivalence check to 12 variables. Beyond that, exhaustive tables are the wrong tool: a SAT solver can decide satisfiability and equivalence of much larger formulas.

Learn the background

The Boolean algebra explainer covers the laws, normal forms and functional completeness behind this tool, with worked examples.