The Math behind Netflix
- Samvar Shah

- 20 hours ago
- 2 min read

You finish watching War Machine on Netflix, and within seconds the platform suggests another aliens/ war movie that somehow matches your taste perfectly. How?
Behind those recommendations is mathematics (as always:-)
Patterns:
Netflix does not actually “understand” movies the way we do.
Instead, it looks for patterns in user behavior:
what you watch
what you skip
what similar users enjoy
Over time, this creates a huge network connecting users and movies.
If two people consistently watch similar content, Netflix assumes they may enjoy similar recommendations in the future. This idea is called collaborative filtering.
Vectors:
One common approach is to represent users mathematically as vectors.
For example:
Movie | User A | User B |
Dark | 1 | 1 |
Interstellar | 1 | 1 |
Black Mirror | 1 | 1 |
Arrival | 1 | 0 |
Since both users enjoyed similar titles, Netflix may recommend Arrival to User B.
To measure similarity between users, systems often use cosine similarity:
cos(θ)=A⋅B/∥A∥∥B∥
The closer the vectors are, the more similar the users’ preferences.
Data:
Not just users, Netflix also compares movies with each other.
Over time, the system learns that certain films attract similar audiences, even across different genres.
Linear Algebra:
A large part of recommendation systems relies on matrices and linear algebra.
You can imagine Netflix as a giant table:
rows represent users
columns represent movies
missing values represent things users have not watched yet
The goal is to predict those missing values.
Modern recommendation systems use machine learning techniques like matrix factorization to uncover hidden patterns in user preferences.
The real goal isn't accuracy though. This is the surprising part.
Netflix is not only trying to predict what you like.
It is trying to predict what you will actually watch.
Those are different things.
You might rate a slow historical drama highly…but still choose an easy comedy after a long day.
So recommendation systems optimize for engagement which turns recommendations into an optimization problem.
The platform is constantly balancing:
familiarity vs novelty
short-term engagement vs long-term satisfaction
popular content vs personalized content
That balance is incredibly mathematical.
Recommendation systems are one of the best examples of math being used in everyday life where every click, watch, and rating becomes part of a larger pattern.



Comments