Ask Question, Ask an Expert

+61-413 786 465

info@mywordsolution.com

Ask Computer Engineering Expert

1. Suppose you are doing a random walk (see previous problem) on the blocks of a city street. At each "step" you choose to walk one block (at random) either forward, backward, left or right. In n steps, how far do you expect to be from your starting point? Write a program to help answer this question.

2. Write a graphical program to trace a random walk (see previous two problems) in two dimensions. In this simulation you should allow the step to be taken in any direction. You can generate a random direction as an angle off of the x axis.

1760_ba1a7c9a-d9d7-4984-b8c7-0ef7c8e6a765.png

The new x and y positions are then given by these formulas:
x = x + cos(angle)
y = y + sin(angle)

The program should take the number of steps as an input. Start your walker at the center of a 100x100 grid and draw a line that traces the walk as it progresses.

Computer Engineering, Engineering

  • Category:- Computer Engineering
  • Reference No.:- M92059716

Have any Question? 


Related Questions in Computer Engineering

A study was conducted of pleas made by 1032 criminals among

A study was conducted of pleas made by 1,032 criminals. Among those criminals, 954 pled guilty, and 394 of them were sentenced to prison. Among the 78 of the other criminals, who pled not quilty, 58 were sentenced to pri ...

Question project 1 involves the creation of a personal

Question: Project 1 involves the creation of a personal website for yourself - also known as a resume site or a CV site. All the files used in the website must be contained within a specific folder named "project_1" (exc ...

Assignment week 2 documenting the project

Assignment: Week 2 Documenting the Project Lifecycle Well-written project documentation clarifies intent, documents decisions and results, and allows project managers to assess project progress (and report it, as necessa ...

You get hired as a machine learning expert at moviescom

You get hired as a Machine learning expert at movies.com. Your task on day one is to improve the performance of a classifier. You divide the data into 2 parts training, and testing. You learn a model from the training da ...

Question bull what is the significance of the concept of

Question : • What is the significance of the concept of inheritance within the concept of object oriented programming? How does the concept of inheritance improve on the traditional programming model? • Provide a program ...

Suppose a machine has 16 registers and uses 24 bit memory

Suppose a machine has 16 registers and uses 24 bit memory addresses. The opcodes are 8 bits so that the instruction length is 32 bits. Register instructions can have two or three register operands (4 bits to name each re ...

In class i described the methods used to create gas and

In class, I described the methods used to create gas and gasoline from the carbon in coal. The other ingredients were water and heat energy. First we made 'coal gas' from the carbon in coal  C + H2O → H2 + CO  Then we us ...

Calculate the present worth of all costs for a newly

Calculate the present worth of all costs for a newly acquired machine with an initial cost of $30,000, no trade-in value, a life of 15 years, and an annual operating cost of $13,000 for the first 4 years, increasing by 1 ...

Question suppose users share a 3 mbps link through circuit

Question : Suppose users share a 3 Mbps link through circuit switching. Also suppose each user requires 150 kbps when transmitting, but each user transmits only 10 percent of the time. a) How many users can be supported? ...

Explain some of the pitfalls to watch out for when working

Explain some of the pitfalls to watch out for when working with flat files.

  • 4,153,160 Questions Asked
  • 13,132 Experts
  • 2,558,936 Questions Answered

Ask Experts for help!!

Looking for Assignment Help?

Start excelling in your Courses, Get help with Assignment

Write us your full requirement for evaluation and you will receive response within 20 minutes turnaround time.

Ask Now Help with Problems, Get a Best Answer

Why might a bank avoid the use of interest rate swaps even

Why might a bank avoid the use of interest rate swaps, even when the institution is exposed to significant interest rate

Describe the difference between zero coupon bonds and

Describe the difference between zero coupon bonds and coupon bonds. Under what conditions will a coupon bond sell at a p

Compute the present value of an annuity of 880 per year

Compute the present value of an annuity of $ 880 per year for 16 years, given a discount rate of 6 percent per annum. As

Compute the present value of an 1150 payment made in ten

Compute the present value of an $1,150 payment made in ten years when the discount rate is 12 percent. (Do not round int

Compute the present value of an annuity of 699 per year

Compute the present value of an annuity of $ 699 per year for 19 years, given a discount rate of 6 percent per annum. As