Barbara is a mathematician and a basketball player. She has found
that the probability of scoring a point when shooting from a distance
is exactly , where is a real constant greater than .
During each practice run, she takes shots from distances and, according to
her records, she has precisely a chance to score a total of exactly
points.
Find and give your answer
rounded to decimal places.
N = 50 M = 20 Q = 0.02 l = N r = N << 1 for _ inrange(100): q = 0.5 * (l + r) f = [[0for i inrange(M + 1)] for j inrange(N + 1)] f[0][0] = 1 for i inrange(1, N + 1): rt = 1 - i / q for j inrange(min(i, M) + 1): if j > 0: f[i][j] += f[i - 1][j - 1] * rt if j < i: f[i][j] += f[i - 1][j] * (1 - rt) if f[N][M] > Q: l = q else: r = q ans = l print("{:.10f}".format(ans))