---
# System prepended metadata

title: Demystifying My Math Teacher’s Brain

---

# Demystifying My Math Teacher's Brain

Since it's my last year in high school, I've been going through a rough patch with exams, projects, and everything else. I remember back in 11th grade (ثاني ثانوي), I had a math teacher whom I honestly didn't like. His exams, especially the finals, always seemed to follow a pattern. Over the last two days, I've been working on a theory that could help new students score 100s when studying for this particular teacher.

Before going into whats this blog about, let's talk about the theory behind multiple-choice exams especially those with options from **A** to **D**. Most standardized exams use a system that seems random on the surface, but in reality patterns often emerges especially when the same teacher creates multiple tests over time. Human brain 101 

The basic principle is simple -> **each question has four options** giving a *25%* chance of guessing correctly if answers are truly random. altho in practice human-made exams are rarely perfectly random.

Teachers subconsciously distribute answers to balance difficulty - avoid obvious repetition or follow "mental patterns" they find logical. This creates predictable biases that can be exploited (:

in my analysis of this math teachers past exams
- Certain positions (like Q1, Q2, Q3 to 10) often had the same answer across multiple exams.
- Some sequences (like A → A → B → B or A → A → B → C) repeated more than 50% of the time.
- Teachers rarely place the same answer three times in a row unless its intentional rabbit hole.

By cataloging historical exams we can estimate probabilities for each option per question. In my case, after analyzing 30 *full mark* exams i could assign confidence percentages like this

| Question | A   | B   | C  | D  |
| -------- | --- | --- | -- | -- |
| 1        | 90% | 3%  | 3% | 3% |
| 2        | 5%  | 85% | 5% | 5% |
| …        | …   | …   | …  | …  |

These percentages are essentially a teacher specific pseudo-random number generator (PRNG) in practice. 

The teachers think they're randomizing answers, but human bias introduces predictable probability distributions. 

By combining these probabilities with known anchor points (questions you're confident about), you can significantly increase your chance of selecting the correct answers. From just 25% (;


## Table of Contents
- [Historical Exams Analysis](#Historical-Exams-analysis)
- [Assigning Probabilities](#Assigning-Probabilities)
- [Practical Implementation](#Practical)


## Historical Exams Analysis
before going into the nitty-gritty let me explain how I actually got my hands on all this data. 

I managed to collect 30 past exams from this teacher (plus a few fresh samples). Most are just slightly mutated of modified versions of his final exams. Some were old exams my friends had kept and the fresh ones I was able to get this past Sunday.

plus a calculator iykyk (:

With this collection, I could start looking for patterns: which answers repeated, which sequences showed up more often than others, and where the “tricky rabbit holes” usually appeared.

Then, I stored them in a small database I built with Python's sqlite3 each exam was just a list of answers like `["A", "B", "C", "D", ...]` i even kept track of where each exam came from original or mutated or newly collected so i could compare patterns later.

Next i wrote a small code to analyze trends in the exams. then i checked which answers repeated which sequences showing up more often than others and where the tricky `rabbit holes` appeared for example:

- How often does "A → B → C" appear across all exams?

Are there patterns where the same answer shows up twice in a row or never three times in a row?

I also built mutations and shifts into the system that means I could take an original exam and randomly tweak some answers or rotate the sequence slightly. 

This helped me create extra examples to see if patterns still held even if the teacher mixed things up a little.

Then comes the fancy part -> i fed all this into a ML model (eLSTMs) that learned the teacher's style. 

Basically it looks at previous answers and predicts the probability of each option for the next question. The model also handles anchors which are questions you already know the answer to boosting confidence in predictions.

Finally all of this was tied together with probabilities, confidence tables, and trend analysis. so i could see not just the predicted answers but how likely each answer was to appear based on the teacher's subtle patterns.

![image](https://hackmd.io/_uploads/S1rgxsHcge.png)

Not only does this work for my teacher but it also works on randomly generated questions i even asked ChatGPT to create a fresh set of 10 questions with their correct answers supplied 3 anchors to my module and it scored a perfect 10/10 as shown in the picture lol

and tested it today with my friends in school i simply told them to do exactly the same just write correct answers of 10 hypothetical questions 

and the result shocked me and them (: 

excuse the boys handwriting and mine too i hope its understandable atleast 

lets start with the sequence which my friend naif gave me

![image](https://hackmd.io/_uploads/HyI2zjrqgg.png)

i took only the first 3 correct answers and supplied them to my module and it scored 10 on this one. ACED IT

next we have faisal's seq

![image](https://hackmd.io/_uploads/SkDZXsB9gl.png)

yup i only took the first 3 anchors and my module scored 10 on this exam.

third we have... i forgot who exactly but this time his seq was unique and new didnt add that to my db thats why my module scored 7/10

![idk why but it says corr image when i upload][]

and 4th still 7/10 because it was a fresh one anyway it just shows how 3 answers are enough to score 6+ in every exam.

## Assigning Probabilities

Instead of blindly guessing A - B - C or D i could look at the data and say, “Based on past exams the teacher usually picks this answer here that answer there.” The percentages arent random they come directly from observing the patterns in the db.

For each question i counted how many times each option appeared across all past exams then I converted these counts into probabilities this gives a sense of which answers are more likely and which are rarely chosen.

i also adjusted these probabilities based on common sequences and known anchors. 

For example if certain answer patterns repeated frequently in the past I could tweak the probabilities of surrounding questions to reflect those tendencies.

**Using these probabilities alongside the anchors and observed trends it becomes possible to make highly informed guesses turning what would normally be a 25% shot in the dark into a calculated choice with much higher confidence - 70% success rate sometimes less but more than 25 anyway (:**

## Practical Implementation

ok so theory is cool and all but i didnt just want to stare at numbers and tables. i needed something that actually works in real life. 

the goal was simple -> give the system a few answers im confident about my anchors and let it predict the rest.

First, I dumped all the historical exams into a “knowledge base” like i said earlier - including mutated and slightly shifted versions. Why? Because the more variations it sees, the better it can handle new questions that arent exactly like the old ones. 

Basically it learns the teachers brain not just memorizes old exams.

best part? It keeps learning. every new exam I feed into it updates the probabilities and improves the predictions and adapts to slight changes. 
So even if the teacher throws in a few curveballs the system still has a really good shot at scoring high.

all that linked to my discord bot 

![image](https://hackmd.io/_uploads/rywN8jHcge.png)


## i spent 15 minutes writing this blog so content-quality is...