Do the question below in any programming language, preferably Python/C++
₹600-1500 INR
Σε Εξέλιξη
Αναρτήθηκε περίπου 5 χρόνια πριν
₹600-1500 INR
Πληρωμή κατά την παράδοση
A circular road has N positions labeled 0 through N−1 where adjacent positions are connected to each other and position N−1 is connected to 0. M cars start at position 0 through M−1 (inclusive). A car can make a valid move by moving forward one position (or goes from N-1 to 0) if the position it is moving into is empty. At each turn, only consider cars that have a valid move available and make one of the valid moves that you choose randomly with equal probability. After T rounds, we compute the average (A) and standard deviation (S) of the position of the cars.
What is the expected value of A when N=10, M=5, and T=20?
What is the expected value of S when N=10, M=5, and T=20?
I am a competitive programming participant
I have plenty of experience working with programs that need to run fast and have a defined input, (in this case N, M and T, each time you run the program you define its values).
I can do it in Python or C++, whichever language you prefer, I deliver the program with comments so that you can tell what's going on in every part of the code
This is my GitHub
[login to view URL]
A proof that I am used to solving problems like yours
[login to view URL]
[login to view URL]
[login to view URL]
[login to view URL]