I changed the code to remove symsum as follows.
Now it just running forever. Where should I chage reduce running time?
x=3;n=25; alp=0.05, del=0.000001;
plb0 = input('Enter the intial approximation of lower bound:');
tic
for i=1:1000000000
f0=1-alp/2-.5*binopdf(x,n,plb0)-binocdf(x-1,n,plb0); %Calculating the value of function at initial value
f0_der= -.5*binopdf(x,n,plb0)*((x-n*plb0)/(plb0*(1-plb0))) -nck_der(plb0,n,x); %Calculating the value of function derivative at initial value
plb=plb0-f0/f0_der; % The Formula, Newton Raphson Method
err=abs(plb-plb0);
if err<del %checking the amount of error at each iteration
break
end
plb0=plb;
end
t1= toc
i
%%%%%%%%%%% As separate m file in the same directory%%%%%%%%%%
function S = nck_der(p0,n,x); %To find the last part of the derivative of function f0.
S=n*(1-p0)^n;
for k=1:x-1;
S=S+binopdf(k,n,p0)*((k-n*p0)/(p0*(1-p0)));
end
end