“The following surprisingly difficult problem was given to my son's Math Circle”
plus.google.com
plus.google.com
If x is the number of chickens sold in the morning, and y is the number sold after lunch, then the straight line x+y=10 represents all possible values of x and y for the first farmer. Of course, this allows fractional chickens, so the true set of possible values is the set of points where x and y have integer values.
Now you can draw parallel lines to this first line for x+y=16 and x+y=26, representing valid x and y values for the second and third farmer.
Now, if you take any other line that intersects these 3 lines, then that line can be represented by the equation ax+by=35, for some value of a and b. The key observation then is that if we interpret a and b as the morning and afternoon prices respectively, then the points where this line intersects each of the 3 parallel lines represents the x and y values for each farmer such that that farmer's net earnings are $35.
So now the problem reduces to placing a straight edge on your paper and finding a line that passes through integer points on each of the 3 parallels.
This is pretty easy - start with the edge at (0,26) for farmer 3 and (1,15) for farmer 2 and see if it intersects the first line at an integer point - it doesn't. Keep going and you'll find a nice intersection at (0,26), (5,11) and (8,2). Unfortunately the corresponding prices don't round nicely to cents, but you can shift the entire line to the right to get the right answer: (1,25), (6,10) and (9,1), corresponding to prices of $3.75 and $1.25.
I can imagine my Dad using this geometric method to solve the problem at hand. He's a very intelligent guy who has worked in the building industry doing manual labor all of his life.
I can guess that my sister, who is a medical doctor, would have solved it using the same process as the (current) top rated response here; stepping through the equations.
My immediate response would be to hack up a script and brute force the answer.
My Mother would tell me to go ask Dad.
user> (run* [q]
(fresh [morning afternoon a b c d e f]
(fd/in morning afternoon a b c d e f
(fd/interval 0 35))
(fd/eq
(< afternoon morning)
(= (+ a b) 10)
(= (+ c d) 16)
(= (+ e f) 26)
(= (+ (* morning a) (* afternoon b)) 35)
(= (+ (* morning c) (* afternoon d)) 35)
(= (+ (* morning e) (* afternoon f)) 35))
(== q [morning afternoon a b c d e f])))
Spoiler warning, scroll right: ([5 0 7 3 7 9 7 19] [7 0 5 5 5 11 5 21] [35 0 1 9 1 15 1 25])For example, one dictionary defines "sell" as "to exchange (something) for money". $0 is not money. It's literally nothing.
I don't know why people (not you) come up with "clever" solutions that violate the plain wording of the question.
After all, part of the linked article's point was how it struck him as potentially broken; if the problem seems broken, then many will heuristically start attacking the problem itself rather than the math. And once the problem's no longer trusted to be stated as exact and correct, well, a simple pedantic jump in meaning is a pretty small step. (I'll concede it's possible you've never come across a broken 'clever' math word problem before, but having found enough to be wary myself - both in school and college - I'm rarely surprised at people leaping for the lateral thinking solution.)
user> (run* [q] (fresh [morning afternoon a b c d e f] (fd/in morning afternoon (fd/interval 0 3500)) (fd/in a b c d e f (fd/interval 0 26)) (fd/eq (< afternoon morning) (> morning 0) (> afternoon 0)
(= (+ a b) 10) (= (+ c d) 16) (= (+ e f) 26) (= (+ (* morning a) (* afternoon b)) 3500) (= (+ (* morning c) (* afternoon d)) 3500) (= (+ (* morning e) (* afternoon f)) 3500)) (== q [morning afternoon a b c d e f])))
Spoiler warning, scroll right: ([375 125 9 1 6 10 1 25])(a + b - c) * d = 3500 cents
Since those are all integers, (a + b - c) must be a divisor of 3500. It must also be positive and <= 26. So it can possibly be 1, 2, 4, 5, 7, 10, 14, 20, 25. For each of these choices just solve a system of 2 linear equations to get the solution.
For example if a + b - c = 1 then d = 3500 and the price after lunchtime has to be 0. So they each sold exactly 1 chicken before lunchtime for $35 and gave away all the other chickens for free. It adds up!
Checking of the other solutions is left as an excercise to the reader.
ax + (10-a)y = 3500; bx + (16-b)y = 3500; cx + (26-c)y = 3500
Which is equivalent to (assuming x = y + d):
ad + 10y = 3500; bd + 16y = 3500; cd + 26y = 3500
How to solve it or to even determine it's uniquely solvable for arbitrary set of 10, 16, 26 and 35 - I don't know, but I'm pretty sure it's doable and has to do with the groups :)
I did the following:
- starting from farmer with 10 chicken, I checked for i = 0..5 (number of chicken possibly sold in the worse part of the day) whether a = 4,5,6,7,8... were working prices for the first half of the day, by calculating 35 - a * (10 - i) and checking whether the result was divisible by an integer in the range 1 .. a-1 (can be done quickly by writing down a table)
- with possible solutions for the first merchant (e.g. a = 7, b = 2, sold 3 for a and 7 for b), repeat for 2nd and 3rd merchant and find solutions that work there also (can limit the choices of a to prior solutions from merchant 1)
- (also, the second price must be 1 if integer due to 26 chicken sold at $35)
I'd assume that I either did some calculations wrong (my old head) or the teacher would at least either expect the kids to also check non-integer solutions (perhaps try 1.5, 2.5 etc.) or actually solve this:
a * x1 + b * (10-x1) = 35
a * x2 + b * (16-x2) = 35
a * x3 + b * (26-x3) = 35
a > b
x1 < 5 (unsure)
x2 < 8 (unsure)
x3 < 13 (unsure)
(x1, x2, x3 positive integers; a, b at least rational numbers?)Also, chickens are integers but prices are not is a core insight. Life gets easier if you solve a related problem which forces prices to be integers as well, such as an alternate universe where chickens are priced in nickels.
#ap, bp - prices before/after lunch
sell_distrib = [(a,b,c) for a in range(10) for b in range(16) for c in range(26) if a > b > c]
for bp in range(0, 3501):
for x in sell_distrib:
ap = (3500-x[0]*bp) // (10-x[0])
if x[0]*bp + (10-x[0])*ap == 3500 and \
x[1]*bp + (16-x[1])*ap == 3500 and \
x[2]*bp + (26-x[2])*ap == 3500:
print("Prices: {0} {1}".format(bp, ap))
print("Before lunch sales: {}, {}, {}".format(x[0], x[1], x[2]))
Note: it's Python 3 (the division!) and first line in the conditional eliminates cases where after lunch price wouldn't be a whole number because then it wouldn't add up to 3500.It doesn't consider cases where one farmer sold everything before lunch (supposedly sales didn't go so well). It's two lines of code more if we want to check those cases. Eliminating of 0 price and requirement that after lunch price is lower than before lunch one is covered by noticing that the solution then must have farmer A selling more than farmer B who in turn sell more than farmer C before lunch.
There is a unique solution in whole cents which is nice (no spoilers, you can copy-paste the code to Python interpreter to see it)
[(a, b, x, y, z) for a in xrange(1, 500) for b in xrange(1, a) for x in xrange(1, 11) for y in xrange(1, x) for z in xrange(1, y) if 3500 == a*x + b*(10 - x) == a*y + b*(16 - y) == a*z + b*(26 - z)] x >= 7/2 ($3.50)
0 < y <= 35/26 ($1.35 approx.)
There's a solution for any (x,y) in this region.Using the notation that the j_th farmer has an inventory of I_j, and sells a_j fractional chickens before lunch with revenue R_j ($35), the problem is a triple of linear equations:
{ a_j*x + (I_j - a_j)*y = R_j }_{j=1..3}
with solution a_j = (R_j - y*I_j)/(x - y)
Mathematica simplifies the set of inequalities (I count 8?) With[{r=35, is={10,16,26}},
Simplify[(0<y<x) &&
And @@ Table[0 <= (r - i*y)/(x-y) <= i, {i,is}]]]
returns 0 < y <= 35/26 && 2x >= 7 && x > y
(the last one's redundant)If the price must be > 0, assume the it is `a` cents before lunch, `b` cents after lunch, and farmers sold `x`, `y`, and `z` chickens before lunch, where `a`, `b`, `x`, `y`, `z` are all unsigned integers satisfying:
ax + b(10-x) = 3500
ay + b(16-y) = 3500
az + b(26-z) = 3500
Note 10 + 16 - 26 = 0, we can sum the above equations into: (a-b)(x + y - z) = 3500
let c = a - b, we know that c is positive integer (price before lunch is higher than after lunch). There are two obvious facts:1) c is a factor of 3500
2) since x + y - z <= 26, c must be >= 3500/26 = 134
We also know that 3500/c is integer, with the equations we know 10(b/c), 16(b/c), 26(b/c) are all unsigned integers, so 2b/c is unsigned integer, assume d = 2b/c, we have:
x = 3500/c - 5d
y = 3500/c - 8d
z = 3500/c - 13d
Remember that we are investigating the cases of b > 0, so d > 0, so 3500/c >= 13, then we have the fact:3) c <= 3500/13 = 269
with 1), 2), 3), c = 140, 175 or 250
when c = 140, 3500/c = 25, so d = 1, x = 25 - 5 * 1 = 20 > 10, not valid
when c = 175, 3500/c = 20, so d = 1, x = 20 - 5 * 1 = 15 > 10, not valid
when c = 250, 3500/c = 14, so d = 1, x, y, z are all valid, we get b = 125, a = 375
Answer: the price before lunch is $3.75, after lunch is $1.25
I'm all for giving kids more open-ended problems so that they get a chance to think and explore, but this one is ridiculous. They each sell one chicken for $35 in the morning and give the rest away in the afternoon is a valid solution and yet utterly, utterly wrong since the odds of something like that happening in real life are basically nil.
If you're going to give kids an under-constrained problem like this at least make the solution a line rather than a surface so that way you're only screwing with their heads some instead of a lot.
Honestly, I think this kind of attitude about problems is what is "effing ridiculous". There is huge value in learning to question the constraints of a problem.
They lowered the price and came back selling. It's just doesn't happen in the real life that people call giving away selling. Also in natural language you would expect significantly different wording if they all made 35$ before lunch and then decide to just give remaining chickens for free. Another thing is usage of the word sell. You would have hard time selling anyone an idea that sell could mean give away in the context.
Understanding how natural language works and being able to write reasonable constraints based on this description is an important skill. Assuming the price could be 0 in the afternoon is just an error on solvers side.
Since we're dealing with whole chickens, there should an integral ratio between the two prices--that is, M expensive chickens should be the same price as N cheap ones. To go from, say, 10 to 16 chickens requires replacing X chickens with X+6 chickens sold later but costing the same in total. Same with 10 to 26 or 16 to 26. The GCD between these differences (6, 10, and 16) is 2, implying N<=M+2. We also know N/M>=2.6, meaning to trade from 10 chickens to 26 you need to get at least 2.6 cheap chickens for every expensive one you replace. So there's only one exchange rate that works: one expensive chicken costs as much as three cheap ones. Using this exchange rate, 8 of the 10 chickens would have to be traded to get 24 out of 26, leaving two chickens for each farmer that were sold for the same total, but at unknown prices. Three possibilities (0, 1, or 2 at the expensive rate) is a pretty easy brute force at that point.
So no, there is no general technique apart from ingenuity, clever guesswork, and trial and error.
That's what I'm asking though: what is the ingenuity or cleverness required to solve this problem? The only technique I can think of is guess and check.
This 'bound tightening' is the 'ingenuity' required for the problem. There's no general process to achieve that, which is why it requires ingenuity :)
SPOILERS BELOW
To do that you have to notice the common factor in the initial equations.
Let n1, n2, and n3 be number of chickens sold pre-lunch time by each farmer. The initial equations are:
n1*x + (10-n1)*y = 35
n2*x + (16-n2)*y = 35
n3*x + (26-n3)*y = 35
Transforming them a little: n1 * (x - y) + 10y = 35 ;[1]
n2 * (x - y) + 16y = 35 ;[2]
n3 * (x - y) + 26y = 35 ;[3]
The common factor of (x-y) looks useful; you can establish relationships between n1, n2 and n3 with it: (n1 - n2) * (x - y) - 6y = 0 ;([1] - [2])
(n1 - n3) * (x - y) - 16y = 0 ;([1] - [3])
(n1 - n2) = 6 * (y / (x - y)) ;[4]
(n1 - n3) = 16 * (y / (x - y)) ;[5]
(n1 - n2) = 3/8 (n1 - n3) ;[6]
If you get there the puzzle is basically solved but for a bit of number crunching - you know n1, n2 and n3 are positive integers, n1 <= 10, so for [6] either n1=n2=n3 (trivial 0-post-lunch-price solution) or n1 - n2 = 3, n1 - n3 = 8. From there you substitute back into [4] and get 3 * (x-y) = 6y, so x = 3y.You now have simple relations between n1, n2 and n3; as well as between x and y. The remaining step is to tie x or y to one of the n's by substituting into initial equations. For example from [1]:
n1 * 2y + 10y = 35
2y = 35 / (n1 + 5)
y must be integral in pennies; that part is tricker to derive and the simplest solution is to just notice that since n1 >= 0, and n3 >= 0, and n1 = n3 + 8, then 8 <= n1 <= 10, and try 8, 9 and 10 for n1. With n1 = 9, you get y = 1.25. That's the only 'guess and check' part of the problem.(Have the price be in cents so that it will be an integer.)
Two mathematicians are meeting again after not having seen each other for a long time. They are discussing their lives, and mathematician A reveals to have three children. Mathematician B ask how old they are.
A: If you multiply their ages, you get 36. And if you sum up their ages, the result is actually the last two digits of your phone number.
She thinks for a moment, but then...
B: That's not enough information, can you tell me more?
A: Yes, you're right. Well, my oldest kid has blue eyes.
How old are A's kids?
(Yes, you can assume their ages to be integers.)
Much easier than the parent problem (at least now that we've seen how the parent problem unfolds).
Kids' ages: X, Y, and Z.
X * Y * Z = 36
CORRECTED: X + Y + Z ≥ 10 (the sum is two digits) [I had the ≥ backwards].
One triplet that works is 3, 3, and 4; also 1, 4, and 9.
EDIT: OK, I blew this one, I think --- see 'sunlr's correction below. (Note to 'sunlr: The problem as given is that the oldest kid has blue eyes, not the youngest. That fact doesn't eliminate twins --- all the kids could have blue eyes.)
I don't understand this part. Surely every number between 10 and 99 (inclusive) has two digits? And numbers <10 have only one digit? Have I forgotten how to count to 2?
If we use your interpretation then the fact there is an oldest child is redundant; but if we don't then the fact that the sum is two digits is redundant, and there are multiple solutions.
The 'oldest child' thing rules out 6, 6, 1 as the answer, but afaict 18, 2, 1 and 12, 3, 1 and 9, 4, 1 and 9, 2, 2 and 6, 3, 2 are still valid solutions as well as 4, 3, 3.
Not in a phone number.
Also you have the sign reversed. Should be x + y + z >= 10.
I don't believe so, because regardless of which child has blue eyes, it doesn't eliminate the possibility that either or both of the other children also have blue eyes. If the statement was qualified with an "only", then you could eliminate twins.
3 + 3 + 4 = 10
1 + 4 + 9 = 14
2 + 2 + 9 = 13
1 + 6 + 6 = 13
If the sum is 10 or 14, B would have had enough information for the answer at once. So the sum should be 13.And "oldest kid" is not "oldest kids", so 2, 2, 9 is the answer.
Otherwise you could say the price before lunch was $35 and each sold one chicken, and the price after lunch was $0 and each sold all the rest of their chickens.
> George Grech made himself known in the early years of trading when Astra Billiards began opening on a Sunday. Sunday trading was illegal and due to unpaid fines, George Grech was the first shopkeeper to be jailed for trading on a Sunday.
> George made front page headlines of the Herald Sun on a number of occasions.
> History shows at that time, booksellers were one of the few shops allowed to trade on a Sunday. “George & Helen Grech Booksellers” was born. Helen & George would sell a book for a price of a billiard table and give a billiard table for free with every purchase.
Fun story! I think English judges look at the intent of the law, not just narrow wording, so he would still have been in trouble if he'd tried it over here. (I am just guessing here though)
If he had been taken to court, I imagine he would have lost, because by that time they have to apply the law. But I imagine the people who would apply the summons simply used discretion; it wasn't like this behaviour was rife.
Let p be the prices after lunch, let d be the difference in the prices, and let a, b, c be the number of chickens each farmer sold before and after lunch. Then
3500 = ad + 10p = bd + 16p = cd + 26p. This gives us the following equation:
3500 = d * (a + b - c). Thus d and (a + b - c) must divide 3500.
Now, note that (a - b)d = 6p. Thus 3 divides (a - b)d. But d is a divisor of 3500, so 3 cannot divide d, thus 3 must divide a - b. Since 10 >= a > b > c >= 0, this means a = b + 3 or a = b + 6. Similarly 4 must divide a - c, so a = c + 4 or a = c + 8. Finally, (b - c)d = 10p = (5/3)* 6p = (5/3) * (a - b)d.
Dividing by d we get b - c = (5/3) * (a - b). Since a - b is 3 or 6, that means b - c is 5 or 10.
The only set of possibilities that satisfies (a = c + 4 or c + 8, a = b + 3 or b + 6, b = c + 5 or c + 10, a <= 10) is (a, b, c) = (a, a - 3, a - 8).
Since a <= 10, c must be 0, 1, or 2. If c = 0, then we get 3500 = cd + 26p = 26p, which is impossible since 3500 is not divisible by 13. If c = 2, then 3500 = d * (a + b - c) = d * 15, which is impossible since 3500 is not divisible by 3. Thus c = 1, b = 6, a = 9 is the only possibility.
model "chicken"
uses "mmxnlp"
declarations
a,b: mpvar;
x,y,u,v,t,z: mpvar;
end-declarations
x is_integer
y is_integer
u is_integer
v is_integer
t is_integer
z is_integer
a*x+b*y=35
a*u+b*v=35
a*t+b*z=35
x+y=10
u+v=16
t+z=26
a>=b
end-model
The solution can be found by a non-convex optimization solver in a fraction of a second. Spoiler: scroll right for the answer. a = 3.75, b = 1.25, x = 9, y = 1, u = 6, v = 10, t = 1, z = 25
[edit: clarification] Farmer 1 has 10 chickens.
Farmer 2 has 16 chickens.
Farmer 3 has 26 chickens.
Price before lunch: x
Price after lunch: y
# of chickens sold before lunch by farmers 1, 2, 3: a, b, c
Total earned by each farmer: $35
We're told that, x > y
and can logically deduce that, a > b > c
because otherwise, the farmers with less chickens would have no chance of making the same amount as the other farmer.*From this information, we know that:
ax + (10 - a)y = bx + (16 - b)y = cx + (26 - c)y = 35
Let's isolate the first and second farmers here: ax + (10 - a)y = bx + (16 - b)y
ax - ay + 10y + bx - by + 16y = 0
(a - b)(x - y) = 6y
We can do the same between farmers 1 and 3: (a - c)(x - y) = 16y
These two formulas yield, (a - b) = (3 / 8)(a - c)
Since a > b > c, (a - b) > 0
(a - c) > 0
Since farmer 1 only has 10 chickens, a ≤ 10
Since you can't sell negative chickens, b ≥ 0
c ≥ 0
And since the problem isn't very interesting if the farmers are allowed to sell half-chickens, a, b, and c (and the difference between them) are integers.Given all of this, 0 ≤ (a - b), (a - c) ≤ 10. The only numbers that satisfy this and,
(a - b) = (3 / 8)(a - c)
are, (a - b) = 3
(a - c) = 8
Since c ≥ 0 and a ≤ 10, we have three triplets to consider: a = 10: {10, 7, 1}
a = 9: {9, 6, 1}
a = 8: {8, 5, 0}
We can find the relationship between x and y from an earlier equation: (a - b)(x - y) = 6y
3(x - y) = 6y
3x = 9y
x = 3y
So the farmers reduced their price to a third of the original price during the afternoon. What a deal!We've got a few equations that look like,
ax + (10 - a)y = 35
Which we can now simplify to, 2ay + 10y = 35
By plugging [10, 9, 8] into the above formula, the only value that gives us a proper dollar amount for y is a = 9.So...
y = $1.25
x = $4.25
Reading through the G+ comments it looks like someone beat me to it, but I figured I'd share my solution anyway.*This is assuming that they didn't decide to "sell" their chickens for $0 in the afternoon, which is probably a safe bet.
Edit: add intermediate steps for clarity
def check(n,am,pm,total):
for x in range(1,n):
if (am * x + pm * (n-x)) == total:
return "AM: %d @ %d / PM %d @ %d" % (x,am,n-x,pm)
return None
def solve(total,birds):
for am in range(1,total):
for pm in range(1,am):
result = list(map(lambda n:check(n,am,pm,total),birds))
if all(result):
return result
print(solve(3500,[10,16,26]))oh my. this is why one shouldn't do math at 4am.
:s/4.25/3.75
Selling something involves receiving money for it. You can't "sell" something for no money at all, because that's not what the word means! Zero dollars is not money, it is literally nothing.
Check any dictionary, or test this with any of your friends: "Here, take this chicken. Don't give me any money for it. It's free. Now, did I sell it to you or give it to you?"
Beware of overly clever solutions to a problem. The cleverness of the solution may blind you to the fact that you've simply misread the question or misunderstood the plain wording of the words.
Writing down equations:
x*a + (10 - x)*b = 3500
y*a + (16 - y)*b = 3500
z*a + (26 - z)*b = 3500
x*a + (10 - x)*b + y*a + (16 - y)*b + z*a + (26 - z)*b = 3 * 3500
(x + y + z)*a + (10 - x + 16 - y + 26 - z)*b = 10500
(x + y + z)*a + (52 - (x + y + z))*b = 10500
p = x + y + z
p*a + (52 - p)*b = 10500
a = (10500 - (52 - p)*b) / p
p is the total number of chickens sold before the break. Obviously this can't be negative nor more than 52.
At least 1 chicken must be sold both before and after the break, because 52 is not a factor of 10500.
So 0 < p < 52.We know that b < a so b < (10500 - (52 - p) * b) / p.
b < (10500 - (52 - p)*b) / p
b*p < 10500 - (52 - p)*b
b*p + (52 - p)*b < 10500
b*52 < 10500
b < 202
This is easy to bruteforce: for p in range(1, 52):
for b in range(1, 202):
if (10500 - (52 - p)*b) % p == 0:
a = (10500 - (52 - p)*b) // p
if ((3500 - 10*b) % (a - b) == 0
and (3500 - 16*b) % (a - b) == 0
and (3500 - 26*b) % (a - b) == 0):
x = (3500 - 10*b) // (a - b)
y = (3500 - 16*b) // (a - b)
z = (3500 - 26*b) // (a - b)
if 0 <= x <= 10 and 0 <= y <= 16 and 0 <= z <= 26:
print("Before the break one chicken cost ${:.2f} and the farmers sold ({}, {}, {}).".format(a / 100, x, y, z))
print("After the break one chicken cost ${:.2f} and the farmers sold ({}, {}, {}).".format(b / 100, 10-x, 16-y, 26-z))
Spoiler: Before the break one chicken cost $3.75 and the farmers sold (9, 6, 1).
After the break one chicken cost $1.25 and the farmers sold (1, 10, 25).before: $3.75, after: 1.25
A "dime" is 10 cents, which makes the famous bags seem very cheap.
* Step 1: Disguise unsolved problem as homework assignment and give it Terry's son to solve.
* Step 2: Muhahahaha
Price after lunch = y
Chickens sold before lunch for each farmer respectively (ace)
Chickens sold after lunch for each farmer respectively (bdf)
Solve these six equations:
Farmer 1:
35 = x*a + y*b
a + b = 10
Farmer 2: 35 = x*c + y*d
c + d = 16
Farmer 3: 35 = x*e + x*f
e + f = 26
If we assume they sold the same amount of chickens before lunch as the price was the same, then a = c = e. This reduces it to 6 equations for 6 variables.That'd be no fun in the puzzle then, wouldn't it? :)