Life

Bayes’ Theorem in a Flu Season

At the peak of flu season, one in a hundred gets the flu. But half of the infected show no symptoms. People with allergies or colds can also show Flu symptoms; one in twenty people who don’t have flu can show flu-like symptoms. So the question is: if a person shows signs of the flu, what is the probability that she has the flu?

We will use this example to illustrate problem-solving through Bayes’ rule. So what is the ask here? You have to tell the chance that a person has flu, given she is showing symptoms, S. Or in shorthand, P(F|S). But what do all we know about flu?

  1. If a random person is picked from the street, there is a one in a hundred chance that he has flu. In other words, P(F) = 1/100 = 0.01. It also means that 99 out of 100 random people in the street have no flu, P(nF) = 0.99.
  2. Only half of the people who have flu show any symptoms. The probability of expressing signs given the person has flu = 0.5. In shorthand, it is P(S|F).
  3. 1 in 20 people who don’t have flu can show flu-like symptoms or P(S|nF) = 0.2

Use all the above information and plug it into Bayes’ equation.

P(F|S) = P(S|F) x P(F) /[P(S|F) x P(F) + P(S|nF) x P(nF)] = 0.5 x 0.01 /[0.5 x 0.01 + 0.2 x 0.99] = 0.0246 = 2.5%

Bayes’ Theorem in a Flu Season Read More »

Flow Model of Happiness

What makes us happy is a question that people have been raising over the years. Psychologist Mihaly Csikszentmihalyi has an answer. He describes the state of feeling happy by the term, flow.

He examined hundreds of people about what made them happy and found out the conditions for flow.

  1. Intense focus on a task. A person focuses on one activity that she forgets about everything else.
  2. Freedom from all self-scrutiny. The job is not imposed upon, but it’s own choice. No fear, no doubt.
  3. Get immediate feedback. An actor gets it when her opposite person reacts; a climber knows how far she must climb before the summit.
  4. Optimally challenging: neither over-challenging nor under-challenging.

Flow Model of Happiness Read More »

Cognitive Dissonance Theory

Cognitive dissonance – a term attributed to psychologist Leon Festinger – arises when there is an inconsistency between someone’s actions and what she thinks she must do. An often-quoted example is smoking: if the person smokes and believes that smoking is unhealthy, there exists a dissonance.

This inconsistency is a serious issue and can affect a person mentally and physically. And that calls for a solution. But how do people manage it?

Modify the thought

“Well, I do smoke; but smoking relaxes me, so it is not that bad”. Such a change of view could restore consistency.

Modify the behaviour

Another way of dealing with cognitive dissonance is to repair the inconsistency by quitting the habit.

Rationalise

The person can argue about, say, other healthy behaviour that she follows to justify a bit of smoking. “I do exercises, annual medical check-ups, not all smokers get cancer”, etc.

Ignore

The last attitude is to trivialise it and simply declare: “I don’t care!”.

Cognitive dissonance: Wiki
Cognitive Dissonance Theory: A Crash Course: Youtube

Cognitive Dissonance Theory Read More »

Probability of Cheat Coin

Anne has a bag with ten coins; one of them is a cheat coin (both side-heads). She picks up one coin and tosses it two times, and both are heads. What is the probability that she picked the cheat coin?

We all know that the probability of drawing the cheat coin from the bag is 1/10, but that was not the question here. It is on chance, given a piece of information is already available. So the ask must be an updated (Bayesian) guess. We can solve the problem in two ways.

Method 1: In one step

\\ P(CC|2H) = \frac{P(2H|CC)*P(CC)}{P(2H|CC)*P(CC) + P(2H|GC)*P(GC)} \\ \\ P(CC|2H) = \frac{1 * 1/10}{1 *(1/10) + (1/4)*(9/10)} = \frac{4}{13} = 0.31

Method 2: Posterior as the new prior

\\ P(CC|H) = \frac{P(H|CC)*P(CC)}{P(H|CC)*P(CC) + P(H|GC)*P(GC)} \\ \\ P(CC|H) = \frac{1 * 1/10}{1 *(1/10) + (1/2)*(9/10)} = \frac{2}{11}  \\ \\ P(CC|2H) = \frac{P(H|CC)*P(CC|H)}{P(H|CC)*P(CC|H) + P(H|GC)*(1-P(CC|H))} \\ \\ P(CC|2H) = \frac{1 * 2/11}{1 *(2/11) + (1/2)*(9/11)} = \frac{2}{13/2} = \frac{4}{13} = 0.31

The notations are:
P(CC|2H) = chance that it is a cheat coin, given two times heads
P(2H|CC) = chance of two heads for a cheat coin
P(CC) = the prior chance for a cheat coin
P(2H|GC) = chance of two heads for a good coin
P(GC) = the prior chance for a good coin= 1 – P(CC)
P(CC|H) = chance that it is a cheat coin, given heads in the first toss
P(H|CC) = chance of heads for a cheat coin
P(H|GC) = chance of heads for a good coin

Probability of Cheat Coin Read More »

Ultra-processed food and Ovarian Cancer

According to a recent study, the consumption of ultra-processed food (UPF) is linked to a group of cancers, notably ovarian. But what is ultra-processed food? As per a Harvard health blog, corn chips, apple pie, french fries, carrot cake, and cookies are all examples of UPF. And how profound is the impact? In other words, how big is a 20% increase, as the study claims, in the case of ovarian cancer?

Ovarian cancer

The global incidence of yearly fresh cases of ovarian cancer is 6.6 per 100,000 people in 2020. In the US, it’s 19,880 in 2023, which is about 10 per 100,000 women (age-adjusted).

The red circles are incident rates of new cases, and the blue triangles are deaths. Interestingly, the graph shows a steady decline over the years.

Ultra-processed food and Ovarian Cancer Read More »

The Muller-Lyer illusion

Look at the above graphic. There are two lines terminated with either arrowheads or arrow tails. While the length of the lines in both cases is the same, the illusion created by the form of the terminals makes our brain believe that the one on the bottom is longer. This is the Muller-Lyer illusion.

The Muller-Lyer illusion Read More »

Wisdom of the Crowd and Winner’s Curse

The wisdom of the crowd is an idea that stems from the fact that the average estimation by a group of people is better than by individual experts. In other words, when a large group of non-experts (not biased by knowledge!) possessing diverse opinions starts predicting a quantity, their assessment tends to form a kind of bell curve – a large pack in the middle and outliers nicely distributed on either side.

In other words, the outlier of the crowd has a lower probability of estimating it accurately. Mark this line; we need it later.

Estimating the weight

Let’s go back to Francis Galton (1907) and the story of the prize-winning-ox. It was a competition in which a crowd of about 800 people participated to predict the weight of an ox after it had been slaughtered and dressed. The person whose prediction came closer would win the prize. On the event in which Galton participated, he found a nearly normal distribution of ‘votes’, and the middlemost value, the popular choice or the vox populi, was 1207 lb which was not far from the actual dressed weight of 1198 lb.

Bidding for the meat

Now, change the scenario: the winner is no longer the predictor of weight but who will pay the most. Therefore, by definition, the people in the middle of the pack, those with a better estimation of the actual value of the meat (estimated weight x market price), are not going to get the prize. The bid belongs to the person furthest outlier (to the right) of the distribution. This is the winner’s curse – the winner is the one who overvalues the object. The only time it doesn’t apply is if the winner attaches a personal value to it, such as collecting a painting.

References

Vox Populi, Nature, 1907, 75, 450

Wisdom of the Crowd and Winner’s Curse Read More »

Posterior as a Compromise

It is interesting to see how posterior distributions are a compromise between prior knowledge and the likelihood. An extreme, funny case is a coin that is thought to be bimodal, say at 0.25 and 0.75. But when data was collected, it gave almost equal heads and tails.

Posterior as a Compromise Read More »

Twin Paradox

First thing first: the twin paradox is not a paradox! Now, what is it?

Before we go to the twin paradox, we must know the concept of relativity of simultaneity. It is a central concept in the special theory of relativity and happens because the speed of light is constant. A famous thought experiment is when a light flashes at the centre point of a train, running at constant velocity. To the observer inside the train, the light will reach the engine and the tail simultaneously (the same distance from the light source). But for a standing observer on the platform, the light will hit the back of the train first, as it is catching up, and strike the engine last, as it is going away from the light source. And both are right. Or the distant simultaneity depends on the reference point.

Put differently, A and B are two objects. And A moves towards the static B at a constant velocity. But from A’s vantage point, it feels stationary, and B is moving towards A. Both A and B are correct.

Over the twin paradox: Anne and Becky are twins. Becky goes away in a spaceship to a distant planet and comes back. From the stay-at-home Anne’s perspective, Becky’s clock is running slow due to the special theory of relativity. So, when she comes back, Becky will be younger than Anne. But Becky, while heading back, looks at Anne and says it was Anne who was moving towards her (in her perspective), so Anne is younger. How can both be happening? So, it’s a paradox.

Interestingly, this time, we can’t say both are right. Anne is right; Becky is the younger of the two when she returns. The only time one can claim to be at rest and the rest of the world is moving is when the moving person is moving with constant velocity. Sadly, Becky cannot claim it; she changed her direction to return and created acceleration. Remember: velocity comprises speed as well as direction. On the other hand, Anne’s version is valid as she had no acceleration but was standing at constant (zero) velocity.

WSU: Space, Time, and Einstein with Brian Greene

Twin Paradox Read More »

Impact of Prior – Continued

Last time, we have seen how the choice of prior impacts the Bayesian inference (the updating of knowledge utilising new data). In the illustration, a well-defined (narrower) distribution of existing understanding more or less remained the same after ten new, mostly contradicting data.

Now, the same situation but collected 100 data, with 80% leading to tails (the same proportion as before).

Now, the inference is leaning towards new compelling pieces of evidence. While Bayesian analysis never prohibits the use of broad and non-specific beliefs, the value of having well-defined facts is indisputable, as illustrated in these examples.

If there are multiple sets of prior available, it is prudent to check their impact on the posterior and map their sensitivities. Sets of priors can also be joined (pooled) together for inference.

Impact of Prior – Continued Read More »