Write a program that simulates an experiment entailing 100

Assignment Help Science
Reference no: EM133381073

Computer Networking

Problem Description

Review the solution to the 2D-Random Walk problem from Ex1 and make required correction to your Ex1 solution.

Importing the necessary functions from Ex1 write a program that simulates an experiment entailing 100 trials of the random walk. Your program shall output the simulation results to a csv file. The file must contain the trial number and number of steps taken in each trial.

For each trial display a trace of the path taken using the turtle module. Additionally display the number of trials and the average number of steps taken in each trial on the turtle screen.

Your program shall minimally define and use the following functions (descriptions are provided in the given template script):
• reset(): Puts the turtle at the center and sets the heading to 0, without tracing the turtle's path. Additionally, shall reset the turtle's pen color to a random color for tracing the path taken in the next walk

• experiment(num_trials=100, top_speed=False) -> list: Repeats the random walk for the given number of trials. If top_speed is set to True uses the turtle module's tracer function to speed up the animation (NB: recommended value for tracer is 20). The function shall return a nested list with trial number and steps taken in each trial ex. [[1, 90], [2, 112], ..., [100, 240]]

• write_results(results, file='rwalk.csv'): Takes results from the experiment function and displays the number of trials and average steps taken in each walk on the turtle screen. Additionally, writes the full results i.e. trial number and steps to a csv file. Header of csv file must be a descriptive string depicting the data in each column ex: 'Trial #', 'Number of steps'

Reference no: EM133381073

Questions Cloud

College education for all high-school graduates : What are two benefits and two costs (whether direct or indirect) of offering a free two-year college education for all high-school graduates?
Identify what the corporate strategy of burger king : Identify what the corporate strategy of Burger King (if there is no formulated strategy: identify what the strategic obejectives of Burger king).
Offering free two-year college education : What are two benefits and two costs (whether direct or indirect) of offering a free two-year college education for all high-school graduates?
British violations of american neutrality : After years of suffering from British violations of American neutrality, the United States declared war on Great Britain in 1812. Was the war inevitable?
Write a program that simulates an experiment entailing 100 : CYSE 230 Computer Networking, George Mason University write a program that simulates an experiment entailing 100 trials of the random walk.
Explain atleast strategies to understand child development : In groups of 4, with the help of powerpoint presentation explain atleast 10 strategies to understand child development.
Encourages the consumption of dairy products : What do you make of these contradictory policies within a single federal department: one that encourages the consumption of dairy products
Identify the social and environmental impact of burger king : Identify the social and environmental impact of Burger King How these impact expressed in performance indicator of Burger king
Review the website johns hopkins medicine : Preschool, School-Aged, and Adolescent. Pick one of the areas and discuss, as if preparing a refresher paper for teachers on their students' development.

Reviews

Write a Review

Science Questions & Answers

  Generation of particulates pollution

List some common daily activities that would require incomplete combustion that would result in the generation of particulates pollution

  Characterize hill approach to environmental ethics

How would you characterize Hill's approach to environmental ethics? Do you agree with his idea that these actions invoke a feeling of moral disapproval?

  Are there alternatives to hospitalization in case

She has agreed to be admitted to the inpatient psychiatric unit for further evaluation. Are there alternatives to a hospitalization in this case?

  What process is it and how are their adaptations

specific macroevolutionary process. explain. what process is it and how are their adaptations related to this process.

  Prepare a seminar reviewing evidence of harm

Topic: Diesel Particulate Matter. Each group will be required to prepare a seminar reviewing evidence of harm which results from exposure to a hazardous chemical

  Why does the discussion of politics create so much friction

Do you think that political science is a natural evolution of political philosophy as we try to understand the dynamics of various political systems?

  Describe funding and reimbursement for treatment

Describe the treatment options for the disorder you have chosen. Describe funding and reimbursement for treatment of the disorder you have chosen.

  Impact has technology issues

Write a one to two page reaction paper on what is meant by "making well people better?"

  Who gave the most important contributions

It is clear that Jefferson borrowed from the social contract theorists. Of Hobbes, Locke, and Rousseau, who gave the most important contributions?

  What were some of edward jenner;s accomplishments

All medical procedures, including vaccination, carry on some risk. How much risk do you feel is acceptable

  Describe costa rica psa program

Describe Costa Rica's PSA program. What does "PSA" stand for? What data has been used to interpret whether the program was successful?

  Examine the philosophy of cam

Compare and contrast conventional current regulations and oversights that exist in the United States with that of nonconventional medicine.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd