Showing posts with label puzzle. Show all posts
Showing posts with label puzzle. Show all posts

Monday, June 30, 2008

latest NPR Weekend Edition puzzle

It was really easy, and can be found here, under the heading Next Week's Challenge.

From a 19th century trade card advertising Bassetts Horehound Troches, a remedy for coughs and colds: A man buys 20 pencils for 20 cents and gets three kinds of pencils in return. Some of the pencils cost 4 cents each, some are two for a penny and the rest are four for a penny. How many pencils of each type does the man get?


The facts can be related as (the sum of all three kinds of pencils is 20) and (the sum of the costs for the pencils is 20 cents). When you do elimination on these two equations, resulting in for the last equation, there's still a free variable! But if you step through all possible values for , you'll find that the only one where and are both integers (under the reasonable assumption that he can't have a fraction of any pencil) is two. If , then and .

Saturday, May 3, 2008

finding the size of a family with combinatorics

Here's a cool problem, not very difficult to solve, but there is a bit of number crunching.
Four children are picked at random (with no replacement) from a family which includes exactly two boys. The chance that neither boy is chosen is half the chance that both are chosen. How large is the family?
Any time you see 'choose' (order doesn't matter) and 'no replacement' together in the problem, you'll most likely use combinations to solve it. The easiest part of such a problem is to find the denominator of the fraction that gives the probability for an event expressed with combinatorics, which represents every event in the sample space. In this case, it's , where is the unknown number of people in the family. Then the number of ways to choose a group containing no boys is (i.e., choose four kids from the whole group minus the two boys), and the number of ways to choose a group containing both boys is . Actually, it's (i.e., choose two from the two boys and two from the remaining girls, who are out of all the kids), but is always one, so that can be left out. All told, the equation described in the original problem is . With some algebra, that reduces to , whose roots are two and seven. Since there's no way to take four from two (at least not in ), there are seven kids. Must be a Catholic family. And indeed .

Thursday, April 24, 2008

very simple linear algebra puzzle

Since I intend to study operations research in my free time, I need to revisit a lot of the linear algebra material I had a better command of a while ago. That is essential to understanding the simplex and related algorithms. In Jim Hefferon's Linear Algebra, there is a really cute puzzle close to the beginning. It's so easy it's almost not worth mentioning, but I still had fun with it for a few minutes. Here it is:
Three truck drivers went into a roadside cafe. One truck driver purchased four sandwiches, a cup of coffee, and ten doughnuts for $8.45. Another driver purchased three sandwiches, a cup of coffee, and seven doughnuts for $6.30. What did the third truck driver pay for a sandwich, a cup of coffee, and a doughnut?
My solution was a bit different from the book's. The first two purchases can be represented as the linear equations and , respectively. They can be reduced to the linear combination . (I never thought of donuts as parameters. I guess I'm in for more surprises when I study topology.)

Anyway, with that knowledge, you can substitute into the equation with the unknown right-hand value (i.e., the cost of the third purchase) and so arrive at . The terms cancel out and so you are left with a constant: two dollars for the third trucker's purchase. Not a bad deal at all, to be honest. Notice that, even with the added constant, there is still a free variable in this system. As such, the menu items can assume infinitely many combinations of prices s.t. they are non-negative and very economical.