function p = BR_atom_prob(P,k)
%

p = 0;

n = log2(length(P));
for b = 0:2^n-1
    bits = BR_int2bits(b,n);
    if bits(k)==1
        p = p + P(b+1);
    end
end
