The Maths Behind Logistic Regression

I got it wrong 🙁

What are Your Odds?

Let’s have a look at this god-tier math puzzle. Only one out of seven gets it right, and the other six don’t. So, what are the odds for solving it correctly? 1 to 6. Generally, if \(p\) is the probability that someone will get it right, then his/her odds are \(p/(1-p)\).

However, it isn’t necessarily true that \(p=1/7\) for every person because some people are smarter, some have better education and so on. Hence, \(p\) also depends on the person attempting the puzzle. In a Bayesian framework, we capture this dependence with conditional probability.

Continue reading The Maths Behind Logistic Regression

Want to Fight Climate Change? Don’t Waste Food

source: http://res.publicdomainfiles.com/pdf_view/152/13985772022293.jpg

A few days ago, my roommate and I were getting dinner at an Japanese restaurant. While we waited for food, we were having a brief discussion about the recent heat waves in Europe. Both of us felt very sad about these changes. Continue reading Want to Fight Climate Change? Don’t Waste Food

A Week of Poetry: Day 3

Sonnet 130

By William Shakespeare

My mistress’ eyes are nothing like the sun;
Coral is far more red than her lips’ red;
If snow be white, why then her breasts are dun;
If hairs be wires, black wires grow on her head.
I have seen roses damask’d, red and white,
But no such roses see I in her cheeks; Continue reading A Week of Poetry: Day 3

An Online Algorithm to Check for Bipartite Graphs

Bipartite Graphs

A graph \(G(V, E)\) is called bipartite if its vertices can be divided into two groups \(X\) and \(Y\) such that every edge connects one vertex from \(X\) and one vertex from \(Y\). The graph drawn below is bipartite.

Given a graph, can you determine if it is bipartite? Continue reading An Online Algorithm to Check for Bipartite Graphs

How Game of Thrones Should Have Ended

This is a very unusual post for this blog. I hope my regular readers will bear with me.

I love Game of Thrones. I have read the books and the companion novels. I have been following the series for years. I am familiar with most of the fan theories too. Tonight the series finale aired. I didn’t like how the show ended. It felt rushed and very baffling. Continue reading How Game of Thrones Should Have Ended

A Blind Robot Beside an Infinite Wall

Let’s think about the following problem:

Consider a wall that stretches to infinitely in both directions. There is a robot at position \(0\) and a door at position \(p\in\mathbb Z\) along the wall \((p\neq 0)\). The robot would like to get to the door, but it knows neither \(p\), nor the direction to the door. Furthermore, the robot cannot sense or see the door unless it stands right next to it. Give a deterministic algorithm that minimizes the number of steps the robot needs to take to get to the door.

This problem quite famous Continue reading A Blind Robot Beside an Infinite Wall

Prime Counting Function and Chebyshev Bounds

The distribution of primes plays a central role in number theory. The famous mathematician Gauss had conjectured that the number of primes between \(1\) and \(n\) is roughly \(n/\log n\). This estimation gets more and more accurate as \(n\to \infty\). We use \(\pi(n)\) to denote the number of primes between \(1\) and \(n\). So, mathematically, Gauss’s conjecture is equivalent to the claim

\[\lim_{n\to\infty}\frac{\pi(n)}{n/\log n}=1\]

Continue reading Prime Counting Function and Chebyshev Bounds