1 votes 1 votes There are 20 locks and 20 matching keys. Maximum number of trials required to match all the locks is (a) 190 (b) 210 (c) 400 (d) 40 Mathematical Logic engineering-mathematics + – sh!va asked Jul 30, 2016 sh!va 2.8k views answer comment Share Follow See all 0 reply Please log in or register to add a comment.
Best answer 2 votes 2 votes In the best case: will need N-1 tries.In the worst case:1st lock will need = N-1 tries [i.e. last no. of key not need to compare ]2nd will need= N-2 tries...(N-1)th locks need = So, total tries = N-1+N-2 +N-3 + ..... 1 =∑N−1n=1n∑n=1N−1n = (N−1)N/2(N−1)N/2 so (20 *19)/2= 190 Prashant. answered Jul 30, 2016 • selected Jul 30, 2016 by Prashant. Prashant. comment Share Follow See all 0 reply Please log in or register to add a comment.