Posts

Red vs Black cards - Expected payoff

This is a variation of the problem discussed some time back:  Don't roll More . Just published the solution to the earlier problem . Thought it would be interesting to solve this problem taken once again from the book "Heard on The Street". Problem:  You have 52 playing cards (26 black and 26 red). You draw cards one by one. A red card pays you a dollar. A black card costs you a dollar. You can stop any point you want. Cards are not returned to the deck after being drawn. What is the optimal stopping rule in terms of maximizing expected payoff? Also, what is the expected payoff following the optimal rule? Hint: Try the problem with 4 cards (2 red, 2 black) :) Update(29/01/10): Question was incomplete. Added more information. Solution: (Update (05/02/10)) Idea posted by Aman in comments!! Solution posted by me in comments!! The problem/solution is very difficult and not so beautiful. Its not very mathematical though. Do this only if you have time and you...

Three NOT Gates from Two NOT Gates

Problem: Design a 3-input 3-output logic circuit that negates the 3 signals. You have an infinite supply of AND and OR gates but only two NOT gates I have read and solved many problems like these. Can people post some similar interesting problems using gates. I was asked one such question in my Deutsche Bank Interview which I was not able to answer. Update(09/02/10): Solution: Solution posted by Sid in comments!! Update(23/06/14): Solution: Interesting link shared by divby0 in comments!

Hungry Lion

Source: Puzzle Toad, CMU Problem: A hungry lion runs inside a circus arena which is a circle of radius 10 meters. Running in broken lines (i.e. along a piecewise linear trajectory), the lion covers 30 kilometers. Prove that the sum of all turning angles is at least 2998 radians. Update(05/02/10): Solution: Solution posted by me in comments!!

IBM Ponder This January 2010 Puzzle

I solved IBM Ponder This October 2009 Challenge and IBM Ponder This November 2009 Challenge and now solved this very interesting puzzle at IBM Ponder This January 2010 Challenge I am happy!! My name on IBM's research site three times in 4 months. :) Problem: Present a computation whose result is 5, being a composition of commonly used mathematical functions and field operators (anything from simple addition to hyperbolic arc-tangent functions will do), but using only two constants, both of them 2. It is too easy to do it using round, floor, or ceiling functions, so we do not allow them. Source: IBM Ponder This January 2010 Challenge Solution: IBM guys would post it on their site by February 2010 :) Three different solutions given by Piyush (Fourth year, IITM), Aniesh Chawla (Fourth year, IITD) and me (Fourth year, IITB) :). All posted in comments!! Thanx to Anirudh Shekhawat urf Maoo (CSE, IITB & Google) for help in the last step :)

Math Olympiad Problems

Some basic math olympiad problems: Divisible by 289? For how many integers x, x^2 - 3x - 19 is divisible by 289? Perfect square? For how many positive integral values of n, the expression n(4n + 1) is a perfect square? Update (23/01/10)(05/02/10): Solution: Posted by Aaditya Ramdas (CSE IITB Alumnus & Tower Research), Piyush Sao (Senior Undergrad, EE, IITM) and Nikhil Garg (Sophomore, IITD) in comments!!  Thanx.

Brave Warrior

Source: Insight (IITB Newsletter) Questech Problem : In a land far away, there is a village threatened by an hundred-headed beast. This beast can only be killed by cutting of all the hundred heads. Legend says that any brave warrior can cut off exactly 10, 20, 30 or 40 heads at one time. However with each of these, 40, 2, 60 and 4 new heads appear respectively. The village has lost several brave warriors against this beast. Can you save the village from this beast ? Update(21/01/10): Solution: Solution provided by Bhanu Prakash (M.Tech Student, CSE, IITB) in comments!!

Bottom Dollar

Source: +Plus Magazine Problem: You're in a glitzy casino in Las Vegas. Having tried your hand at everything from Roulette to Black Jack, you've managed to lose most of your money and have only one dollar left. What's worse, with all the champagne and everything, you've misbehaved and the management has made it very clear that you're not allowed any more games. But you need two dollars to get the bus back to the hotel. Two shady-looking characters at the bar offer you a game: they have a pile of 15 stones. Each of you in turn is to take your choice of 1, 2, 3, 4 or 5 stones from the pile. The person who takes the last stone gets one dollar from the person who drew previously, and the third person neither wins nor loses. You're to draw first. You're sure that both of the other players will play to their best personal advantage and won't make any mistakes. Should you agree to play the game? Update(23/01/10): Solution: Posted by Gir...