In need of a good riddle...

Page 4 - Seeking answers? Join the AnandTech community: where nearly half-a-million members share solutions and discuss the latest tech.

brikis98

Diamond Member
Jul 5, 2005
7,253
8
0
Originally posted by: ScottSwingleComputers
Originally posted by: Billzie7718
You are at a well. You have an empty jug that can hold eight quarts of water. You also have two empty jars, one holding five quarts, the other holding three quarts.

You need to measure out exactly four quarts. How you do dat?

Wasnt this in a movie? Die Hard 3 maybe?

die hard w/ a vengence, i believe.
 

brikis98

Diamond Member
Jul 5, 2005
7,253
8
0
Originally posted by: blackdogdeek
here is a question i was asked on a telephone interview so i couldn't use any scrap paper.

you have a list of the numbers from 1 to N placed in a random order. one of the numbers is missing.

how can you determine the number in linear time?

if you just add them... and compare that to the sum of the first N integers... which, i think is [n(n+1)]/2... the difference between the two should be your missing number...
 

DaShen

Lifer
Dec 1, 2000
10,710
1
0
Originally posted by: brikis98
EDIT: forgot to mention. i've had MANY of these as interview questions (for software jobs).

Same here. ;)

I ask a lot of these types of questions when I intereview now too. ;)
 

blackdogdeek

Lifer
Mar 14, 2003
14,454
10
81
Originally posted by: brikis98
Originally posted by: blackdogdeek
here is a question i was asked on a telephone interview so i couldn't use any scrap paper.

you have a list of the numbers from 1 to N placed in a random order. one of the numbers is missing.

how can you determine the number in linear time?

if you just add them... and compare that to the sum of the first N integers... which, i think is [n(n+1)]/2... the difference between the two should be your missing number...

correct.
 

DaShen

Lifer
Dec 1, 2000
10,710
1
0
Originally posted by: blackdogdeek
here is a question i was asked on a telephone interview so i couldn't use any scrap paper.

you have a list of the numbers from 1 to N placed in a random order. one of the numbers is missing.

how can you determine the number in linear time?

1 .. N

Summed = N(N+1)/2
Take N(N+1)/2 and subtract the summation of the random order numbers. There is your answer.

**EDIT**
Doh too late. ;)
 

Billzie7718

Senior member
Sep 2, 2005
649
0
0
Originally posted by: brikis98
Originally posted by: ScottSwingleComputers
Originally posted by: Billzie7718
You are at a well. You have an empty jug that can hold eight quarts of water. You also have two empty jars, one holding five quarts, the other holding three quarts.

You need to measure out exactly four quarts. How you do dat?

Wasnt this in a movie? Die Hard 3 maybe?

die hard w/ a vengence, i believe.

Wow ... it was in a movie? I got it out of a logic puzzle book I had when I was a kid.
 

dullard

Elite Member
May 21, 2001
25,055
3,408
126
Originally posted by: DaShen
Where is the father?
If we are to believe the commonly misheld idea that pregnancies are exactly 9 months, then, the father is inside the mother.
 

brikis98

Diamond Member
Jul 5, 2005
7,253
8
0
just remembered a good one... it's very contrived/constrained (as most riddles are), but is pretty good:

you are running a very dangerous nuclear experiment. you are trying out a new form of putty-like control rods that are supposed to be much cheaper and more effective, but they become ineffective after exactly ten minutes in water and must be replaced. you have two types of rods: rod A and rod B. you must toss into the water exactly one of each type of rod, every ten minutes, or the experiment overheats and you have a meltdown. the experiment will run for 100 minutes (so you have 10 of each type of rod), after which the uranium will be depleted and things are safe again.

the problem is that just as you started the experiment, your stupid lab assistant dropped the rods and they all got mixed up on the floor. and unfortunately, they all look alike, smell alike, weigh the same, taste the same and are pretty much indistinguishable! you have 10 minutes before the experiment gets going and you have to put in the first pair of rods to prevent a meltdown... and you have to put in exactly two of each rod every 10 minutes after that... put too few and you die... put too many, and you'll run out later and die... put in only one kind and you die...

what do you do??
 

jimbob200521

Diamond Member
Apr 15, 2005
4,108
29
91
Originally posted by: DaShen
You are in a musky-empty room with no windows save for the man swinging from a noose in the middle of the room. How did the man kill himself?

He put himself in the noose while standing on a block of ice. As the ice melted, it hung him.

 

ThirdEdition

Member
Oct 12, 2006
27
0
0
Take all of the "putty like" rods, mix them together. Assuming that they can be mixed. Then seperate them out into 9 equal parts. Continue throwing 1 in every 10 minutes.
 

Billzie7718

Senior member
Sep 2, 2005
649
0
0
Originally posted by: jimbob200521
Originally posted by: DaShen
You are in a musky-empty room with no windows save for the man swinging from a noose in the middle of the room. How did the man kill himself?

He put himself in the noose while standing on a block of ice. As the ice melted, it hung him.

The terrorists did it and left a block of ice on the floor.
 

DaShen

Lifer
Dec 1, 2000
10,710
1
0
Originally posted by: dullard
Originally posted by: DaShen
Where is the father?
If we are to believe the commonly misheld idea that pregnancies are exactly 9 months, then, the father is inside the mother.

Yup... making the baby ;)
 

brikis98

Diamond Member
Jul 5, 2005
7,253
8
0
Originally posted by: DaShen

Somewhere in a very distant place, there is a very special village. And what's so special? Well, in this village there is a barber. And a very special barber. The barber cuts the hair of EVERYBODY in the village that doesn't cut his own hair.
But who cuts the barber's hair? **Taken from a website, but any programmer should understand this one**
this is a paradox and such barber can't exist because you're implying the following two contradicting things:

1. the barber can't cut his own hair, or he'd be cutting the hair of some1 in the village who cuts his own hair
2. but then, if he doesn't cut his own hair... your statement that "the barber cuts the hair of EVERYBODY that doesn't cut his own hair" is violated.

Originally posted by: DaShen
Given that
* a mother is 21 years older than her child, and
* in 6 years the child will be 5 times younger than the mother,
I ask you: where is the father? (This one is just funny)

Enjoy!!

x = child's current age
y = mom's current age

y = x + 21
y + 6 = 5 * (x + 6) --> y = 5x + 24
5x + 24 = x + 21
4x = -3
x = -3/4

no such child exists.
 

brikis98

Diamond Member
Jul 5, 2005
7,253
8
0
Originally posted by: ThirdEdition
Take all of the "putty like" rods, mix them together. Assuming that they can be mixed. Then seperate them out into 9 equal parts. Continue throwing 1 in every 10 minutes.

very close - if you mix it extremely well that should work.

the slightly more elegant solution i had in mind was that you'd lay all 20 rods out on a table and cut (very precisely) each rod into 10 pieces. so you have 20 piles of 10 pieces each. every 10 minutes, take 1 piece from each of the 20 piles - so you have 20 pieces total - and toss it in.

edited for clarity... yeesh my typing is bad

edit 2: forgot to mention that the original problem was formulated differently:

you are stranded on a desert island and everyday, you need to take two pills to live: pill A and pill B. you have ten of each pill and you know a rescue party will come by after ten days. the problem is that you mixed your pills up and they all look alike, smell alike, taste alike, etc...

although this is less "contrived" than the nuclear example... i find the solution (cutting each pill into 10 equal pieces) totally unrealistic for some1 on a desert island... so, i did my best to make it more reasonable :)
 

dullard

Elite Member
May 21, 2001
25,055
3,408
126
Originally posted by: brikis98

this is a paradox and such barber can't exist because you're implying the following two contradicting things:

1. the barber can't cut his own hair, or he'd be cutting the hair of some1 in the village who cuts his own hair
No one ever stated that the barber doesn't also cut the hair of people who cut their own hair.
x = -3/4

no such child exists.
-3/4 years = 9 months before birth = not really a child, but will later become a child = father is having sex with the mother.
 

brikis98

Diamond Member
Jul 5, 2005
7,253
8
0
Originally posted by: dullard
Originally posted by: brikis98

this is a paradox and such barber can't exist because you're implying the following two contradicting things:

1. the barber can't cut his own hair, or he'd be cutting the hair of some1 in the village who cuts his own hair
No one ever stated that the barber doesn't also cut the hair of people who cut their own hair.
fair enough, after rereading it, you are right. although the typical formulation does imply that he ONLY cuts the hair of those who don't cut their own, so it is usually a paradox. i suppose we could also be picky and say that the problem implies that there are actually two barbers. "... in this village there is a barber. And a very special barber". which would also allow the answer of the very special barber being the one to cut the other barber's hair :)

Originally posted by: dullard
x = -3/4

no such child exists.
-3/4 years = 9 months before birth = not really a child, but will later become a child = father is having sex with the mother.

right, i forgot to answer the actual question... of course, in reality, we all know the father is actually at work and it's the milkman that's... working hard :D
 

weirdichi

Diamond Member
Sep 19, 2001
4,712
2
76
Fill Jug3.
Pour into Jug5.
Fill Jug3.
Pour into Jug5 to top.
You have 1 gallon left.
Put in Jug8.
Fill Jug3.
Pour in Jug8.
 

jimmyjam

Senior member
Mar 4, 2002
645
0
0
Originally posted by: letdown427
Originally posted by: DaShen
There is an island in the middle of a lake or moat. The island is perfectly square the moat is perfectly square and has a distance between the ouside and island of 10 yards.
I am given 2 planks that are 9 feet long. How do I get across?

One plank across a corner, the other from the middle of that to the island. Makes a kinda T shape.


I don't think that's gonna work.

 

blackdogdeek

Lifer
Mar 14, 2003
14,454
10
81
Originally posted by: jimmyjam
Originally posted by: letdown427
Originally posted by: DaShen
There is an island in the middle of a lake or moat. The island is perfectly square the moat is perfectly square and has a distance between the ouside and island of 10 yards.
I am given 2 planks that are 9 feet long. How do I get across?

One plank across a corner, the other from the middle of that to the island. Makes a kinda T shape.


I don't think that's gonna work.

it will but you have to realize what corners they're talking about. one plank crosses from one side of the outer corner to the other side. the other plank extends from one corner of the island toward the corner of the outer square and lands in the middle of the other plank.
 

jimmyjam

Senior member
Mar 4, 2002
645
0
0
Originally posted by: blackdogdeek
Originally posted by: jimmyjam
Originally posted by: letdown427
Originally posted by: DaShen
There is an island in the middle of a lake or moat. The island is perfectly square the moat is perfectly square and has a distance between the ouside and island of 10 yards.
I am given 2 planks that are 9 feet long. How do I get across?

One plank across a corner, the other from the middle of that to the island. Makes a kinda T shape.


I don't think that's gonna work.

it will but you have to realize what corners they're talking about. one plank crosses from one side of the outer corner to the other side. the other plank extends from one corner of the island toward the corner of the outer square and lands in the middle of the other plank.

No, I get the concept, but I still don't think it'll work. The moat is 10 yards(30 feet) and the planks are only 9 feet.

 

DaShen

Lifer
Dec 1, 2000
10,710
1
0
Originally posted by: brikis98
Originally posted by: DaShen

Somewhere in a very distant place, there is a very special village. And what's so special? Well, in this village there is a barber. And a very special barber. The barber cuts the hair of EVERYBODY in the village that doesn't cut his own hair.
But who cuts the barber's hair? **Taken from a website, but any programmer should understand this one**
this is a paradox and such barber can't exist because you're implying the following two contradicting things:

1. the barber can't cut his own hair, or he'd be cutting the hair of some1 in the village who cuts his own hair
2. but then, if he doesn't cut his own hair... your statement that "the barber cuts the hair of EVERYBODY that doesn't cut his own hair" is violated.

Originally posted by: DaShen
Given that
* a mother is 21 years older than her child, and
* in 6 years the child will be 5 times younger than the mother,
I ask you: where is the father? (This one is just funny)

Enjoy!!

x = child's current age
y = mom's current age

y = x + 21
y + 6 = 5 * (x + 6) --> y = 5x + 24
5x + 24 = x + 21
4x = -3
x = -3/4

no such child exists.

-3/4 of a year is 9 months. ;) where is the father? :p
 

DaShen

Lifer
Dec 1, 2000
10,710
1
0
Originally posted by: jimmyjam
Originally posted by: blackdogdeek
Originally posted by: jimmyjam
Originally posted by: letdown427
Originally posted by: DaShen
There is an island in the middle of a lake or moat. The island is perfectly square the moat is perfectly square and has a distance between the ouside and island of 10 yards.
I am given 2 planks that are 9 feet long. How do I get across?

One plank across a corner, the other from the middle of that to the island. Makes a kinda T shape.


I don't think that's gonna work.

it will but you have to realize what corners they're talking about. one plank crosses from one side of the outer corner to the other side. the other plank extends from one corner of the island toward the corner of the outer square and lands in the middle of the other plank.

No, I get the concept, but I still don't think it'll work. The moat is 10 yards(30 feet) and the planks are only 9 feet.

oops hahaha ... ;) wasn't even checking.