I need to simulate a man's walk. He has a probability of p that he turns to the left and a probability of q = 1-p that he turns to the right. His step length is 1 foot. What algorith should I use to simulate this man's walk? I need this to help me plot his first 500 steps.
Feels like a homework assignment...
you should create your own algorithm:
c(0,1)
sample
?sample
if you get hung up on something, come back and ask a specific question and show what you tried. I'm happy to help if you're making an effort, but you won't learn anything if you just have someone else do it for you.