Every formula you need for the CS1–CS8 mid-sem, on one page — each with its name, the equation, and a one-line "what each symbol means / when to use it." Learn the equation and the trigger. For the full derivation behind any line, open the slides explained.
Symbol key
| Symbol | Meaning |
|---|---|
| \(b,\; d,\; m\) | branching factor, depth of shallowest goal, max tree depth |
| \(g(n)\) | cost of the path from start to node \(n\) (so far) |
| \(h(n),\; h^*(n)\) | heuristic estimate to goal; true cost to goal |
| \(f(n)\) | evaluation function used to order the frontier |
| \(\tau,\; \eta\) | pheromone on an edge; visibility \(\eta = 1/\text{distance}\) |
| \(\alpha,\; \beta,\; \rho,\; Q\) | ACO: pheromone weight, visibility weight, evaporation, deposit constant (\(\alpha/\beta\) also = pruning bounds in CS8) |
| \(T,\; \Delta E\) | temperature; change in objective/energy (simulated annealing) |
Search & heuristics (CS2–CS4)
Maps a percept history \(P^*\) to an action \(A\). The whole job of an agent is to realise a good \(f\).
Order the frontier by cost-so-far + estimate-to-go. Greedy Best-First uses \(f = h\) only; UCS uses \(f = g\) only (i.e. \(h = 0\)).
Never overestimate the true cost. Guarantees A* (tree search) returns an optimal path.
For every successor \(n'\) reached by step cost \(c\). Consistent ⇒ admissible (not the reverse); needed for optimal A* graph search.
If A* expands \(N\) nodes to depth \(d\), \(b^*\) solves this. \(b^* \to 1\) means a sharp, informative heuristic.
Both come from relaxed problems (so both admissible). \(h_2 \geq h_1\) always ⇒ \(h_2\) dominates and expands no more nodes.
Search complexity (CS3)
| Algorithm | Time | Space | Optimal? |
|---|---|---|---|
| BFS | \(O(b^d)\) | \(O(b^d)\) | If equal step costs |
| DFS | \(O(b^m)\) | \(O(bm)\) | No |
| UCS | \(O\!\left(b^{1+\lfloor C^*/\varepsilon \rfloor}\right)\) | \(O\!\left(b^{1+\lfloor C^*/\varepsilon \rfloor}\right)\) | Yes |
| IDS | \(O(b^d)\) | \(O(bd)\) | Like BFS |
Local search & optimization (CS4–CS5)
When a neighbour is worse by \(\Delta E\), still accept it with this probability. High \(T\) (hot) → explore freely; \(T \to 0\) (cooled) → behaves like greedy hill climbing.
Probability of picking individual \(i\) as a parent is its share of total fitness. Fitter individuals breed more often (exploitation); mutation supplies exploration.
Maximise it; for 8 queens the goal is 28 pairs (the slide demo uses \(k=4\) with threshold 6). Drives the GA / hill-climbing search.
Ant Colony Optimization (CS5–CS6)
An ant at \(i\) picks next city \(j\) by balancing pheromone \(\tau\) (collective memory, weight \(\alpha\)) and visibility \(\eta = 1/\text{dist}\) (greedy "shorter is better", weight \(\beta\)); denominator normalises over unvisited cities.
Every edge first evaporates by fraction \(\rho\) (exploration); edges on a tour gain \(Q / \text{tour-cost}\) (shorter tour ⇒ bigger deposit ⇒ exploitation). Repeat to converge on short routes.
Game playing (CS7–CS8)
Back values up the tree: take the max at MAX nodes, the min at MIN nodes. MAX maximises its guaranteed (worst-case) outcome.
A fast weighted sum of board features estimating utility of a non-terminal state at the depth cutoff. Higher = better for MAX.
Stop expanding a node's remaining children once \(\beta \leq \alpha\) — they can't change the result. Same answer as minimax; best-case nodes \(\approx O(b^{d/2})\) with good move ordering (doubles reachable depth).
Pick the child maximising this: first term = exploitation (win rate \(w/n\)), second = exploration (grows when node \(n_i\) is under-visited vs parent visits \(N\)). \(c\) tunes the balance.
Neural building blocks (CS6)
Drops negative activations; cheap non-linearity used between conv/dense layers in the evolved CNNs.
Turns the output logits \(z\) into a probability distribution over classes (e.g. Cat = 0.92, Dog = 0.08). Largest logit wins.