Player (209)
Joined: 2/18/2005
Posts: 1451
About the TAS gag you are both correct. I actually meant that they create them parallel so 4.5 is correctly.
MahaTmA wrote:
An alley is of width X. Two ladders are standing in the alley so that one end is in the corner of the alley, and the other in on the opposite wall. They are situated so they form an X within the alley. One ladder is leaning onto the left wall so it hits the wall 40 metres from the ground. The other one hits the opposing wall 30 metres from the ground. The point where the ladders intersect is 10 metres from the ground. Determine the width of the alley.
Very interesting task. If I see it correctly neither Pythagoras nor any angle functions work here so I couldn't solve this. However I see that it has a possible solution, it's just beyond my mathematical knowledge to find the correct formulas at the moment. Let's see if someone else can do it.
See my perfect 100% movie-walkthroughs of the best RPG games on http://www.freewebs.com/saturnsmovies/index.htm Current TAS project (with new videos): Super Metroid Redesign, any% speedrun
JXQ
Experienced player (750)
Joined: 5/6/2005
Posts: 3132
MahaTmA wrote:
An alley is of width X. Two ladders are standing in the alley so that one end is in the corner of the alley, and the other in on the opposite wall. They are situated so they form an X within the alley. One ladder is leaning onto the left wall so it hits the wall 40 metres from the ground. The other one hits the opposing wall 30 metres from the ground. The point where the ladders intersect is 10 metres from the ground. Determine the width of the alley.
Maybe I'm reading this wrong.

 A         B   
 |\       /|
 | \     / |
 |  \ C /  |
3|   \ /   |4
 |    X    |
0|   / \   |0
 |  / | \  |
 | /  |  \ |
 |/   |   \|
D|____F____|E
      x
The ladders aren't the same length but just for the picture, this is what I'm deriving from the words. So I'm dropping a perpendicular from C down to line DE, and call that point of intersection F. The question is asking to find the length of DE, which I have labeled x (edit: not to be confused with big X, which is just a pretty way of showing intersecting ladders). By similar triangles, Length(DF) = x/3 and Length(EF) = x/4. But Length(DF) + Length(EF) = x. Substituting, I get that x/3 + x/4 = x. 7x/12 = x. x = 0. Broo? What am I doing wrong?
<Swordless> Go hug a tree, you vegetarian (I bet you really are one)
Active player (283)
Joined: 3/4/2006
Posts: 341
The question is wrong. If the ladders hit the walls at the points specified, then the distance from the intersection to the ground is easy to calculate, and it is not 10 metres. Besides, the data given has absolutely no information about the horizontal scale. I think the correct statement of the problem specifies that the ladders have lengths 30 and 40 metres respectively, which would make the problem solvable.
Player (209)
Joined: 2/18/2005
Posts: 1451
I think only one ladder is hitting the corner at the bottom, not both. Otherwise this build situation wouldn't be possible. Here is how I see it, correct me if I'm wrong:
See my perfect 100% movie-walkthroughs of the best RPG games on http://www.freewebs.com/saturnsmovies/index.htm Current TAS project (with new videos): Super Metroid Redesign, any% speedrun
Player (36)
Joined: 9/11/2004
Posts: 2623
One board is three meters long, the other is two. Their intersection is one meter from the ground.
Build a man a fire, warm him for a day, Set a man on fire, warm him for the rest of his life.
Joined: 4/16/2005
Posts: 251
see page 3.
Former player
Joined: 8/1/2004
Posts: 2687
Location: Seattle, WA
Gorash wrote:
see page 3.
Page 4
hi nitrodon streamline: cyn-chine
Joined: 4/16/2005
Posts: 251
Zurreco wrote:
Gorash wrote:
see page 3.
Page 4
darn.
Joined: 5/3/2004
Posts: 1203
Gorash wrote:
darn.
Joined: 4/16/2005
Posts: 251
I'm sure I'd be amazed at your image collection for other expressions. :)
Joined: 3/8/2004
Posts: 185
Location: Denmark
Must've typed it out wrong :/ Work has me dead-tired ATM. One ladder is 30 m long, the other is 20 m long. The other case shows, that if such a construction is possible, 7/12 = 1, which clearly isn't true.
"We observe the behaviour of simple folk, and derive pleasure from their defects." -Aristotle - Book of Humour
Joined: 5/3/2004
Posts: 1203
I'm sure you've all heard the tired old brain teaser about accurately measuring 4 gallons with two irregularly shaped containers measuring 3 gallons and 5 gallons, respectively. So, here's an interesting generalization: You have two irregularly shaped containers, measuring a and b gallons, respectively. Which numbers x can you measure? What is the minimal number of steps required to measure x? For a given x, which pairs a and b are "the worst," that is, they require more steps to measure x than all pairs before them?
Editor, Player (67)
Joined: 6/22/2005
Posts: 1041
This sounds similar to something I just learned in number theory yesterday. For the case in which the numbers are integers, you can write a linear equation ai + bj = x, i.e., x is a linear combination of a and b. This only has solutions if x is divisible by GCD(a, b). I'm not sure if I know enough yet to be able to answer the other questions, so I'll let someone else have a go.
Current Projects: TAS: Wizards & Warriors III.
Joined: 3/25/2004
Posts: 459
Do we have to post problems that have already been solved? I'd love for someone to solve the Collatz conjecture, since it seems so easy.
Player (36)
Joined: 9/11/2004
Posts: 2623
xebra wrote:
I'm sure you've all heard the tired old brain teaser about accurately measuring 4 gallons with two irregularly shaped containers measuring 3 gallons and 5 gallons, respectively. So, here's an interesting generalization: You have two irregularly shaped containers, measuring a and b gallons, respectively. Which numbers x can you measure? What is the minimal number of steps required to measure x? For a given x, which pairs a and b are "the worst," that is, they require more steps to measure x than all pairs before them?
The largest value you can't make is (a-1)b - a where a and b are coprime and a < b. If a and b are not coprime then there's always values you can't make. This isn't what you asked, but interesting nonetheless.
Build a man a fire, warm him for a day, Set a man on fire, warm him for the rest of his life.
Joined: 5/3/2004
Posts: 1203
Ramzi wrote:
Do we have to post problems that have already been solved? I'd love for someone to solve the Collatz conjecture, since it seems so easy.
Hmm, no one has solved the problem I recently posted, so I guess we don't have to post problems that have already been solved at all! Let me know when you have an answer to the third question, smarty pants. (If your immediate instinct was to say for x=1 the worst pairs are consecutive fibonacci numbers, I know what you're thinking, but your instinct is wrong!)
Joined: 3/25/2004
Posts: 459
I know the answer but there isn't enough space in this textbox to post it.
Player (87)
Joined: 1/15/2006
Posts: 333
Location: Bangkok, Thailand
This problem was posted a really long time ago, but I figured it wouldn't hurt to dig it up again:
Gorash wrote:
Write the shortest program that reads space separated arguments from STDIN and prints all permutations of that list on STDOUT. Shortest means in byte of sourcecode. Using packages that do it for you is not allowed of course. Example: program < echo 1 2 3 should print: 1 2 3 1 3 2 2 1 3 2 3 1 3 1 2 3 2 1 in this or another order. I don't know about other languages, but it's a funny thing in perl...
Gorash wrote:
Here is my current minimum:
-nal
sub p{@_?map{my$e=$_;map[$e,@$_],p(grep{$e ne$_}@_)}@_:0}map{print"@$_"}p@F
I originally wrote a solution in Scheme, which wasn't very short at all (175 bytes or so), but I've recently gotten into Python one-lining, so I decided to give it another shot.
def f(n,v=[]):
 if[f([j for j in n if j!=i],v+[i])for i in n]==n:print v
Usage: >>> f(list) 4 bytes shorter including line break and indentation ;)
print reduce(lambda x,p:p/2*x/p+2*10**1000,range(6643,1,-2))
Joined: 5/3/2004
Posts: 1203
I can beat you both, but you won't like it, I guarantee it!
Player (87)
Joined: 1/15/2006
Posts: 333
Location: Bangkok, Thailand
xebra wrote:
I can beat you both, but you won't like it, I guarantee it!
I'll withhold judgement until after I've seen it~
print reduce(lambda x,p:p/2*x/p+2*10**1000,range(6643,1,-2))
Joined: 5/3/2004
Posts: 1203
Think Stephen Wolfram.
Editor, Player (67)
Joined: 6/22/2005
Posts: 1041
I'm not sure if that would be allowed. Doesn't it have a built-in permutation function, which would be equivalent to a "package that does it for you"?
Current Projects: TAS: Wizards & Warriors III.
Joined: 5/3/2004
Posts: 1203
No, it's built into the language. It doesn't require the loading of any packages like <<DiscreteMath`Combinatorica`.
Joined: 4/16/2005
Posts: 251
primorial#soup wrote:
-nal
sub p{@_?map{my$e=$_;map[$e,@$_],p(grep{$e ne$_}@_)}@_:0}map{print"@$_"}p@F
def f(n,v=[]):
 if[f([j for j in n if j!=i],v+[i])for i in n]==n:print v
Usage: >>> f(list) 4 bytes shorter including line break and indentation ;)
I don't know Python (don't like the concept of indenting as block syntax), so how do you actually use this from command line? Note how the perl version also does the parsing of arguments and intial invocation of the recursion. xebra: Post the mathematica version if you like, but the challenge to do it without a package to do it for you still applies. ;)
Editor, Player (67)
Joined: 6/22/2005
Posts: 1041
xebra wrote:
No, it's built into the language. It doesn't require the loading of any packages like <<DiscreteMath`Combinatorica`.
I interpreted Gorash's challenge to mean that you were supposed to write your own permutation function/procedure/etc.
Current Projects: TAS: Wizards & Warriors III.