Tuesday 23 October 2012

2n digit number

i) Consider a 4 digit number abcd. Will there exist a 'k' such that
abcd = k*ab*cd
If so, find the k and abcd?
ii) Now, consider a 6 digit number abcdef. Will there exist a 'k' such that 
abcdef = k*abc*def
If so, find the k and abcdef?
iii) Using these 2 results, what can you conclude about a existence of a 'k' for a generic 2n digit number?

Maximum and Minimum of array

Find the maximum and minimum of an array of 'n' numbers using only 3n/2 comparisons.

PS: This question was given to us in the DS class.

Saturday 20 October 2012

Color matching in concentric circles

A circle is divided into 8 equal sectors. Half are coloured red and half are coloured
blue. A smaller circle is also divided into 8 equal sectors, half coloured red and half
coloured blue. The smaller circle is placed concentrically on the larger. Prove that
no matter how the red and blue sectors are chosen it is always possible to rotate the
smaller circle so that at least 4 colour matches are obtained.

Saturday 13 October 2012

Monte Hall Variant - 2

Continuing to the previous problem, if each door contain a car with probability 'p'.
What will be your decision to the options listed in previous post?
Also, at what value of 'p' will you change your option?

Wednesday 10 October 2012

Monty Hall Variant

Consider 3 doors A,B,C and each of them can have a car worth Rs 3 lac with 0.5 probability. Now, you chose door A and the show host opened one of the door which contained a car. Now, he has given you 3 offers
Offer 1: You can stick to door A
Offer 2: You can change your door
Offer 3: Take 1,25,000 and leave the game

Which offer would you chose? What is the minimum amount the show host must offer you so that you can take his offer and leave the show?

Assumption: Show host knows everything behind the doors