Mathematical Modeling with LPL : Explain and run a Model
Problem Statement
Modeling Description
||
Back to MatMod
model gameht "A Two Persons Game"; set i,j :=[1..7]; parameter p{i,j} := if(i>j+1,-j , i=j+1,i+j , i=j-1,-i-j, i
7 then return 0; end x{i|i>1}:=x[i-1]+x[i]; set k,r:=[1..34]; parameter q{k,r}; n; integer parameter T{k,r}:= q[k,r]:=Rnd(0,1), n:=1, while(q>x[n], n:=n+1), n; Write{k}('%2d\n' , {r} T); end
Problem Statement
Modeling Description
Back to model
The solution is as follows:
The LOG-File output of LPL is as follows: