PRPR6 - Editorial

PROBLEM LINK:

Practice

Contest

DIFFICULTY LEVEL:

Easy

PREREQUISITES:

Basic Probability

QUESTION:

The only way Clever Chan can possibly lose to in any Bowling duel is if he doesn’t make it till the end. Hence the question is to calculate the sure shot chance of them winning (i.e., Clever Chan making till the end), given the odds (read: distractions) that will be stacked against him by the opponents.

EXPLANATION:

Don’t let the length of the problem statement intimidate you. The problem is fairly simple and requires only common knowledge of probability.

It is given that Clever Chan always rolls a strike, irrespective of his state of mind/being. Hence, Probability for Clever Chan to roll a strike = 1. However the opponents know it too and they devise a strategy to make Clever Chan forfeit the game. And they wish to achieve that by introducing Spiked Drinks and Meat Burger(lack thereof) to him after every roll. (Note: Both these distractions, Drinks and Burger, are independent events and they do not affect each other’s odds)

Since it is mentioned that all the events are equally likely, therefore,

Probability of Clever Chan having Spiked Drink, A = Probability of having Drink B = Probability of having Drink C = 1/3.

Probability of Clever Chan eating the burger = Probability of him not having the burger = 1/2.

Let’s take an example after the first instance i.e., after the first roll itself. Having started the contest with Concentration, C and Resistance, R, Clever Chan’s expectant values after the first round(roll) will look as follows -

C = C - [1/3 * 2(Spiked Drink A) + 1/3 * 5(Spiked Drink B) + 1/3 * 10(Spiked Drink C)] - [1/2 * 20(Has the Burger)]

R = R - [1/2 * 1(Has the Burger)]

And similarly his Concentration and Resistance values keep on decreasing after each round. Once it reaches zero or below, Clever Chan is no more able enough to make it to the next round.

SOLUTION:

Here’s the code.

Author: Digvijay Mahra

Tester: Predible Health

Editorialist: Digvijay Mahra

//