MATLAB: How can i solve equation with summation

solve

i can't solve the attached img equation on matlab for : Pfa=10^(-6),M=8,i=s=1
(later i would change these variables)
i tried the following but errors rises
if true
M=8;
s=1;
i=s;
syms pfal M i s
eqn = symsum((nchoosek(M,i)*(pfal)^(i)*(1-pfal)^(M-i)), i, s, M)==8*10^(-6);
solve(eqn,pfal)
end

Best Answer

I think I can read the summation index: it is an i. That would mean that you should initiate i as a sym not as a hard-coded value, and thus the result from nchoosek changes each summation part.
M=8;
s=1;
syms pfal i
f = nchoosek(M,i);
eqn = (symsum(f*(pfal)^(i)*(1-pfal)^(M-i), i, s, M)==10^(-6));
solve(eqn,pfal)
This exits without error, but results in 8 solutions, 6 of which are complex. One solution is indeed equal to the solution that Roger suggested (1.25e-7).