Answered step by step
Verified Expert Solution
Question
1 Approved Answer
John has a cell phone with a PIN that consists of 4 digits (0-9). Unfortunately John totally forgot his PIN, but at least he can
John has a cell phone with a PIN that consists of 4 digits (0-9). Unfortunately John totally forgot his PIN, but at least he can try PIN numbers as many times as he wants to without blocking the device. He applies the following two strategies]: (31) He tries a valid PIN uniformly at random each hour, till he enters the right one. (32) He keeps track of the unsuccessful attempts, and chooses a PIN uniformly at random from the PIN numbers he has not tried yet. 1. [10 points] Write code that simulates strategies 31 and .92. You may assume that the correct PIN is 2022 in your code. Simulate each strategy 100, 200, 300, ..., 1 000 times, and report for each number of trials the average number of trials, and the standard deviation till John gures out his PIN. Present your empirical ndings in two plots (one per strategy) with error bars, where the :raxis is the number of trials. . Let X1, X2 be the number of trials under strategies 31 and 32 respectively. Com- pute their expectations analytically: i) [5 points] ]E[X1]. ii) [5 points] lE[X2]. . [10 points] Apply Markov's inequality to upper bound the probability lP'(X,- 2 7 000) for i = 1, 2. Does Markov's inequality always provide meaningful bounds
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started