sdn . phlpm on 15 Sep 2011 13:47:23 -0700


[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]

[Philadelphia-pm] 378,000 milkshakes


Hello Perlmongers,

    For those who were not at the technical meeting earlier this week, Geoff posed an interesting math question.  He had visited a restaurant that advertised 75 ice cream flavors, and therefore (they claimed), there were 378,000 possible milkshakes they could make for you.  We attempted to figure out how they had arrived at that number.  (We failed).

    I've now come up with one possible way.  378,000 is 75 * 5040.  5040 is 7!.  So there's a clue.  It would be silly to have to choose a permutation of seven ingredients, but another way of arriving at 5040 is by various combinations.  Ignoring rearrangements, there are N!/(M!(N-M!)) ways of picking M items out of N possible choices.

    So, for example, if you must choose 4 ingredients out of a space of 10 possibilities, there are 10!/(4!6!) ways to do that.

        10!
       -----
       4! 6!
=
    10*9*8 * 7!
    -----------
      24 * 720
=
     720 * 5040
     ----------
      24 * 720

which equals 5040/24.

    So here's my solution.  It's a bit contrived, but it could work.  If a milkshake is defined as:
    one scoop of any flavor of ice cream  (75 choices)
    your choice of four out of ten other ingredients  (5040/24 choices)
    small, medium, or large size (3 choices)
    any combination of three optional ingredients (2^3 = 8 choices),

then you have 75 * 5040/24 * 3 * 8 = 378,000 possible milkshakes.

Ta-da!

-- Eric


----------
This message was sent from a MailNull anti-spam account.  You can get
your free account and take control over your email by visiting the
following URL.

   http://mailnull.com/
_______________________________________________
Philadelphia-pm mailing list
Philadelphia-pm@pm.org
http://mail.pm.org/mailman/listinfo/philadelphia-pm