99 Bottles of Beer: Difference between revisions

Source: Wikipedia, the free encyclopedia.
Content deleted Content added
GreenC bot (talk | contribs)
Reformat 1 archive link. Wayback Medic 2.5
Spikeylegs (talk | contribs)
→‎References in computer science: Added Wolfram language implementation
Line 80: Line 80:
Console.WriteLine($"Take one down and pass it around, {bottleNumber - 1} bottles of beer on the wall");
Console.WriteLine($"Take one down and pass it around, {bottleNumber - 1} bottles of beer on the wall");
}
}
</syntaxhighlight>


Yet another example in the Wolfram language:
<syntaxhighlight lang="mathematica">
Do[
Print[IntegerString[i] <> " bottles of beer on the wall " <> IntegerString[i] <> " bottles of beer.\n" <>
"Take one down, pass it around, " <> IntegerString[i - 1] <> " bottles of beer on the wall."]
, {i, 100, 1, -1}]
</syntaxhighlight>
</syntaxhighlight>



Revision as of 14:10, 13 August 2020

"99 Bottles of Beer" is an

Girl Guide
outings.

Lyrics

The song's lyrics are as follows:[1][2]

99 bottles of beer on the wall, 99 bottles of beer.
Take one down, pass it around, 98 bottles of beer on the wall...

Alternate line:[3]

If one of those bottles should happen to fall, 98 bottles of beer on the wall...

The same verse is repeated, each time with one bottle fewer, until there is none left. Variations on the last verse following the last bottle going down include lines such as:

No more bottles of beer on the wall, no more bottles of beer.
Go to the store and buy some more, 99 bottles of beer on the wall...

Or:

No more bottles of beer on the wall, no more bottles of beer.
We've taken them down and passed them around; now we're drunk and passed out!

Other alternate lines reads:

If that one bottle should happen to fall, what a waste of alcohol!

Or:

No more bottles of beer on the wall, no more bottles of beer.
There's nothing else to fall, because there's no more bottles of beer on the wall.

Or:

The song does not stop at the last "1" or "0" bottles of beer but continues counting with -1 (Negative one) Bottles of beer on the wall Take one down, pass it around, -2 (negative 2) bottles of beer on the wall... continuing onward through the negative numbers

Andy Kaufman routine

The boring and time-consuming nature of the "99 Bottles of Beer" song means that probably only a minority of renditions are done to the final verse.[citation needed] The American comedian Andy Kaufman exploited this fact in the routine early in his career when he would actually sing all 100 verses.[4]

Atticus

Modern Drunkard Magazine the following year.[5]

Mathematically inspired variants

Donald Byrd has collected dozens of variants inspired by mathematical concepts and written by himself and others.[6] (A subset of his collection has been published.[7]) Byrd argues that the collection has pedagogic as well as amusement value. Among his variants are:

  • "Infinity bottles of beer on the wall". If one bottle is taken down, there are still
    The Song That Never Ends
    ").
    • "Aleph-null bottles of beer on the wall". Aleph-null is the size of the set of all natural numbers, and is the smallest infinity and the only countable one; therefore, even if an infinite aleph-null of bottles fall, the same amount remains.
    • "Aleph-one/two/three/etc. bottles of beer on the wall". Aleph-one, two, three, etc. are uncountable infinite sets, which are larger than countable ones; therefore, if only a countable infinity of bottles fall, an uncountable number remains.

Other versions in Byrd's collection involve concepts including

differentials, Euler's identity
, , among others.

References in computer science

The computer scientist Donald Knuth proved that the song has a complexity of in his in-joke-article "The Complexity of Songs".

Numerous computer programs exist to output the lyrics to the song. This is analogous to "Hello, World!" programs, with the addition of a loop. As with "Hello World!", this can be a practice exercise for those studying computer programming, and a demonstration of different programming paradigms dealing with looping constructs and syntactic differences between programming languages within a paradigm.

The program has been written in over 1500 different programming languages.[8]

A simple example using classical BASIC syntax:

FOR Bottle = 100 TO 1 STEP -1
 PRINT STR(Bottle) +" bottles of beer on the wall, "+ STR(Bottle) +" bottles of beer"
 PRINT "Take one down and pass it around, "+ STR(Bottle-1) +" bottles of beer on the wall"
NEXT Bottle

Another example using C#:

for (int bottleNumber = 100; 1 <= bottleNumber; bottleNumber--)
{
	Console.WriteLine("{0} bottles of beer on the wall, {0} bottles of beer", bottleNumber);
	Console.WriteLine($"Take one down and pass it around, {bottleNumber - 1} bottles of beer on the wall");		   
}


Yet another example in the Wolfram language:

Do[
 Print[IntegerString[i] <> " bottles of beer on the wall " <> IntegerString[i] <> " bottles of beer.\n" <> 
   "Take one down, pass it around, " <> IntegerString[i - 1] <> " bottles of beer on the wall."]
 , {i, 100, 1, -1}]

See also

References

  1. .
  2. .
  3. .
  4. ^ Patton, Charlie (December 23, 1999). "Ever-annoying Andy Kaufman gets last laugh | Jacksonville.com". Archived from the original on 2018-02-01. Retrieved 15 Sep 2012.
  5. ^ Stewart, Rich. "Rhythm and Booze: The Top 86 Drinking Songs". Modern Drunkard Magazine. Retrieved 2018-12-13.
  6. ^ Byrd, Donald (2015-11-30). "Infinite Bottles of Beer: Mathematical Concepts with Epsilon Pain, Or: A Cantorial Approach to Cantorian Arithmetic and Other Mathematical Melodies" (PDF). Indiana University, School of Informatics. Retrieved 2020-03-26.
  7. ^ Donald Byrd (2010). "Infinite Bottles of Beer: A cantorial approach to Cantorian arithmetic and other mathematical melodies". Math Horizons: 16–17.
  8. ^ Team, 99 Bottles of Beer. "99 Bottles of Beer - Start". www.99-bottles-of-beer.net.{{cite web}}: CS1 maint: numeric names: authors list (link)

External links