Clear[pi,lambda,mu,s,Ka];pi[n_,lambda_,mu_,s_,Ka_]:=If[n==0,1,If[n≤s,(lambda/mu)^n/(n!),(lambda/mu)^n/((s!)*s^(n-s))]]/Sum[If[k==0,1,If[k≤s,(lambda/mu)^k/(k!),(lambda/mu)^k/((s!)*s^(k-s))]],{k,0,Ka}];

Clear[LL,LLs,LLq,WW,WWs,WWq,lambda,mu,s,Ka];LL[lambda_,mu_,s_,Ka_]:=Sum[n*pi[n,lambda,mu,s,Ka],{n,0,Ka}];WWs[lambda_,mu_,s_,Ka_]:=1/mu;LLs[lambda_,mu_,s_,Ka_]:=If[Ka<Infinity,lambda*(1-pi[Ka,lambda,mu,s,Ka])*WWs[lambda,mu,s,Ka],lambda*WWs[lambda,mu,s,Ka]];LLq[lambda_,mu_,s_,Ka_]:=LL[lambda,mu,s,Ka]-LLs[lambda,mu,s,Ka];WWq[lambda_,mu_,s_,Ka_]:=If[Ka<Infinity,LLq[lambda,mu,s,Ka]/(lambda*(1-pi[Ka,lambda,mu,s,Ka])),LLq[lambda,mu,s,Ka]/lambda];WW[lambda_,mu_,s_,Ka_]:=WWs[lambda,mu,s,Ka]+WWq[lambda,mu,s,Ka];

Exercise 9.21

{LL[1/4,1/2,1,Infinity],WWq[1/4,1/2,1,Infinity],WW[1/4,1/2,1,Infinity]}

Exercise 9.27

FullSimplify[{LL[lambda,mu,1,Ka]/(lambda*(1-pi[Ka,lambda,mu,1,Ka]))-(LL[lambda,mu,1,Ka]+1-(Ka+1)*pi[Ka,lambda,mu,1,Ka])/(mu*(1-pi[Ka,lambda,mu,1,Ka])),LL[lambda,mu,1,Ka]/(lambda*(1-pi[Ka,lambda,mu,1,Ka]))-1/mu-(LL[lambda,mu,1,Ka]-Ka*pi[Ka,lambda,mu,1,Ka])/(mu*(1-pi[Ka,lambda,mu,1,Ka])),(LL[lambda,mu,1,Ka]/(lambda*(1-pi[Ka,lambda,mu,1,Ka]))-1/mu)*lambda*(1-pi[Ka,lambda,mu,1,Ka])-(LL[lambda,mu,1,Ka]-(1-pi[0,lambda,mu,1,Ka]))},Assumptions->Ka>1]

Exercise 9.28

FullSimplify[LL[lambda,lambda,1,Ka],Assumptions->Ka≥1]

Exercise 9.29

N[{WW[1/15,1/10,1,3],WWq[1/15,1/10,1,3],pi[3,1/15,1/10,1,3]}]

Exercise 9.30

Clear[additional];additional=0;While[N[pi[4+additional+8,1/20,1/120,4+additional,4+additional+8]]>=0.2,additional=additional+1];additional