There are n pancakes of different diameters stacked on top of one another in a single stack. You want to sort the pancakes according to size so that the largest is at the bottom and the shortest is on top. At each step you can insert a spatula at any point between the pancakes and flip all pancakes above the spatula. Give a sorting algorithm … Continue reading the story "Pancake sort"
Monthly Archives for October, 2013
Find the total sum of all digits in all numbers from 1 to 1 million. You are not allowed to use a computer or calculator.
The sum of reciprocals of three positive integers is 1. Find all such triplets of positive integers. - via Russian Math Olympiad
An ant is constrained to move along the walls, ceiling or floor (it cannot fly) of a cubical room. It starts in the middle of an edge of the cube. What is the distance of farthest point from the ant on the surface of the room (walls, floor, ceiling)? - via Stack Exchange
Four coins are placed in 4 holes on the 4 edges of a square table. Each coin maybe either heads or tails. At any time, you are allowed to inspect two coins and replace each of them either heads up or tails up as per your choice. The coins are hidden in holes; there is no way of knowing whether a coin is heads or … Continue reading the story "Coin game"
You want to rob a house, but to establish an alibi, you want to make sure the burglar alarm goes off 2 hours after you rob the home. You are skilled enough to be able to steal without setting off the alarm. How can you arrange to have the alarm go on 2 hours after you are done robbing? via Briangle
There are 4 coins in a row. Each coin shows either heads or tails. You don't know in advance what each coin shows. You are blindfolded. Your goal is to make all coins face heads upwards. To achieve this, you keep flipping coins one at a time. If at any point of time all coins are heads, a machine beeps and you win. You want … Continue reading the story "Flip coins"
Let and be independent uniform random integers from 1 to n. Let denote the probability that and are relatively prime to each other, i.e. g.c.d. What is - Via Sid Hollander
A 25 year old man was travelling with his father in a train. He saw a tree and remarked, "A tree! Look father, a tree!" Then he saw a road and remarked, "A road! Look father, a road!" Then he saw a road and remarked, "A car! Look father, a car!" Can you give a good explanation why he was behaving like a child? He was not mad. - … Continue reading the story "A feasible explanation?"