• subscribe
April 20, 2006 12:00 AM

Logical Puzzle

SQL Server Pro
InstantDoc ID #49673

Solution to March's Puzzle: Cards Facing Up
In last month's puzzle (submitted by SQL Server MVP Steve Kass), you had a deck of 52 cards, faces down.You turned over 7 of the cards so that they were face up, then shuffled them into the rest of the deck. Your challenge—while blindfolded—was to separate the cards into two piles such that each pile contained the same number of cards facing up.

This puzzle is mathematical in nature. Split the deck into two, such that the left pile contains 7 cards and the right pile has the remaining 45 cards. The left deck contains a certain number of cards facing up (call it n), and the right deck contains the rest of the face-up cards (7 - n).The solution is to turn over all the cards in the left deck. Because the left deck had 7 - n cards facing down, when you turn them all over, you're left with a deck containing 7 - n cards facing up. Now, both decks contain 7 - n cards facing up.

May's Puzzle: Basic Arithmetic
Thanks to Denis Gobo for this month's arithmetic-themed puzzle. Given the integers 3, 4, 5, and 6, and the basic arithmetic operators: +, -,×, ÷ and parentheses, you need to come up with an expression that evaluates to 28. You can use each number only once and each operator only once.



ARTICLE TOOLS

Comments
  • djmay
    6 years ago
    Jun 09, 2006

    Nice touch, Bill. :-)

    In the logic puzzle I was aiming at the mathematical expression, but you’re right that if you extend the puzzle to a T-SQL expression, due to integer division you have more than one correct solution.

    Thanks for your comments,
    Itzik

    www.SolidQualityLearning.com

  • djmay
    6 years ago
    Jun 07, 2006

    "Bill Pinnick"
    06/07/2006 07:36 AM
    The Logical Puzzle Solution for May's Puzzle

    Diana:

    ... My problem is with the solution presented for May's puzzle.
    Yes, 4 x ( 5 + 6 / 3 ) does equal 28 on most systems since most will
    evaluate 6 / 3 to be 2 exactly. However, I find that, using integer
    arithmetic, you can also get 28 from 4 x ( 6 + 5 / 3). The later answer was not included in your published solutions.

    Thank you for your time. I'm sure this is just one of thousands of
    responses you received on this mater.[Thanks, Bill! I didn't have thousands of responses!DM]

    William Pinnick
    Software Developer
    Futura International, Inc.

  • VINOD
    6 years ago
    May 18, 2006

    4 * (5 + 6/3)

  • Mike
    6 years ago
    May 10, 2006

    You can do this formula to get it. 5 to the power of 6 minus 4 gives you 25 plus 3 equals 28

You must log on before posting a comment.

Are you a new visitor? Register Here