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;
}