AI & ML Algorithm Calculator with Step-by-Step Math

Learn the theory, plug in your data, and watch the full manual calculation exactly how your exam expects it.
Built by a student, for students.

Show full manual working
Verify exam answers instantly
Covers 10+ core CS syllabi
Adversarial Search

Alpha-Beta Pruning

Alpha-Beta Pruning speeds up Minimax by skipping irrelevant branches, finding the exact same optimal move much faster.

Adversarial Search

Minimax Algorithm

Minimax finds the optimal move in a two-player game by assuming both players always play perfectly.

Pathfinding Search

A* Search Algorithm

A* finds the shortest path by combining actual travel cost with a heuristic estimate of remaining distance.

Uninformed Search

Uniform Cost Search (Dijkstra's Algorithm)

Uniform Cost Search guarantees the shortest path by always expanding the cheapest accumulated route first.

Pathfinding Search

Greedy Best-First Search

Greedy Best-First Search races toward the goal using only a heuristic estimate, completely ignoring actual path cost. Fast but not optimal.

Machine Learning

Evaluation Metrics (Confusion Matrix)

A confusion matrix reveals exactly how a classifier fails, breaking down true positives, false positives, and false negatives precisely.

Distance-Based

K-Nearest Neighbors (KNN)

KNN classifies new data points by finding the K nearest examples and taking a majority vote among them.

Tree-Based

Decision Tree (ID3)

Interrogate the data to find its most important features, then recursively carve out a human-readable flowchart of rules and predictions.

Tree-Based

Random Forest Classifier

Cure single-tree overfitting by training an army of randomized trees, then use majority voting to cancel out noise and stabilize predictions.

Clustering

K-Means Clustering

An unsupervised algorithm that groups unlabeled data into KK distinct clusters by iteratively updating each centroid's position.

Probabilistic

Naive Bayes Classifier

Classify data using Bayes' Theorem by assuming every feature independently contributes to the outcome — a powerful, beautifully naive shortcut.

Association Rules

Apriori Algorithm

Apriori scans transactional data to discover hidden patterns and frequently purchased item combinations, revealing buying habits.

Evolutionary

Genetic Algorithm (One-Max)

Evolve a population of candidate solutions through selection, crossover, and mutation, gradually breeding them toward the perfect target string.

Evolutionary

Genetic Algorithm (Knapsack)

Evolve item combinations through selection, crossover, and mutation to find the most profitable mix without exceeding a strict weight limit.

Regression

K-Nearest Neighbors (KNN) Regression

KNN Regression predicts numerical values by finding the K nearest data points and averaging their target values.

Regression

Linear Regression

Linear Regression predicts continuous numerical values by fitting a straight line that best summarizes the relationship between variables.

Regression

Multiple Linear Regression

Upgrade from one input to many. Fit a multi-dimensional hyperplane and isolate every variable's exact impact on your prediction.

Uninformed Search

Breadth-First Search (BFS)

Breadth-First Search explores a graph level by level, guaranteeing the shortest path when all edges cost the same.

Uninformed Search

Depth-First Search (DFS)

DFS dives down one path completely before backtracking, making it memory-efficient but unable to guarantee the shortest path.