Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

please give your own solution. A mouse is trying to escape from a maze where it starts moving from the top-left corner (0,0) to the

image text in transcribed

image text in transcribed

please give your own solution.

A mouse is trying to escape from a maze where it starts moving from the top-left corner (0,0) to the exit in the bottom-right corner (6,6). It moves according to the following rules: The mouse has 40% chance to go forward along the same direction. The mouse has 30% chance to turn left and 30% chance to turn right. The initial moving direction is indicated by the pointer. So, if the mouse chooses to go forward, it will reach (1,0) in the next step. The new position must be within the boundaries of the maze. The new position must not have been visited previously. If the new position does not fulfil the criteria above, the mouse will try another move again. Every decision is independent of the others. If the mouse reaches a dead-end - all directions are not enterable, it fails to leave the maze. The mouse continues to move until it reaches the exit. (0,0) DEAD END Exit (6,6) Write a simulation program using the Monte Carlo method to estimate the probability (P) of the mouse successfully escaping from the maze. The simulation should run one million times. Your program should print out the simulation results clearly and round the success rate P to 3 digits after the decimal point as follow: The Monte Carlo simulation result of one million runs: No. of successful escape: 279451 Success Rate P: 0.279 The acceptable range of the success rate is 0.278 - 0.281 and the execution time should be less than 5 seconds

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

SQL Instant Reference

Authors: Gruber, Martin Gruber

2nd Edition

0782125395, 9780782125399

More Books

Students also viewed these Databases questions

Question

Multiply: 3 1 4 * 7 8

Answered: 1 week ago

Question

1 . Television News channels importantance of our Life pattern ?

Answered: 1 week ago

Question

1. How is the newspaper help to our daily life?

Answered: 1 week ago