Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

We wish to do an experiment to determine if ants search for food using a random search or directed search method. To help design the

We wish to do an experiment to determine if ants search for food using a random search or directed search method. To help design the
experiment we first will run some simulations. In the experiment, ants are placed inside a 50mm50mm box. They cannot climb the wall,
but can escape through an opening of size 10mm in the wall. Repeated measurements of how far an ant travels in 1 second show an
average speed of 2mm per second. Our simulation needs to determine the probability that an ant escapes the box in 600 seconds (hint: so
your main iteration would look like for t in range (600) if their motion is indeed random. Assume the ant is always initially placed in
the center of the box and simulate a simple random walk in 2D on discrete time in this fashion: Have the ant live on a discrete lattice. The
ant takes 2mm to the left if a random number u satisfies u0.25. The ant moves 2mm to the right if 0.25u0.5, the ant moves 2
mm up if 0.5u0.75, and 2mm down if 0.75u1.0.u is distributed uniformly between 0 and 1(hint: use
np. random. uniform ( low=0, high=1) to generate it). If a step would take the ant into a wall, repeat the step until it is successful
(result is still one time-step). With attempts =np. linspace (10,1000,19), run your main iteration under the loop for M in
attempts: and construct a dataframe with columns for number of attempts (i.e. M), number of escapes, and probability of escape for
every M. Your dataframe would eventually look something like this with 19 rows and real values:
image text in transcribed

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

More Books

Students also viewed these Databases questions