Suppose you are specified n open sets (x1,y1), (x2,y2),....(xn,yn). You wish to find the union of these sets and express it as a union of disjoint open sets. How do you accomplish this task algorithmically? - A potential interview question
Monthly Archives for November, 2013
Here are three situations. In each situation you have extra information that you can leverage to make money. If you divulge that information, you lose the opportunity to make money. The question is whether it is ethical to not divulge information. 1. You go to a business trip with a colleague from a company. The company funds your travel and hotel stay. You decide to save … Continue reading the story "An ethical dilemma"
A physicist asked his 6 year old son to imagine standing on top of a big ball in outer space. Then, he told his son, he looks over the edge, and there is a person on the other side of the ball, upside down, with feet on the bottom of the ball. He asked his son: will that upside-down person fall off the ball? His … Continue reading the story "A smart child"
Suppose I have a function rand3() that generates a number uniformly at random amongst 0,1,2. I like to be able to write a function rand10() that generates a number uniformly at random amongst 0,1,...9. One way is to generate rand3() 3 times and compute z=9*rand3()+3*rand3()+rand3(). Then z is uniformly distributed from 0,1,...26. If z<=19, I return z%10, otherwise I repeat the process. However, if you … Continue reading the story "Generating random numbers"
In the figure below count the number of triangles. - via Best Brain Teasers
Assume that every time a husband and his wife interact, they like their interaction only if it's quality is better than the quality of all the previous interactions. Also assume that the quality of each interaction is independent and identically distributed. Show that if a husband and wife have n interactions, they will only like O(log n) interactions on an average. This explains why they … Continue reading the story "Why do husbands and wives not like each other over time?"
Given the perimeter and the 2 base angles of a triangle, construct it using a compass, ruler and protractor. - via Quora
John had some money in his wallet. He spent half the money. After spending, he had as much cents as he had dollars and half as many dollars as he had cents. How much money did he start with? - Via Gpuzzles
How do you place 5 points in a unit square so as to maximize the minimum distance between the points? - via Tom Courtade