yaworsw/euler-manager

View on GitHub
data/problems/232.yml

Summary

Maintainability
Test Coverage
---
:id: 232
:name: The Race
:url: https://projecteuler.net/problem=232
:content: |+
  Two players share an unbiased coin and take it in turns to play "The Race". On Player 1's turn, he tosses the coin once: if it comes up Heads, he scores one point; if it comes up Tails, he scores nothing. On Player 2's turn, she chooses a positive integer <var>T</var> and tosses the coin <var>T</var> times: if it comes up all Heads, she scores 2<sup><var>T</var>-1</sup> points; otherwise, she scores nothing. Player 1 goes first. The winner is the first to 100 or more points.

  On each turn Player 2 selects the number, <var>T</var>, of coin tosses that maximises the probability of her winning.

  What is the probability that Player 2 wins?

  Give your answer rounded to eight decimal places in the form 0._abcdefgh_ .