Question: write code for the following Explanation 0 From the input, we see that we are interested in points that end up in the rectangle (parallel
write code for the following

Explanation 0 From the input, we see that we are interested in points that end up in the rectangle (parallel to the axes) wah (0. 1) at it lower left and (2. 2) at its upper right. There are 4 particles in tocal and their searting positions as well as their update vectors are set out in the table below. Also indicased is the position of the point after each of the 5 steps. To explain further, let us deseribe how we obtained the position of particle 2 after a single step: Particle 2 is evolved with the updated vector (21,21) and is initially located at the point (5,12). According to the update rule, atter 1 step, it will be located an (21(5)21(12),21(5)+21(12))=(2512,2512)=(27,217) All the other steps were performed in the same way (using the appropriate vectors and points. of course). Examining the coordinates of the particles atter the 5 th step, we see that Particle 1 and Particle 3 are the only ones within the bounding rectangle of interest, so we return 2 as cur
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
