Jump to content
NEurope
Supergrunch

Logic/maths puzzles

Recommended Posts

So, I'm feeling vaguely sleepless and have decided to make this thread as a counterpart to the riddles thread - here, people can post problems that have absolute unarguable solutions, requiring deduction to solve. As a general rule, it's probably a good idea to keep to problems that don't require any advanced knowledge, and that are in some way fun or interesting (subjective of course, but you know what I mean :heh:), rather than just being brute computation or whatever. I'll start things going with one of my favourite problems, that looks a lot more mathematical than it actually is:

 

There is a rod of length L attached to a wall with n ants (a1, a2, ... an) unevenly distributed along it, with the first ant sitting at the far end of the rod, away from the wall. The distance from the first ant to the second is x1, from the second the the third x2, and so on. All ants walk at speed v, and when they collide, they turn around instantly and carry on in the other direction at the same speed (what's known as a perfect elastic collision). The prime numbered ants start off facing away from the wall, and the non-prime ants (including the first) face towards it. When an ant reaches the end of the rod it falls off. Some of this information is shown in the diagram below (red indicates initial direction):

 

ants.jpg

 

How long before all the ants fall off the rod?

 

The solution to this problem is both awesome and far easier than it looks, requiring no knowledge of advanced maths whatsoever. It's not a trick question - this thread isn't about trick questions, it's about clever solutions. Similarly, saying the ants decide to crawl somewhere else or whatever is not a valid approach - as far as this problem is concerned, the rod forms a one-dimensional system and the ants behave exactly as stated. There is enough information given here to work out a genuine answer.

 

I'll see how this goes, anyway. If people don't like this particular problem I might try something that sounds less mathsy.

Edited by Supergrunch

Share this post


Link to post
Share on other sites

There is a rod of length L attached to a wall with n ants (a1, a2, ... an) unevenly distributed along it, with the first ant sitting at the far end of the rod, away from the wall.

 

I assume that was a typo. If not, this just became a trick question :heh:

 

As for the problem at hand... If it's a simple solution, the answer is usually 0 or "infinity", but that can't be the case here.

 

I'll think about this a bit more...

Share this post


Link to post
Share on other sites
don't require any advanced knowledge, and that are in some way fun or interesting
There is a rod of length L attached to a wall with n ants (a1, a2, ... an)

 

princeWTF.gif

 

 

Tbf, Maths is the antithesis of all I believe in, so I can't really judge.

Share this post


Link to post
Share on other sites

Tbf, Maths is the antithesis of all I believe in, so I can't really judge.

 

TBH, both of those concepts are really easy to understand:

 

A rod of length L, means that it can be a rod of any length you like (obviously greater than nothing though). A completely general rod, which we're going to call L, for the sake of not having to repeat "the length of the rod" every time we use it in the problem.

 

If the length is generalised like this, often there will be a solution which doesn't depend on the length, or will have a linear relationship to the length (ie. addition/multiplication and their inverses only - TBF that concept involves insight into analytical maths to understand, but isn't essential to working out the problem, so you deal).

 

Basically, the length of the rod doesn't matter, it could be 1000 miles, or 10 cm long - the relationship (in the form of an equation - probably) that we'll get relating the time for all the ants to fall off, T, and the length, L, will work for any length of the rod.

 

 

 

The concept of there being n ants, means that there can be as many ants as you like. There could be 2, there could be 201297 ants. Referring to the number as n makes the problem completely general (similar to the length situation above)

 

The ants being referred to as a1, a2, a3 ... an is just a way to signify which ant you are talking about, instead of saying "the 10th ant" which takes ages to write*, we say a10 (obviously with the 10 as a subscript, but I can't be bothered working out how to do that).

 

 

*(especially in a recurrence relation, which this problem could possibly boil down to [but then not, because that involves outside knowledge])

 

 

 

 

Basically, the question is a whole lot of jargon, and its essentially asking:

 

"Ants are on a rod sticking out a wall. There are alot of them, and we can't be bothered to count them. We'll just say there are n. We can't be bothered to measure the rod, so we'll say its L long.

 

They are positioned randomly along this washing line, and they all walk at the same speed. When they bump into each other, they both instantly turn around and walk the opposite direction. The 2nd, 3rd, 5th, 7th, 11th, 13th, 17th ants from the end are walking the opposite direction from the other ants. In fact, all the ants (strangely) which are a prime number away of ants from the edge of the rod is walking the opposite direction. (A prime number is a number that cannot be divided by anything but itself and 1. All the kinda "strange" numbers, like 31 and 23 and 11.)

 

How long does it take for all the ants to fall off the rod?"

Share this post


Link to post
Share on other sites
I assume that was a typo. If not, this just became a trick question :heh:

All I mean is that the first ant is as far down the rod as it can possibly be, so there's a length of L between the ant and the wall. It's of course facing the wall, as indicated in the diagram, sorry if that was misleading. And in case anyone is confused, we're treating the ants as points, so their dimensions don't come into it.

Are we supposed to answer with an equation?

Yep, in terms of the variables I gave - I can substitute them for real numbers if you want but it doesn't change the problem, and the answer is very simple either way, so there's no need to worry about complex expressions.

 

And thanks for explaining my formulation Chair - I'm too used to giving these types of problems to mathsy people, so I actually now find mathematical notation easier to handle. But it's the problem rather than the notation that's important.

 

I'll give one clue, as I was a little cruel last night - the prime numbers are a red herring, and won't help you solve the problem. Sorry if you think that makes it a trick question, but it just makes things more fun, and isn't a trick in the sense of xkcd 169.

 

Oh, and as Chair implied, n is greater than or equal to 1 (i.e. there is at least one ant), and L > 0 (the rod isn't of zero length).

Edited by Supergrunch

Share this post


Link to post
Share on other sites
All I mean is that the first ant is as far down the rod as it can possibly be, so there's a length of L between the ant and the wall. It's of course facing the wall, as indicated in the diagram, sorry if that was misleading. And in case anyone is confused, we're treating the ants as points, so their dimensions don't come into it.

 

Actually, I read that as "the first ant has its back turned to the wall". Which would mean it would immediatly fall, and contradict the whole "directions" thing.

 

Anyway, I'd like to go with the option of

 

"The time taken for all of them to fall off is the same it takes for a single ant to go through 2L (the whole rod twice) at v speed. Therefore, T=2L/v"

 

 

However, it is just a simple guess, and not nearly as awesome/clever as you made it sound :heh:

Share this post


Link to post
Share on other sites
"The time taken for all of them to fall off is the same it takes for a single ant to go through 2L (the whole rod twice) at v speed. Therefore, T=2L/v"

 

 

However, it is just a simple guess, and not nearly as awesome/clever as you made it sound :heh:

The time taken for an ant to walk 2L at speed v would just be 2Lv, not 2L/v (speed = distance x time).

Which is the correct answer! But why? That's where the awesome bit comes in, and without an explanation, you haven't solved anything.

 

 

What happens if an is a non prime number and reaches the wall?

It turns round instantly and carries on, just as if it hit another ant - again should have pointed that out. And note that even if n is prime, it could still hit another ant then turn round and hit the wall.

Share this post


Link to post
Share on other sites
The time taken for an ant to walk 2L at speed v would just be 2Lv, not 2L/v (speed = distance x time).
Which is the correct answer! But why? That's where the awesome bit comes in, and without an explanation, you haven't solved anything.

 

 

 

First of all, I'm pretty sure that Speed=Distance/Time (as in Meters per Second = m/s).

If it was Distance x Time, then the answer would be Time=v/2L. And for the Time to be 2Lv, the equation would be Speed=Time/Distance.

 

Second, I admit that all I know is that:

A- The first ant triggers everything;

B- The path that the rightmost ant follows defines the time

 

I'll think about this better.

 

 

Share this post


Link to post
Share on other sites

I KNOW THE ANSWER!!

 

... But that's only because grunch told it to me a few months ago... It is both clever, simple and awesome :)

Share this post


Link to post
Share on other sites

The first ant starts its path from left to right. When it collides with someone, that second ant will continue the previous ant's path until it collides with a third ant. That ant will continue the previous path and the cycle continues until it reaches the final ant. That ant will onlymeet the wall, will turn back and will walk the whole path.

 

To simplify matters, let's picture the first ant with the olympic torch. By passing the torch to the first ant it meets, and if subsequent ants do the same, the torch will go through all the ants until it reaches the final one. That final ant will hit the wall (thus completing "the first trip") who will bring the torch all the way back ("the second trip").

This means that the time passed is equal to the speed of the torch going through the rod twice, at the speed of an ant.

 

 

You're right, it is pretty cool :smile:

Share this post


Link to post
Share on other sites
First of all, I'm pretty sure that Speed=Distance/Time (as in Meters per Second = m/s).

If it was Distance x Time, then the answer would be Time=v/2L. And for the Time to be 2Lv, the equation would be Speed=Time/Distance.

Oh yeah sorry, I was being stupid.

The first ant starts its path from left to right. When it collides with someone, that second ant will continue the previous ant's path until it collides with a third ant. That ant will continue the previous path and the cycle continues until it reaches the final ant. That ant will onlymeet the wall, will turn back and will walk the whole path.

 

To simplify matters, let's picture the first ant with the olympic torch. By passing the torch to the first ant it meets, and if subsequent ants do the same, the torch will go through all the ants until it reaches the final one. That final ant will hit the wall (thus completing "the first trip") who will bring the torch all the way back ("the second trip").

This means that the time passed is equal to the speed of the torch going through the rod twice, at the speed of an ant.

Exactly!

Another (pretty similar) way of looking at things: the labels given to the ants don't matter, as they might as well swap them over when they collide, meaning they effectively walk through each other.

 

 

 

You're right, it is pretty cool :smile:

Share this post


Link to post
Share on other sites

That's way simpler than I was expecting. I know you said it was simple but I thought you might me simple to you.

Share this post


Link to post
Share on other sites

That's actually amazingly awesome. I was concentrating far too much on working out the path of the ant nearest to the wall.

Love little maths/logic puzzles like this. Like the 3 doors quiz show one if anybody knows that.

Share this post


Link to post
Share on other sites

That was a pretty cool wee puzzle. Here's another pretty simple one in the guise of something more complicated. Take a word, like say analysis.

 

A

N N

A A A

L L L L

Y Y Y Y Y

S S S S S S

I. I. I. I. I. I. I

S S S S S S S S

 

How many different ways are there of spelling this word starting at the top A and working your way to the bottom one letter at a time, for example like so:

 

A

/

N N

\

A A A

/

L L L L

/

Y Y Y Y Y

/

S S S S S S

\

I. I. I. I. I. I. I

\

S S S S S S S S

Share this post


Link to post
Share on other sites
That was a pretty cool wee puzzle. Here's another pretty simple one in the guise of something more complicated. Take a word, like say analysis.

 

A

N N

A A A

L L L L

Y Y Y Y Y

S S S S S S

I. I. I. I. I. I. I

S S S S S S S S

 

How many different ways are there of spelling this word starting at the top A and working your way to the bottom one letter at a time, for example like so:

 

A

/

N N

\

A A A

/

L L L L

/

Y Y Y Y Y

/

S S S S S S

\

I. I. I. I. I. I. I

\

S S S S S S S S

40,320 ways?

 

Share this post


Link to post
Share on other sites
A puzzle innit.

 

Hmmm my trick question sensor is on full alert... How many different ways of spelling the word are there? - One.

 

Share this post


Link to post
Share on other sites

I'd like to say Danny's answer is correct...

 

Those periods after the Is leave me suspicious. What's up with that?

 

Share this post


Link to post
Share on other sites

Moogle and Danny are presumably guessing the solution is n!, which is provably not the case - just look at line 3, where 3! gives 6 ways but there are only 4. In fact, I'm pretty sure the solution is just

2^(n-1), making the answer for analysis 128. The fact that the paths seem to cross over at some nodes just confuses things, and if we view each path on its own, it becomes clear that adding another letter doubles the total number of paths, giving the above formula.

 

Edit: This hastily photoshopped diagram shows you the difference between the 2 ways of looking at things, with the way on the right making the answer clear:

 

analtree.jpg

 

Yes, I am aware the file name is "analtree.jpg" :heh:

 

Edited by Supergrunch

Share this post


Link to post
Share on other sites
I'd like to say Danny's answer is correct...

 

Those periods after the Is leave me suspicious. What's up with that?

 

I wondered about that too. The answer is either 1 or 2 I think. Either way, trick question!

 

 

Here's one of my faves in case nobody has heard it...

 

You're on a quiz show. There are 3 doors. Behind 1 of the doors is a car. Behind the other two there is nothing. You randomly pick one of the doors. The host then opens one of the other empty doors. You are now given the option to stick with your choice or swap to the only other remaining door. Which is the best thing to do and why?

 

Quite a popular one so please don't spoil if you already know it!

Edited by SPAMBOT4000

Share this post


Link to post
Share on other sites

×