Solved

Hi - new to python and all the functions. - can any one please help

Posted on 2011-09-08
4
266 Views
Last Modified: 2013-11-05
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
Comment
Question by:Jsara
  • 2
4 Comments
 
LVL 29

Expert Comment

by:pepr
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

by:Jsara
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

by:
HonorGod earned 500 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

by:HonorGod
ID: 36713040
Thanks for the grade & points.

Good luck & have a great day.
0

Featured Post

Free Tool: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
merging 2 mysql databases with java 7 67
Downgrade Python 3.5 to 3.3 30 973
Cassandra Select Query 1 87
python - find anything after $ question. 9 18
Less strange, but still introduction This introduction was added (1st August, 2011) to reflect some reactions.  Firstly, the term basics in the title of the article...  As any other word, it is a symbol with meaning attached to the word by some a…
A set of related code is known to be a Module, it helps us to organize our code logically which is much easier for us to understand and use it. Module is an object with arbitrarily named attributes which can be used in binding and referencing. …
Learn the basics of if, else, and elif statements in Python 2.7. Use "if" statements to test a specified condition.: The structure of an if statement is as follows: (CODE) Use "else" statements to allow the execution of an alternative, if the …
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…

828 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question