1 votes 1 votes A man with n keys wants to open a lock. He tries his keys at random. The expected number of attempts for his success is (keys are replaced after every attempt) a) n/2 b) n c) √ n d) None of the above Probability isro-ece engineering-mathematics expectation + – sh!va asked Mar 1, 2017 • retagged Mar 9, 2019 by Naveen Kumar 3 sh!va 2.4k views answer comment Share Follow See all 21 Comments See all 21 21 Comments reply Rahul Jain25 commented Mar 1, 2017 reply Follow Share I took small example of four key and my approach is 1(1/4) + 2( 3/4 ×1/3)+3(3/4 × 2/3 × 1/2) + 4 (3/4 × 2/3 ×1/2 × 1) = 1/4 ( 1+2+3+4)= 4×5/(4×2) = 5/2 So I think answer should be (n+1)/2 and so none of these. 0 votes 0 votes Akriti sood commented Mar 1, 2017 reply Follow Share what i think is - for one attempt ,probability is 1/n for second attempt,probablity is (1-1/n) * 1/n for third attempt prob is (1-1/n)2 * 1/n and so on.. so,expectation is E[x] = 1* 1/n + 2 ( (1-1/n) * 1/n) + 3* (1-1/n)2 * 1/n +.... multiplying by (1-1/n) = 1/n [ (1-1/n) + 2 * (1-1/n)2 + 3* (1-1/n)3 + ...] subtracting above two we get ,E[x] - (1-1/n) E[x] = 1/n * (1/1-(1-1/n)) 1/n E[x] =1 so,E[X] =n 1 votes 1 votes Rahul Jain25 commented Mar 1, 2017 reply Follow Share Expectation can be thought as mean or average. So supoose you have n keys then I dont think on average we need n trials. On average answer will be (n+1)/2. Also try 4 keys example and accordingly I think n+1/2 should be answer. 0 votes 0 votes Akriti sood commented Mar 1, 2017 reply Follow Share @rahul,it is given that keys are replaced after every attempt,so why are u taking probabilitie as relative. as you are showing that for second attempt,first attempt fauilure is 3/4 but how success for second attempt is 1/3??as after fauilure of first key,it will be replaced in the lot.,so it should be 1/4 only correct me if i am wrong pls 0 votes 0 votes Rahul Jain25 commented Mar 1, 2017 reply Follow Share Also keys are replaced affter attempts. So (1-1/n) and then 1/n is inappropriate 0 votes 0 votes Rahul Jain25 commented Mar 1, 2017 reply Follow Share Lets say i have A,B,C,D and C is my key to open lock. Now for succes on two attempts I can select A,B,D hence 3/4 after that attempt I have only 3 keys remaining and for succes on two attempts in this attempt I have to select C which gives 1/3. 0 votes 0 votes Akriti sood commented Mar 1, 2017 reply Follow Share as keys are always replaced ,so sample space will always be n..is'nt it so?? if it would have been without replacement then only,sample space starts decreasing by 1 0 votes 0 votes Rahul Jain25 commented Mar 1, 2017 reply Follow Share Okay I got what you intend to say. But I think "replace" should not be used here otherwise it is possible that we go to infinte series and we may never get success. 0 votes 0 votes Akriti sood commented Mar 1, 2017 reply Follow Share for your A.B.C.D example... in first attempt,you can choose btw A,B AND D,hence 3/4.suppose ,you choose A.it is given in question that key is replaced,hence again,A will be added to the set of keys and now,from A,B,C,D ,we will choose C,so prob of success at second attempt is 1/4 0 votes 0 votes Akriti sood commented Mar 1, 2017 reply Follow Share yes..i am only gng by question's statement 0 votes 0 votes Rahul Jain25 commented Mar 1, 2017 reply Follow Share Okay actually i have misinterpreted the question. You are correct. B is the correct answer I also verified it and question is also correct. 0 votes 0 votes Rahul Jain25 commented Mar 1, 2017 reply Follow Share We can also use arithmetico geometric series formula for easy evaluation. 0 votes 0 votes Akriti sood commented Mar 1, 2017 reply Follow Share thanks for confirming :) 0 votes 0 votes Akriti sood commented Mar 1, 2017 reply Follow Share i dun know any such formula..nt good at these formulas..again if u have a good link then pls share :P 0 votes 0 votes Rahul Jain25 commented Mar 1, 2017 reply Follow Share It is good if you can solve without formula so that exam time you don't need to mug them up.☺ This formula is quite handy https://en.m.wikipedia.org/wiki/Arithmetico-geometric_sequence 0 votes 0 votes Kaluti commented Mar 1, 2017 reply Follow Share Answer is n only 0 votes 0 votes sushmita commented Mar 3, 2017 reply Follow Share by arithmetico geometric series answer is coming n and i think we can directly use geometric distribution with probablity p=1/n and hence number of attempts= 1/p=n. 0 votes 0 votes Rahul Jain25 commented Mar 3, 2017 reply Follow Share @sushmita how to identify it there is geometric distibution??? 0 votes 0 votes sushmita commented Mar 3, 2017 reply Follow Share here we are asked number of trials and whenever no of trails are asked it is geometric distribution. 0 votes 0 votes Rahul Jain25 commented Mar 3, 2017 reply Follow Share Thanks @sushmita. https://en.wikipedia.org/wiki/Geometric_distribution?wprov=sfla1 0 votes 0 votes Akriti sood commented Mar 3, 2017 reply Follow Share @sushmita,is it true in every case?? 0 votes 0 votes Please log in or register to add a comment.