1. Attachments are working again! Check out this thread for more details and to report any other bugs.

Interesting logic problems

Discussion in 'Fred's House of Pancakes' started by eagle33199, Mar 11, 2010.

  1. hyo silver

    hyo silver Awaaaaay

    Joined:
    Mar 2, 2005
    15,232
    1,563
    0
    Location:
    off into the sunset
    Vehicle:
    2004 Prius
    Model:
    N/A
    Yeah, that works too. The other way is to realise it has to be a trick question, and the obvious answer is wrong. :)

    edit: I don't have a puzzle formulated, so have another go. Unless you'd like to tell the audience how Schroedinger's cat is dead and always has been, even though there's still a probability before the box is opened.
     
  2. airportkid

    airportkid Will Fly For Food

    Joined:
    Sep 2, 2005
    2,191
    538
    0
    Location:
    San Francisco Bay Area CA
    Vehicle:
    2005 Prius
    I never could get Schroedinger's cat metaphor, but much of quantum theory baffles me utterly. Then again, one of those quantum pioneers did say that if you think you understand quantum mechanics that's strong evidence you don't.

    Quantum theory is as alien as the moon. Let's go there for the next problem.

    Space Cadet Ens. Ellawng Tripp began his day on the moon by noting the Earth's azimuth and elevation at his position and marking down the Earth's Zulu time. Seven Earth days and six hours later Tripp did the same thing at the same location. 13 Earth days and 22 minutes after that he repeated the exercise, again at the same location.
    "Man, that's just spooky," Tripp exclaimed. The Earth's azimuth and elevation were the same all three times. "I just took those measurements at random times. Amazing."

    Was it amazing?
     
  3. uart

    uart Senior Member

    Joined:
    Sep 7, 2009
    4,215
    1,200
    0
    Location:
    Australia
    Vehicle:
    2005 Prius
    Not if the elevation was 90 degrees. Is that the correct anwser (elevation 90, azimuth 0 for all three observations).

    Edit: Oh no it's not amazing even if the elevation wasn't 90 degrees. Since the same side of the moon always faces the Earth then the elevation and azimuth (from any given point on the moon) will always be the same. Except that it for a small wobble since they (earth moon) co-rotate about their common center of mass which is not actually the center of the Earth.
     
  4. uart

    uart Senior Member

    Joined:
    Sep 7, 2009
    4,215
    1,200
    0
    Location:
    Australia
    Vehicle:
    2005 Prius
    Ok, here's another one.

    I'm off to the shop to buy a can of soft drink for myself and one for each of my nine friends (ten drinks in all). The shop sells only the following five different types of soft drink, Cola, Ginger Beer, Lemonade, Orange "Fanta" and Lemon Squash.

    How many different combinations of ten drinks are possible?
     
  5. daniel

    daniel Cat Lovers Against the Bomb

    Joined:
    Feb 25, 2004
    14,487
    1,518
    0
    Location:
    Spokane, WA
    Vehicle:
    2004 Prius
    I know that. But it's not the kind of problem I'm good at or enjoy, so I skip it.

    I agree up until that last part:

    Monty would never open the door you picked. He would always open one of the others. But he knows which door has the big prize, and he never opens that.

    So if you switch you will win half the time and lose half the time: If you had the right door to begin with (a 1/3 chance) you would lose if you switched. But if you had the wrong door at first (a 2/3 chance) you would win if you switched.

    If you do not switch, you win 1/3 of the time and lose 2/3 of the time.

    It's all based on the fact that Monty knows, and never opens either the door you picked or the door with the big prize.
     
  6. daniel

    daniel Cat Lovers Against the Bomb

    Joined:
    Feb 25, 2004
    14,487
    1,518
    0
    Location:
    Spokane, WA
    Vehicle:
    2004 Prius
    They put a guy on the moon??? Yes. that's amazing! :D
     
  7. airportkid

    airportkid Will Fly For Food

    Joined:
    Sep 2, 2005
    2,191
    538
    0
    Location:
    San Francisco Bay Area CA
    Vehicle:
    2005 Prius
    Assuming you buy at least 1 each of the 5 flavors, there are 126 unique combinations of 10.

    Forgetting flavor distribution, there are 7 ways to sum to 10 with 5 numbers:

    2 2 2 2 2

    6 1 1 1 1

    5 2 1 1 1
    4 3 1 1 1
    3 1 2 2 2

    4 2 2 1 1
    2 3 3 1 1

    There's only one distribution of flavors in the first.

    There are 5 distributions of flavor in the 2nd.

    There are 20 distributions of flavor in each of the 3rd group.

    There are 30 distributions of flavor in each of both of the last group.

    1 + 5 + 3x20 + 2x30 = 126


    The probability that at least one of your friends wanted

    (a) a flavor the store didn't have, or

    (b) a flavor you didn't buy enough of

    is 1 to 1. You should have sent someone else to the store, or bought beer instead. :p
     
  8. uart

    uart Senior Member

    Joined:
    Sep 7, 2009
    4,215
    1,200
    0
    Location:
    Australia
    Vehicle:
    2005 Prius
    Sorry you can't assume that, buying 10 cokes or 9 cokes and one lemonade etc etc are all considered valid combinations. So there's a lot of possiblities. :D
     
  9. Darwood

    Darwood Senior Member

    Joined:
    Feb 21, 2005
    5,259
    268
    1
    Location:
    Minnesota
    Vehicle:
    2010 Prius
    Model:
    N/A
    99,999?
    I figure the math should be the same for 5 people and 10 drinks as for 10 people and 5 drinks. Therefore you assign 0-9 to the drinks and have 5 people (xx,xxx) such that every possible number would be a unique combination.
     
  10. Darwood

    Darwood Senior Member

    Joined:
    Feb 21, 2005
    5,259
    268
    1
    Location:
    Minnesota
    Vehicle:
    2010 Prius
    Model:
    N/A
    Four girls were competing in the 400 metres hurdles. Official figures mysteriously went missing just after the event, however, various spectators could remember the following information. Josie was never suspected though!
    1. Jane won and wore red.
    2. The girl wearing number 1 came third.
    3. Julie beat the girl in yellow, but wasn't wearing number 2.
    4. Only one girl finished in the same position as the number she wore, but she didn't wear red.
    5. Jackie beat the girl wearing number 3 and Josie wore yellow.
    6. The girl in green wore number 2.
    7. A spectator remembered one girl wore blue, but couldn't remember anything else about her.
    Can you determine the positions the girls finished in, along with the numbers and colours they wore?
     
  11. eagle33199

    eagle33199 Platinum Member

    Joined:
    Mar 2, 2006
    5,122
    268
    0
    Location:
    Minnesota
    Vehicle:
    2015 Prius v wagon
    Model:
    Two
    If we took order to matter here, the answer would be 5^10, or something close to 10 million. However, order does NOT matter - if you have 9 cokes and a ginger, it doesn't matter if the ginger is first or last - you still have 9 cokes and a ginger.

    Anyways, with a bunch of math it ends up being 14!/(10! * 4!). The final answer is 1001 different ways. For once, i'm glad i paid attention back in high school :-p

    First: Jane, red, #4
    Second: Jackie, green, #2
    Third: Julie, blue, #1
    Fourth: Josie, yellow, #3
     
  12. eagle33199

    eagle33199 Platinum Member

    Joined:
    Mar 2, 2006
    5,122
    268
    0
    Location:
    Minnesota
    Vehicle:
    2015 Prius v wagon
    Model:
    Two
    Next, an easy one. What two state capitols contain the state they're a capitol of in their name?
     
  13. uart

    uart Senior Member

    Joined:
    Sep 7, 2009
    4,215
    1,200
    0
    Location:
    Australia
    Vehicle:
    2005 Prius
    Yes of course order doesn't matter here, buying 9 cokes and one lemonade is the same result as buying one lemonade and 9 cokes. :)

    Yes 1001 ways is the correct answer. We have a winner at last. :cheer2:
     
  14. uart

    uart Senior Member

    Joined:
    Sep 7, 2009
    4,215
    1,200
    0
    Location:
    Australia
    Vehicle:
    2005 Prius
    Indiana : (Indianapolis)

    Oklahomer : (Oklahomer City)
     
  15. Darwood

    Darwood Senior Member

    Joined:
    Feb 21, 2005
    5,259
    268
    1
    Location:
    Minnesota
    Vehicle:
    2010 Prius
    Model:
    N/A
    "If we took order to matter here, the answer would be 5^10, or something close to 10 million. However, order does NOT matter - if you have 9 cokes and a ginger, it doesn't matter if the ginger is first or last - you still have 9 cokes and a ginger.

    Anyways, with a bunch of math it ends up being 14!/(10! * 4!). The final answer is 1001 different ways. For once, i'm glad i paid attention back in high school :-p"

    Doh!
    I thought we were assigning the drinks, but that makes more sense. Nice catch Eagle.
     
  16. airportkid

    airportkid Will Fly For Food

    Joined:
    Sep 2, 2005
    2,191
    538
    0
    Location:
    San Francisco Bay Area CA
    Vehicle:
    2005 Prius
    Not so fast.

    My math shows 1011 possibilities, 10 more than 1001. How did you derive 14!/10!*4! (which delivers 1001)?

    2 2 2 2 2 . . . . . . 1 arrangement

    10 0 0 0 0
    6 1 1 1 1 . . . . . . 5 arrangements each (10 total)

    9 1 0 0 0
    8 2 0 0 0
    7 3 0 0 0 11 sets with 3 duplicated digits
    6 4 0 0 0
    5 5 0 0 0
    7 0 1 1 1
    5 2 1 1 1
    4 3 1 1 1
    4 0 2 2 2
    3 1 2 2 2
    1 0 3 3 3 . . . . . 20 arrangements each (220 total)


    8 1 1 0 0
    6 2 2 0 0
    4 3 3 0 0 8 sets with twin twin duplicated digits
    2 4 4 0 0
    4 2 2 1 1
    2 3 3 1 1
    0 4 4 1 1
    0 3 3 2 2 . . . . . . 30 arrangements each (240 total)


    7 2 1 0 0
    6 3 1 0 0
    5 4 1 0 0
    5 3 2 0 0 7 sets with only 2 duplicated digits
    6 2 0 1 1
    5 3 0 1 1
    5 1 0 2 2 . . . . . 60 arrangements each (420 total)


    4 3 2 1 0 . . . . . 120 arrangements of no duplicated digits


    1 + 10 + 220 + 240 + 420 + 120 = 1011

    Yeah, I've got too much time, but there's all that soda to drink ... :p
     
  17. eagle33199

    eagle33199 Platinum Member

    Joined:
    Mar 2, 2006
    5,122
    268
    0
    Location:
    Minnesota
    Vehicle:
    2015 Prius v wagon
    Model:
    Two
    I found this site which explains the derivation of the formula (since i'm not sure i could explain it well enough anymore): Combinations and Permutations

    From your lists, double check 5 5 0 0 0- there are only 10 combinations of these numbers, not 20.

    And so you don't feel too bad... I didn't see it at first, either. I ended up writing an excel macro to list all the unique combinations (1001, so i knew my formula was correct), then divide those into groupings like you did... once i saw that grouping only had 210 instead of 220, 55000 stood out like a sore thumb :)

    And
    uart... its your turn to post a question, as you answered the last one correctly.
     
  18. Darwood

    Darwood Senior Member

    Joined:
    Feb 21, 2005
    5,259
    268
    1
    Location:
    Minnesota
    Vehicle:
    2010 Prius
    Model:
    N/A
    "I ended up writing an excel macro to list all the unique combinations "

    wow. I can't tell if you're really bored or if you wear a pocket protector! :D
     
  19. eagle33199

    eagle33199 Platinum Member

    Joined:
    Mar 2, 2006
    5,122
    268
    0
    Location:
    Minnesota
    Vehicle:
    2015 Prius v wagon
    Model:
    Two
    Bah, pocket protectors are sooooo last century :p Besides, as a software engineer, the macro took about 10 minutes from start to finish to make.

    And yes, i was bored at the time.
     
  20. Darwood

    Darwood Senior Member

    Joined:
    Feb 21, 2005
    5,259
    268
    1
    Location:
    Minnesota
    Vehicle:
    2010 Prius
    Model:
    N/A
    I admit to having worked with Macros...but not for my own fun or curiosity!!!

    "Bah, pocket protectors are sooooo last century"
    Are pens obsolete already!!! The stylus and finger have taken over already!

    Is "the finger mightier than the sword?"
    You can't "pen" a novel anymore. You have to finger it!