Premium problem115. Active Neurons Under Dropout

Easy Locked

A layer has n neurons and dropout rate p, so each neuron is dropped independently with probability p. Return the probability that exactly k remain active.

The count of survivors is Binomial(n,1−p)\mathrm{Binomial}(n, 1-p).

Input

n = 10
k = 5
p = 0.5

Output

0.24609375

Premium problem

This one's part of Premium. Unlock the full Probability track plus every other premium problem on the site.

Implement solve(...)