✔ 最佳答案
Q: 去一個 party, 成人收 $10, 老人收 $0.5, 小童收 $0.1, party 當晚有 100 人
共收 $100, 請問幾多成人? 幾多老人? 及幾多小童? 要列出公程式?
Sol:
Let
x be the number of Adults,
y is the number of seniors,
z is the number of children
where x, y, z are positive integer numbers and x < 10, y < 100, z < 100
then
x + y + z = 100 ....... ( 1 )
10x + 0.5y + 0.1z = 100
100x + 5y + z = 1000 ....... ( 2 )
( 2 ) - ( 1 )
99x + 4y = 900
4y = 900 - 99x
y = 225 - 99x / 4
because y is an integer, therefore x must be the multiple of 4
when x = 4
y = 225 - 99 = 126 > 100 ( rejected )
when x = 8
y = 225 - 198 = 27
8 + 27 + z = 100
z = 65
x, y, z substitute in to ( 2 )
100 * 8 + 27 * 0.5 + 65 * 0.1
= 80 + 13.5 + 6.5
= 100
x = 8, y = 27, z = 65 is the possibility combination,
also there is no more possibility combination
Hence, x = 8, y = 27, z = 65 is the only one answer for the question.
Ans: 成人 8 人, 老人 27 人, 小童 65 人