The whole Artificial Intelligence formula sheet, to print
46 formulas in 3 topics, each with when to use it. Each is explained in the topic notes.
IAE Academy: Artificial Intelligence formula sheet (GATE DA)
Search: uninformed, informed and adversarial
Read the notesNODES GENERATED BY ITERATIVE DEEPENING (WORST CASE)
Uniform tree with branching factor , goal at depth , the last iteration generating every node to depth , root counted in every iteration. Nodes at depth are generated times.
BOUND ON THE ITERATIVE-DEEPENING OVERHEAD
From the sum above with : . For the factor is 4; for it is about 1.23.
A* EVALUATION FUNCTION
A* always expands the frontier node with the smallest . Greedy best-first search uses alone; uniform-cost search is A* with .
ADMISSIBLE HEURISTIC
Never overestimates the true remaining cost. Enough for A* to be optimal in tree search, and in graph search when cheaper paths re-open expanded nodes.
CONSISTENT (MONOTONE) HEURISTIC
A triangle inequality on estimates. Every consistent heuristic is admissible; the converse is false. Along any path never decreases when is consistent.
MINIMAX VALUE
Two-player zero-sum game, perfect information, finite tree. The value is computed bottom-up.
MINIMAX COMPLEXITY
is the maximum depth of the game tree. Minimax is complete on a finite tree and optimal against an optimal opponent.
ALPHA-BETA CUT-OFF RULE
Updates: at a MAX node ; at a MIN node , where is the best child value so far. Pruning when is safe because it cannot change the root value. Some sources prune only when ; that can change the number of pruned leaves but never the root value. These notes use .
ALPHA-BETA TIME COMPLEXITY
With perfect ordering alpha-beta can look about twice as deep as minimax in the same time; with random ordering the cost is roughly . The root value is the same for every ordering; only the number of pruned leaves changes.
LEAVES EVALUATED WITH PERFECT ORDERING
Uniform game tree with branching factor , all leaves at depth , distinct leaf values, children ordered best-first for the player to move. Example: , gives leaves (all three under the first MIN child, then one under each other child).
Propositional and predicate logic
Read the notesIMPLICATION ELIMINATION
The usual first step (after rewriting ) when converting to CNF or DNF.
BICONDITIONAL
True exactly when p and q have the same truth value.
CONTRAPOSITIVE
The converse and the inverse are NOT equivalent to (they are equivalent to each other).
DE MORGAN'S LAWS
Double negation: .
NEGATING AN IMPLICATION AND A BICONDITIONAL
is the exclusive or : true exactly when and differ. The negation of an implication is a conjunction, never another implication.
DISTRIBUTIVE LAWS
Each of and distributes over the other; used to reach CNF and DNF.
EXPORTATION
Moves a conjunction in the premise into a chain of implications.
IMPLICATIONS WITH A COMPOUND PART
Check any of these by rewriting both sides with . Note the second line: a conjunctive premise splits into an OR, not an AND.
ENTAILMENT AS VALIDITY
means every assignment making true also makes true. With several premises: exactly when is a tautology.
REFUTATION TEST FOR ENTAILMENT
The basis of proof by contradiction and of resolution refutation.
NORMAL FORMS FROM A TRUTH TABLE
A minterm is true exactly on its row; a maxterm is false exactly on its row. In the maxterm, a variable that is T in the row appears negated and one that is F appears plain (for the row the maxterm is ). A formula with no T rows has an empty DNF (a contradiction); one with no F rows has an empty CNF (a tautology).
RESOLUTION RULE
Applies to two clauses holding a complementary pair of literals. The resolvent is entailed by its two parents (soundness). Resolution refutation is also complete for propositional logic: if a clause set is unsatisfiable, the empty clause can be derived from it.
NEGATING QUANTIFIERS
Negation flips the quantifier and moves inside; apply De Morgan's laws to what remains.
DISTRIBUTION OF QUANTIFIERS
When both P and Q contain x free, only these two distribute as equivalences.
MOVING A QUANTIFIER PAST Q (X NOT FREE IN Q)
Valid when does not occur free in and the domain is non-empty.
MOVING A QUANTIFIER OUT OF AN IMPLICATION (X NOT FREE IN Q)
Valid when does not occur free in and the domain is non-empty. A quantifier moved out of the conclusion stays the same; one moved out of the premise FLIPS ( becomes and vice versa), because the premise sits under a hidden negation: .
ONE-WAY IMPLICATIONS
The converse of each is NOT valid.
MORE ONE-WAY ENTAILMENTS
The first needs the non-empty domain. None of the converses is valid: for example, with domain , true, false and false, is true but is false.
QUANTIFIER ORDER
Like quantifiers commute: and .
FIRST-ORDER RESOLUTION RULE
Clauses must share no variable names (standardise apart); the empty clause again signals unsatisfiability of the clause set. Resolution together with factoring (unifying two literals inside one clause) is refutation-complete for first-order logic: an unsatisfiable clause set always yields the empty clause. If the set is satisfiable the search may never stop, since first-order entailment is only semi-decidable.
Reasoning under uncertainty: conditional independence, variable elimination and sampling
Read the notesPRODUCT RULE
Each conditional is defined only when the event it conditions on has positive probability ( for ).
MARGINALISATION (SUM RULE)
Sum over every value of each variable being removed.
BAYES' RULE
Requires . Turns a likelihood into a posterior ; the denominator comes from marginalisation.
CONDITIONING BY NORMALISATION
Requires . Compute the unnormalised values for each , then divide by their sum. is just .
CHAIN RULE OF PROBABILITY
Holds for any distribution and any variable ordering (wherever the conditionals are defined); it is the starting point for the Bayesian-network factorisation.
INDEPENDENCE
Must hold for every pair of values of and ; the last form is for values with .
CONDITIONAL INDEPENDENCE
Must hold for every value of , and with (and for the last form).
FACTORISATION OF THE JOINT IN A BAYESIAN NETWORK
For any choice of CPTs this product is a valid joint distribution, and a joint factorises this way exactly when it satisfies the local Markov property for the DAG. Any joint entry is the product of one CPT entry per node.
NUMBER OF INDEPENDENT CPT PARAMETERS
For all-binary variables this is , compared with for the full joint.
MARKOV BLANKET
Parents, children and the children's other parents (co-parents). Given its Markov blanket, is conditionally independent of every other variable in the network.
INFERENCE BY ENUMERATION
Sum the network's joint over all hidden-variable assignments with evidence fixed, then normalise (). Cost is exponential in the number of hidden variables.
ELIMINATING ONE VARIABLE
Multiply only the factors that mention , then sum out; factors not mentioning are left untouched and can be pulled outside the sum.
PRIOR (FORWARD) SAMPLING
Each sample is drawn from the full joint, ignoring evidence; counts matching samples out of .
REJECTION SAMPLING
Generate prior samples, discard any that disagree with the evidence, and use the counts among the kept ones (undefined if ). The fraction kept is about , so rare evidence wastes almost all samples.
LIKELIHOOD WEIGHTING
Evidence variables are fixed, not sampled; each sample is weighted by the probability of the evidence given its parents' values in that same sample (a parent may itself be an evidence variable, fixed at its observed value). Non-evidence variables are sampled as usual, so no sample is rejected. The method is consistent because the probability of drawing the non-evidence values times the weight equals .
GIBBS SAMPLING: RESAMPLING ONE VARIABLE
All other variables are held at their current values; normalises over the values . Only the CPTs of and of its children are needed, because is independent of everything else given its Markov blanket.