Question: you are given n boxes indexed from 1 to n...
You are given N boxes indexed from 1 to N.
Each box contains either no coins or one coin.
The number of empty boxes and the number of boxes with one coin are denoted by n0 and n1, respectively.
You take a random subset of the boxes where each subset has the same same probability to be selected.
The empty set and the set itself are considered a subset.
Given n0 and n1, what is the probability that the total number of coins in the random subset is even?
N = n0 + n1 < 100000
- Input: n0 = 1, n1 = 0
- Output: 1.0
- Explanation: There are two subsets:  and . Both of them have an even sum.
- Input: n0 = 0, n1 = 2
- Output: 0.5
- Explanation: There are four subsets: , , , and [1, 1]. The sum of  and [1,1] is even.