- Prove Fn ≤ Φn-1 Where Fn is Fibonacci sequence & Φ is (1+√5)/2. Solution
- Prove that Log102 is irrational. Solution
- Consider a function which, for a given whole number n, returns the number of ones required when writing out all numbers between 0 and n. For example, f (13) = 6. Notice that f(1) = 1. What is the next largest n such that f (n) = n? Solution
- There are 2 cities A and B, dist. between them is 1000 Km
we have 3000 bananas in city A and a elephant
can carry max 1000 bananas at any given time and it needs to eat a banana every 1 Km.
How Many Max. No. of bananas u can transfer to city B??? Solution
- Given a sorted list of N integers and a target integer K, determine in O(N) time whether there are any two that sum to exactly K. Solution
- There are 100 doors.They are all closed to start with. Now someone starts to call out number, when he calls a number, the doors numbered multiple of that number will switch state.
Then he calls out 1,2, 3, 4, 5 and so on, till 100.All doors numbered multiples of 1 will switch state, (in this case, all doors will open). Then he calls out 2, all doors numbered multiples of 2 will switch state, (all even doors will close). Then he calls out 3, 4, 5 and so on, till 100. Question: At the end, how many doors are open and how many doors are closed? solution
- The closest pair of points problem or closest pair problem is a problem of computational geometry: given n points in the d-dimensional metric space, find a pair of points with the smallest distance between them. Solution
- Suppose you have a CAN of some white beans and some black beans and there is a big vessel containing black beans only.
You have to pick up two beans randomly from the CAN.
If the beans are of same color then throw both of them and add one black bean from vessel to CAN.If beans are of different color, put white bean again in CAN and throw just black one.
1)Prove that this process terminates so that there will be only one bean left.
2)For which values of number of white/black beans, there is only white bean left in the CAN at the end of process? Solution