The Five-Minute Forums  

Go Back   The Five-Minute Forums > FiveMinute.net > Miscellaneous
Register FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Display Modes
  #61  
Old 08-22-2004, 03:03 AM
Nic Corelli's Avatar
Nic Corelli Nic Corelli is offline
Wigging out
Member
 
Join Date: Apr 2003
Location: Zagreb, Croatia
Posts: 925
Send a message via ICQ to Nic Corelli
Default

PHJ, Fuyu, Daniel and possibly some other people (can`t remember quite right) took my quiz and thought my real name was Carlos Armando! :mrgreen: :mrgreen: :mrgreen:
__________________
\"Lord Eddard Stark is a proud, honourable, honest man, and his lady wife is worse.\"


~A Game of Thrones, book one of Song of Ice and Fire
Reply With Quote
  #62  
Old 08-22-2004, 08:39 AM
danieldoof's Avatar
danieldoof danieldoof is offline
I fell in the pit
You fell in the pit
We all fell in the piiiiit
Member
 
Join Date: Jul 2004
Posts: 1,637
Default

maybe it will get better when I hang around here a bit :wink:
I barely know you all yet

but my score is not bad for guessing is it?
__________________
.
Reply With Quote
  #63  
Old 08-22-2004, 12:16 PM
PointyHairedJedi's Avatar
PointyHairedJedi PointyHairedJedi is offline
He'd enjoy a third pie
Member
 
Join Date: Mar 2003
Location: The Scotlands
Posts: 4,354
Send a message via ICQ to PointyHairedJedi Send a message via AIM to PointyHairedJedi Send a message via Yahoo to PointyHairedJedi
Default

Quote:
Originally Posted by Nic Corelli
PHJ, Fuyu, Daniel and possibly some other people (can`t remember quite right) took my quiz and thought my real name was Carlos Armando! :mrgreen: :mrgreen: :mrgreen:
GASP!

You mean it isn't? :shock:
__________________
Mason: Luckily we at the Agency use use a high-tech piece of software that will let us spot him instantly via high-res satellite images.
Sergeant: You can? That's amazing!
Mason: Yes. We call it 'Google Earth'.
- Five Minute 24 S1 (it lives, honest!)

"Everybody loves pie!"
- Spongebob Squarepants
Reply With Quote
  #64  
Old 08-22-2004, 09:29 PM
catalina_marina's Avatar
catalina_marina catalina_marina is offline
Surfin' you say?
Member
 
Join Date: May 2003
Location: North-West of the South-East of Nowhere.
Posts: 4,949
Send a message via ICQ to catalina_marina Send a message via AIM to catalina_marina Send a message via MSN to catalina_marina Send a message via Yahoo to catalina_marina
Default

Thank you, Nic, for digging up this thread. For some reason I couldn't find it when I tried to, a week or so ago.

Quote:
Originally Posted by Michiel
Any idea how you would go about it if you had, say, 4 balls?

Or: More than two balls and not enough balls for a binary search?
One ball: 100 tries.
Two balls: 14 tries.
Three balls: 9 tries.
Four balls: 8 tries.
Five or more balls: 7 tries.

Now, please don't ask me to generalize it further, for another number other than 100 stories, so that I'd actually have to set up a formula, because I already failed that once. And when I say once, I mean, of course, over and over again. :roll:
__________________
~Bachelor of Science Marijke

I'm not the devil, I just work for her.

What spoon? There is no spoon. According to Zeke, it's a cat. ~NeoMatrix

"Apparently we're on the wrong side. Or the right side if you like winning." ~Spike

Sa'ar Chasm: Too far south you hit Belgium.
catalina marina: Not in Limburg you don't.
Sa'ar Chasm: You do if you go south in the right way.
Reply With Quote
  #65  
Old 08-22-2004, 09:55 PM
PointyHairedJedi's Avatar
PointyHairedJedi PointyHairedJedi is offline
He'd enjoy a third pie
Member
 
Join Date: Mar 2003
Location: The Scotlands
Posts: 4,354
Send a message via ICQ to PointyHairedJedi Send a message via AIM to PointyHairedJedi Send a message via Yahoo to PointyHairedJedi
Default

^ I forsee the potential for much fun here... :twisted:
__________________
Mason: Luckily we at the Agency use use a high-tech piece of software that will let us spot him instantly via high-res satellite images.
Sergeant: You can? That's amazing!
Mason: Yes. We call it 'Google Earth'.
- Five Minute 24 S1 (it lives, honest!)

"Everybody loves pie!"
- Spongebob Squarepants
Reply With Quote
  #66  
Old 08-22-2004, 10:51 PM
NAHTMMM's Avatar
NAHTMMM NAHTMMM is offline
Noodles And Hot Tofu! MMM
Member
 
Join Date: Mar 2003
Location: St Louis, MO, USA, . . .
Posts: 2,975
Send a message via Yahoo to NAHTMMM
Default

Hmm. Actually, it should be fairly straightforward to generalize for a single ball... :?
__________________
My 5MV webpages My novel fivers list

Yup

“There must have been a point in early human history when it was actually advantageous to, when confronted with a difficult task, drop it altogether and go do something more fun, because I do that way too often for it to be anything but instinct.” -- Isto Combs
Reply With Quote
  #67  
Old 08-22-2004, 11:39 PM
catalina_marina's Avatar
catalina_marina catalina_marina is offline
Surfin' you say?
Member
 
Join Date: May 2003
Location: North-West of the South-East of Nowhere.
Posts: 4,949
Send a message via ICQ to catalina_marina Send a message via AIM to catalina_marina Send a message via MSN to catalina_marina Send a message via Yahoo to catalina_marina
Default

Uhm, well yes, if you stick to a certain number of balls, it is. But what if you vary that? And then, say, for 200 stories? Or for 150? Just to name a few.

It probably wouldn't even be all that hard, but I just suck at creating formulas. For now. :wink:
__________________
~Bachelor of Science Marijke

I'm not the devil, I just work for her.

What spoon? There is no spoon. According to Zeke, it's a cat. ~NeoMatrix

"Apparently we're on the wrong side. Or the right side if you like winning." ~Spike

Sa'ar Chasm: Too far south you hit Belgium.
catalina marina: Not in Limburg you don't.
Sa'ar Chasm: You do if you go south in the right way.
Reply With Quote
  #68  
Old 08-23-2004, 01:25 AM
Draknek's Avatar
Draknek Draknek is offline
Cursory
Member
 
Join Date: Mar 2003
Location: Bristol, England
Posts: 165
Send a message via MSN to Draknek
Default

(Draknek has been working this out for far too long)

Changing the number of floors is fairly trivial (once you get how to do it at all, that is - I didn't).

With only two balls, the formula is:

y = ceil(1/2*(sqrt(1+8x)-1))

Where y is the number of attempts you need to make and x is the number of floors. (Ceil means round up.)

Showing my working backwards, that formula is produced from this one:

1/2*y*(y+1) >= x

Which is, in turn, produced by this one:

(Sum of a between a=1 and a=y) >= x

Which is the original formula for 2 balls.

For one ball, the formula is:

y >=x

But that is equivelant to:

(Sum of 1 between a=1 and a=y) >= x

Going back to 2 balls:

(Sum of a between a=1 and a=y) >= x

Is the same as:

(Sum of (Sum of 1 between a=1 and a=b) between b=1 and b=y) >= x

Extending this, for three balls, it would be:

(Sum of (Sum of (Sum of 1 between a=1 and a=b) between b=1 and b=c) between c=1 and c=y) >= x

However, at 2:20 in the morning, I'm not willing to work that out and get a y=blah equation for three balls.

(Apologies if this makes little sense, is in a stupid order, or both. Draknek is tired now.)
__________________
Self-referential sigs do not a humourous poster make.
Reply With Quote
  #69  
Old 08-23-2004, 05:29 AM
Nic Corelli's Avatar
Nic Corelli Nic Corelli is offline
Wigging out
Member
 
Join Date: Apr 2003
Location: Zagreb, Croatia
Posts: 925
Send a message via ICQ to Nic Corelli
Default




No, my name is not Carlos Armando and you know that perfectly well, :P
__________________
\"Lord Eddard Stark is a proud, honourable, honest man, and his lady wife is worse.\"


~A Game of Thrones, book one of Song of Ice and Fire
Reply With Quote
  #70  
Old 08-23-2004, 10:54 AM
catalina_marina's Avatar
catalina_marina catalina_marina is offline
Surfin' you say?
Member
 
Join Date: May 2003
Location: North-West of the South-East of Nowhere.
Posts: 4,949
Send a message via ICQ to catalina_marina Send a message via AIM to catalina_marina Send a message via MSN to catalina_marina Send a message via Yahoo to catalina_marina
Default

Ah yes, the sums. I thought of that, actually, but I couldn't make any direct formulas for them, after the first one. And my calculator is pretty slow on the recursive ones. :roll:
__________________
~Bachelor of Science Marijke

I'm not the devil, I just work for her.

What spoon? There is no spoon. According to Zeke, it's a cat. ~NeoMatrix

"Apparently we're on the wrong side. Or the right side if you like winning." ~Spike

Sa'ar Chasm: Too far south you hit Belgium.
catalina marina: Not in Limburg you don't.
Sa'ar Chasm: You do if you go south in the right way.
Reply With Quote
  #71  
Old 08-23-2004, 11:36 AM
Alexia's Avatar
Alexia Alexia is offline
La la la, I can't hear you
Member
 
Join Date: Mar 2003
Location: The island not in the sun
Posts: 1,267
Send a message via ICQ to Alexia Send a message via AIM to Alexia Send a message via MSN to Alexia Send a message via Yahoo to Alexia
Default

Quote:
Originally Posted by Nic Corelli
__________________
Alexia: You have to laugh, or you'd kill yourself xD
Lostoyannaya: Yes. Now take that noose off your neck and get down from the chair. IN THAT ORDER.
Reply With Quote
  #72  
Old 08-23-2004, 12:11 PM
PointyHairedJedi's Avatar
PointyHairedJedi PointyHairedJedi is offline
He'd enjoy a third pie
Member
 
Join Date: Mar 2003
Location: The Scotlands
Posts: 4,354
Send a message via ICQ to PointyHairedJedi Send a message via AIM to PointyHairedJedi Send a message via Yahoo to PointyHairedJedi
Default

*Head explodes*
__________________
Mason: Luckily we at the Agency use use a high-tech piece of software that will let us spot him instantly via high-res satellite images.
Sergeant: You can? That's amazing!
Mason: Yes. We call it 'Google Earth'.
- Five Minute 24 S1 (it lives, honest!)

"Everybody loves pie!"
- Spongebob Squarepants
Reply With Quote
  #73  
Old 08-23-2004, 01:35 PM
Draknek's Avatar
Draknek Draknek is offline
Cursory
Member
 
Join Date: Mar 2003
Location: Bristol, England
Posts: 165
Send a message via MSN to Draknek
Default

Ah, my work here is done.

(Almost)

I worked out this to be the formula for 3 balls:

y^3 + 3y^2 + 2y - 6x >= 0

But either I've forgotten how to factor polynominals with magnitude > 2, or I haven't learnt yet.
__________________
Self-referential sigs do not a humourous poster make.
Reply With Quote
  #74  
Old 08-23-2004, 02:23 PM
NAHTMMM's Avatar
NAHTMMM NAHTMMM is offline
Noodles And Hot Tofu! MMM
Member
 
Join Date: Mar 2003
Location: St Louis, MO, USA, . . .
Posts: 2,975
Send a message via Yahoo to NAHTMMM
Default

Hmm, I shall have to program an appropriate program at school, just for the fun of it :twisted:
__________________
My 5MV webpages My novel fivers list

Yup

“There must have been a point in early human history when it was actually advantageous to, when confronted with a difficult task, drop it altogether and go do something more fun, because I do that way too often for it to be anything but instinct.” -- Isto Combs
Reply With Quote
  #75  
Old 08-23-2004, 02:53 PM
Alexia's Avatar
Alexia Alexia is offline
La la la, I can't hear you
Member
 
Join Date: Mar 2003
Location: The island not in the sun
Posts: 1,267
Send a message via ICQ to Alexia Send a message via AIM to Alexia Send a message via MSN to Alexia Send a message via Yahoo to Alexia
Default

Fun? FUN?! Are you insane?

Oh, yes. You are. In that case, I withdraw the question :wink:
__________________
Alexia: You have to laugh, or you'd kill yourself xD
Lostoyannaya: Yes. Now take that noose off your neck and get down from the chair. IN THAT ORDER.
Reply With Quote
  #76  
Old 08-23-2004, 06:05 PM
NAHTMMM's Avatar
NAHTMMM NAHTMMM is offline
Noodles And Hot Tofu! MMM
Member
 
Join Date: Mar 2003
Location: St Louis, MO, USA, . . .
Posts: 2,975
Send a message via Yahoo to NAHTMMM
Default

I'm still not particularly happy with the (Mathematica) function I came up with...

Code:
ballfall[maxfloors_] := 
        Do[For[i = 0; cmax = IntegerPart[maxfloors];
               cmin = 1, cmax - cmin > 0, 
               i += 1, temp = Ceiling[(cmax + cmin)/2]; cmin = temp];
           Return[i], {1}]
^Highlight that code if you can't read it because of the colors


Ideally that would be a rounding-down function, not a ceiling function, but IntegerPart leads to an infinite loop of evil DOOM! when cmin is one less than cmax ... Still, the only mistakes should be that the smallest number of floors for which n trials are required might seem to require only n - 1 trials.


Here's a plot for up through 100 and a bit...
__________________
My 5MV webpages My novel fivers list

Yup

“There must have been a point in early human history when it was actually advantageous to, when confronted with a difficult task, drop it altogether and go do something more fun, because I do that way too often for it to be anything but instinct.” -- Isto Combs
Reply With Quote
  #77  
Old 08-23-2004, 07:45 PM
Draknek's Avatar
Draknek Draknek is offline
Cursory
Member
 
Join Date: Mar 2003
Location: Bristol, England
Posts: 165
Send a message via MSN to Draknek
Default

That looks like the graph for 5 to an infinite number of balls.

Cat, are you sure that it's 9 tries minimum for 3 balls? I get 8.

EDIT: Nevermind. I wrote a program, which agrees with you.

Code:
#!/usr/bin/perl -w

use strict;

# Edit the next two values as appropriate

my $ballcount = 2;
my $floorcount = 100;

my $tries;
for ($tries = 0; 1; $tries++)
{
  if (howmanyfloors($tries,$ballcount) >= $floorcount)
  {
    print "It takes a maximum of $tries tries to check $floorcount floors with $ballcount balls.\n";
    exit;
  }
}

sub howmanyfloors
{
  my $tries = shift;
  my $ballcount = shift;
  
  # Can't check any floors without any balls
  return 0 if ($ballcount < 1);
     
  my $floors = 0;
  while ($tries > 0)
  {
    $tries -= 1;
    $floors += howmanyfloors($tries,$ballcount-1) + 1;
  }
  
  return $floors;
}
__________________
Self-referential sigs do not a humourous poster make.
Reply With Quote
  #78  
Old 08-23-2004, 09:17 PM
catalina_marina's Avatar
catalina_marina catalina_marina is offline
Surfin' you say?
Member
 
Join Date: May 2003
Location: North-West of the South-East of Nowhere.
Posts: 4,949
Send a message via ICQ to catalina_marina Send a message via AIM to catalina_marina Send a message via MSN to catalina_marina Send a message via Yahoo to catalina_marina
Default

I'm quite sure. You only get till the 92nd story with eight tries.
__________________
~Bachelor of Science Marijke

I'm not the devil, I just work for her.

What spoon? There is no spoon. According to Zeke, it's a cat. ~NeoMatrix

"Apparently we're on the wrong side. Or the right side if you like winning." ~Spike

Sa'ar Chasm: Too far south you hit Belgium.
catalina marina: Not in Limburg you don't.
Sa'ar Chasm: You do if you go south in the right way.
Reply With Quote
  #79  
Old 08-23-2004, 09:45 PM
Draknek's Avatar
Draknek Draknek is offline
Cursory
Member
 
Join Date: Mar 2003
Location: Bristol, England
Posts: 165
Send a message via MSN to Draknek
Default

Yeah, that's what my program told me, and I'm fairly certain now that it will be correct for any given values.

There's got to be a problem with my maths somewhere.
__________________
Self-referential sigs do not a humourous poster make.
Reply With Quote
  #80  
Old 08-23-2004, 09:54 PM
NAHTMMM's Avatar
NAHTMMM NAHTMMM is offline
Noodles And Hot Tofu! MMM
Member
 
Join Date: Mar 2003
Location: St Louis, MO, USA, . . .
Posts: 2,975
Send a message via Yahoo to NAHTMMM
Default

I don't even SEE much in the way of math in your program... :?



Anyway, it would seem that the number of building heights such that you need a maximum of n one-ball trials to find the minimum height from which the ball will break is equal to 2^n (which isn't terribly surprising). That is, there are 2^(2-1) = 2 building heights that require 2 trials, 2^(3-1) = 4 building heights that require 3 trials, etc. And of course there's the exception of the building just one story tall, where you don't need to run any trials because you know the ball will break if you drop it from the first story since there aren't any other stories to drop from :lol:.
__________________
My 5MV webpages My novel fivers list

Yup

“There must have been a point in early human history when it was actually advantageous to, when confronted with a difficult task, drop it altogether and go do something more fun, because I do that way too often for it to be anything but instinct.” -- Isto Combs
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is On

Forum Jump


All times are GMT. The time now is 08:41 PM.


Powered by vBulletin® Version 3.8.2
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.