Processing math: 100%

Problem #331

Colourful Wand

The sorcerer is crafting a wand for himself that contains 101 pearls in a specific sequence. Each pearl is magically generated and can be either red or blue in color, with an equal probability for each. The power of the wand is the maximum number of consecutive pearls of the same colour. The expected power of the wand is x.

x can be represented as \frac{p}{q} such that \text{gcd}(p,q) = 1. Find (p \cdot q^{-1})\:mod\:1234567891.

Contributed by Rudransh Aggarwal

Solved by 8 users

Log in to submit answers.

Is something wrong?

Maintaining a collection of high quality questions is our top priority. If, however, you do find an error, report the problem and we'll make sure it is reviewed soon.