1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
Norma-Jean [14]
2 years ago
8

Random Walker Collisions In lecture, we saw how to model the behavior of a random walker on a 2D grid using a Monte Carlo simula

tion. In this problem, we will investigate collisions between two of these random walkers. Specifically, use your simulation to track the distances of the two walkers until they collide. 1. Start by writing a MATLAB script to simulate the path that the single random walker A takes on an 11 x 11 grid of tiles. Let this random walker use a random compass as shown in class. Thus, the probability p of moving in the North, East, South, and West directions is given by 0.2. The remaining probability is the one used to stay put. If the random walker tries to move "past" one of the boundaries on its turn, his position does not change (you can think of this as a particle bumping into a wall and staying still). Choose a random tile to let the random walker A start his walk. Lastly, write a function to update the position of the random walker A. The function must use exactly the function header shown below, i.e. the function name and number and ordering of inputs and outputs must be followed exactly. function (x,y) = Randwalk_2D (x0, y0, BC) Here, x0 and y0 are the initial positions of the random walker, BC is the array of boundary conditions, and x and y are the updated positions of the random walker. 2. Add the random walker B to your simulation who moves according to its own randomly generated values using the same compass as the random walker A in Part 1. Let the random walker B start his walk on the tile that is furthest away from the start tile of walker A. At each iteration, both walkers move simultaneously to an adjacent tile using the rules outlined in Part 1. Continue updating the position of both walkers until a collision occurs (or until the maximum number of iterations, which is set to 1000, is reached). More precisely, a collision occurs when both random walkers occupy the same tile after both have completed their move. Furthermore, a collision occurs when both random walkers are next to each other and move to the other one's tile. Note that in this instance, the collision appears on their way, but both random walkers will end up on tiles that are again next to each other. In other words, collision also appears when their paths cross. 3. Track the movement of each random walker by storing their positions in four 1D-arrays associated with their x- and y-positions in the grid. After the simulation, calculate for each iteration the distance between the random walkers A and B, and plot the results vs. the number of iterations to see when the two random walkers A and B came close to each other and when they were far away from each other.
Computers and Technology
1 answer:
vlabodo [156]2 years ago
6 0

Answer:

dang how long did i take for you to wright all this and that lecture was cool

Explanation:

You might be interested in
What provides access to the internet?
Sphinxa [80]
A router!
12345678901234567890
6 0
3 years ago
Frank has created a résumé and separated the sections using headings. How can he set the headings apart from normal text?
Pepsi [2]
He could use bold or bigger text just a suggestion.
6 0
2 years ago
A software EULA is an agreement related to which of the following?
densk [106]

A software EULA is an agreement related to the terms of use of the software

the terms of use of the software

<u>Explanation:</u>

EULA stands for End User License Agreement. It can be defined as an agreement related to the terms of use of the software. EULA provides the user with all the details and any restrictions that have been imposed on the application by the developer.

In order to use the software, the user has to agree with all the terms and conditions specified in the EULA. The most common restriction imposed on an application/software is that it shouldn't be shared with anyone, in proprietary software.

7 0
3 years ago
Read 2 more answers
1. Write a function that will ask the user to enter a value in dollars. The function should calculate and display the equivalent
julia-pushkina [17]

Answer:

import java.util.Scanner;

public class Main

{

public static void main(String[] args) {

   

    valueInDollars();

}

   public static void valueInDollars() {

       double currentMoney, quarters, dimes, nickels, pennies;

       Scanner input = new Scanner(System.in);

       

       System.out.print("Enter a value in dollars: ");

       currentMoney = input.nextDouble();

       currentMoney *= 100;

       quarters = (int)currentMoney / 25;

       currentMoney = currentMoney % 25;

       

       dimes = (int)currentMoney / 10;

       currentMoney = currentMoney % 10;

       

       nickels = (int)currentMoney / 5;

       currentMoney = currentMoney % 5;

       

       pennies = currentMoney;

       

       System.out.print("Quarters: " + quarters + "\n" + "Dimes: " + dimes + "\n" + "Nickels: " + nickels + "\n" + "Pennies: " + pennies);

   }

}

Explanation:

<u>Inside the function:</u>

- Declare the variables

- Ask the user for a value in dollars

- Multiply that value by 100

- Find the amount of quarters, dimes, nickels, and pennies

- Print the values

<u>Inside the main:</u>

- Call the function

3 0
3 years ago
Which design element involves the act of lining up objects vertically or horizontally to give a sense of order?
Nadya [2.5K]

Answer:

HHJJTFCS

Explanation:

8 0
2 years ago
Other questions:
  • In today's society, unethical actions are: A) Easier than ever to get away with, because the general public and insurers are les
    13·2 answers
  • Explain the term remote backup with examples.​
    5·1 answer
  • Help me match these answers
    5·1 answer
  • "The ____________________ function is a logical function that returns a TRUE value if any of the logical conditions are true and
    14·1 answer
  • George wants to pursue a career in web technology as a web developer. Which certifications can help him as a web developer?
    5·1 answer
  • Raul in Colombia can enter data into a spreadsheet. Olivia in England can access the spreadsheet a few minutes later and use Rau
    7·1 answer
  • Erik is the president and owner of Watch Out, a local website development company that helps clients create and build unique web
    15·1 answer
  • What is the correct order of the phases of the software development process?
    14·1 answer
  • Write a program that:
    13·1 answer
  • To optimize the flow of data into and out of the cpu, the modern mcc provides at least _______________ of data every time the cp
    5·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!