given :
J(n)=b*A(n)
S(n+1)=j*J(n)
A(n+1)=s*S(n) + a*A(n)
b=0.5
a=0.7 , A(0)=70
j=0.75 , J(0)=75
s=0.8 , S(0)=80
n is integer
write a procedure to find A(5)=? , J(5)=? , S(5)=?
given :
J(n)=b*A(n)
S(n+1)=j*J(n)
A(n+1)=s*S(n) + a*A(n)
b=0.5
a=0.7 , A(0)=70
j=0.75 , J(0)=75
s=0.8 , S(0)=80
n is integer
write a procedure to find A(5)=? , J(5)=? , S(5)=?
This does it.
J:=proc(n)
if n=0 then return 75;
else (1/2)*A(n);
end if;
end proc:
A:=proc(n)
if n=0 then return 70;
else S(n-1)*(8/10)+(7/10)*A(n-1);
end if;
end proc:
S:=proc(n)
if n=0 then return 80;
else (3/4)*J(n-1);
end if;
end proc:
A(5), J(5), S(5);