Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
Solved

Posted on 2011-09-08
Medium Priority
287 Views
Random Walk

• Run ten trials  with n = 5 and for each trial  report:

Trial  #      Very First  Step      First Edge Reached      Final Direction      Steps
1      left – right      left – right      left – right
2      left – right      left – right      left – right
3      left – right      left – right      left – right
4      left – right      left – right      left – right
5      left – right      left – right      left – right
6      left – right      left – right      left – right
7      left – right      left – right      left – right
8      left – right      left – right      left – right
9      left – right      left – right      left – right
10      left – right      left – right      left – right

• How often did the direction  of the first step match the final direction  of the walk?

• How often did the first edge reached match the final direction  of the walk?

• What  was the average number of steps required for these ten particular  trials?
0
Question by:Jsara
[X]
###### Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

• Help others & share knowledge
• Earn cash & points
• 2

LVL 29

Expert Comment

ID: 36505972
What is the assignment and what is your question?  You should not expect that it will be solved for you.  It is against the rules here, and it would also be unfair to yourself as you would miss the chance to learn.  On the other hand, you can get advices here.
0

Author Comment

ID: 36510485
ok, let me explain I am trying to learn python and this is an excercise. I don't have a math background and do not know what is random walking means and what does the left right has to do.
0

LVL 41

Accepted Solution

HonorGod earned 2000 total points
ID: 36510726
Think of the left / right as something like a coin toss.
With a coin, you either get heads, or tails (ignoring the possibility of landing on the edge, of course).

So, I interpret these as two possible directions that can be taken at each decision point.

This documentation page talks about generating "random" numbers with Python:
http://docs.python.org/library/random.html
0

LVL 41

Expert Comment

ID: 36713040
Thanks for the grade & points.

Good luck & have a great day.
0

## Featured Post

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Installing Python 2.7.3 version on Windows operating system For installing Python first we need to download Python's latest version from URL" www.python.org " You can also get information on Python scripting language from the above mentioned we…
Dictionaries contain key:value pairs. Which means a collection of tuples with an attribute name and an assigned value to it. The semicolon present in between each key and values and attribute with values are delimited with a comma.  In python we can…
Learn the basics of modules and packages in Python. Every Python file is a module, ending in the suffix: .py: Modules are a collection of functions and variables.: Packages are a collection of modules.: Module functions and variables are accessed us…
Learn the basics of while and for loops in Python.  while loops are used for testing while, or until, a condition is met: The structure of a while loop is as follows:     while <condition>:         do something         repeate: The break statement m…
###### Suggested Courses
Course of the Month11 days, 6 hours left to enroll