Todd - Segment 2

From Computational Statistics Course Wiki
Jump to navigation Jump to search

To Calculate

1. If the knight had captured a Gnome instead of a Troll, what would his chances be of crossing safely?

Every bridge has 5 creatures under it:

20% have 2 trolls, 3 gnomes ()

20% have 1 troll, 4 gnomes ()

60% have 5 gnomes ()

The chances of the knight crossing safely after capturing a gnome is represented by the probability that we are in given a gnome (G) was observed:

2. Suppose that we have two identical boxes, A and B. A contains 5 red balls and 3 blue balls. B contains 2 red balls and 4 blue balls.

A box is selected at random and exactly one ball is drawn from the box. What is the probability that it is blue?

If it is blue, what is the probability that it came from box B?

To Think About

1. Do you think that the human brain's intuitive "inference engine" obeys the commutativity and associativity of evidence? For example, are we more likely to be swayed by recent, rather than older, evidence? How can evolution get this wrong if the mathematical formulation is correct?

Humans are swayed more by recent data. Perhaps this is because our memories are not very good, or for some reason our brain prioritizes recent events over older ones (because there is an immediate survival instinct). Plus, we realize that things can change over time, so historical data may not be a good indicator of future events if other significant changes in the environment have taken place since that data was observed. For example, (very) historical data would suggest that the probability of death during childbirth is very high, yet recent data contradicts that and we tend to only think about the recent data for this particular type of event.

2. How would you simulate the Knight/Troll/Gnome problem on a computer, so that you could run it 100,000 times and see if the Knights probability of crossing safely converges to 1/3?

Come up with 3 hypotheses: 1 for each bridge type:

: 2 trolls, 3 gnomes (20% of all bridges)

: 1 troll, 4 gnomes (20% of all bridges)

: 2 trolls, 3 gnomes (60% of all bridges)

We want to simulate the probability of crossing safely, given a troll has already been captured.

So, we first choose a bridge to walk on (a hypothesis) according to the probability distribution.

Then simulate capturing a creature by choosing randomly in the range (these numbers correspond to an index into the list of creatures for the given bridge we are on).

If the "captured" creature is a troll, increment a "troll" counter and also determine whether we can pass this bridge safely (can pass safely if the remaining creatures are all gnomes, otherwise can't). Increment a counter when we can pass safely.

Now we have two counters: a troll counter that counts the number of trolls captured, and a safety counter, that counts the number of safe passes we made after capturing a troll. The simulation stops when the troll counter reaches 100,000.

The ratio of the safe counter to the troll counter provides the simulated probability of passing safely given a troll was captured.

We did this as an in-class activity (see link below). Our simulation converged to 0.33168 after 100,000 troll captures.

3. Since different observers have different background information, isn't Bayesian inference useless for making social decisions (like what to do about climate change, for example)? How can there ever be any consensus on probabilities that are fundamentally subjective?

Bayesian inference can still be useful, especially if there is consensus about the priors. Even when there is no consensus about priors, sometimes the posterior probabilities are very similar regardless of the priors.

In Class Activities