killercrew

10 Reputation

One Badge

7 years, 101 days

MaplePrimes Activity


These are replies submitted by killercrew


Here is a script for 4 steps,just modify to make 3 steps

restart

``

N := 1121:

for i to M do X[i, 0] := 0; Y[i, 0] := 0; X[i, 1] := 1; Y[i, 1] := 0; for j from 2 to N do r := R(); if r = 1 then X[i, j] := X[i, j-1]+1; Y[i, j] := Y[i, j-1] elif r = 2 then X[i, j] := X[i, j-1]-1; Y[i, j] := Y[i, j-1] elif r = 3 then Y[i, j] := Y[i, j-1]+1; X[i, j] := X[i, j-1] else Y[i, j] := Y[i, j-1]-1; X[i, j] := X[i, j-1] end if end do end do:

``

i := 'i':

plot([`$`([`$`([X[i, j], Y[i, j]], j = 0 .. N)], i = 1 .. M)]);

 

``


 

Download randomwalk4stp.mw

@killercrew 

Quick and helpful replies as always;)

@Preben Alsholm 

Is it the same as :i from 0 to N-1 do?

but Thanks for reply

This will make me understand howto use maple for this kind of problems. You have learned me more with this script than i self have manage to do for the last 7 days:=)

@Preben Alsholm 

 

So this assignment is graded and must pass to take exam. Problem is im new to Maple and we have only had 5 lectures.
So this level is far from my knownledge, only used matlab. And our teacher is away and no student assistants available.
have read and tried to solve this for 100 hours ,so yes some help from others its ok i guess:) No way im gonna learn enough maple in 1 week to understand and program my script when i dont know howto do this simple tasks:)
 

But some good web links to guides to solve and learn maple is also a option. 

I will try the next part of my assignment with this procedure.

Thank you very much. This was helpful.

Page 1 of 1