Re: [PHP] help me to solve this math maze
2007. 04. 4, szerda keltezéssel 12.44-kor Faisal Murad ezt írta: i am making a program to give money to a group of people lets say that i have to distribute 3000 among 12 people 6 of them are adult and will get 100% 6 them are children those will get 75% from the overall amount. a common solution might appear as divide 3000 to 12 which is 250 give 250 to adults and 75% percent of it to children which is 187.5 after this kind of calculation i have 375 more to give which was supposed to be equally distributed among them can anyone understand my problem and assists me. $adultmoney = $totalmoney / ($adultnumber + 0.75 * $childnumber); $childmoney = 0.75 * $adultmoney; greets Zoltán Németh faisal -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] help me to solve this math maze
You'll give 100 'units' to 6 of them, and 75 to 6, thus: 6 * 100 + 6 * 75 == 1050 units Each 'unit' is valued at: 3000 / 1050 == 2.8571 Thus, you give: 6 * 285.71 + 6 * 214.28 == 2999.94, and you may keep the change ;-) Satyam - Original Message - From: Faisal Murad [EMAIL PROTECTED] To: php-general@lists.php.net Sent: Wednesday, April 04, 2007 11:44 AM Subject: [PHP] help me to solve this math maze i am making a program to give money to a group of people lets say that i have to distribute 3000 among 12 people 6 of them are adult and will get 100% 6 them are children those will get 75% from the overall amount. a common solution might appear as divide 3000 to 12 which is 250 give 250 to adults and 75% percent of it to children which is 187.5 after this kind of calculation i have 375 more to give which was supposed to be equally distributed among them can anyone understand my problem and assists me. faisal No virus found in this incoming message. Checked by AVG Free Edition. Version: 7.5.446 / Virus Database: 268.18.25/745 - Release Date: 03/04/2007 12:48 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] help me to solve this math maze
Satyam wrote: You'll give 100 'units' to 6 of them, and 75 to 6, thus: 6 * 100 + 6 * 75 == 1050 units Each 'unit' is valued at: 3000 / 1050 == 2.8571 Thus, you give: 6 * 285.71 + 6 * 214.28 == 2999.94, and you may keep the change ;-) pity you don't work as bank director Satyam (notice that in real life it's the bank that always pockets the change ;-) Satyam - Original Message - From: Faisal Murad [EMAIL PROTECTED] To: php-general@lists.php.net Sent: Wednesday, April 04, 2007 11:44 AM Subject: [PHP] help me to solve this math maze i am making a program to give money to a group of people lets say that i have to distribute 3000 among 12 people 6 of them are adult and will get 100% 6 them are children those will get 75% from the overall amount. a common solution might appear as divide 3000 to 12 which is 250 give 250 to adults and 75% percent of it to children which is 187.5 after this kind of calculation i have 375 more to give which was supposed to be equally distributed among them can anyone understand my problem and assists me. faisal No virus found in this incoming message. Checked by AVG Free Edition. Version: 7.5.446 / Virus Database: 268.18.25/745 - Release Date: 03/04/2007 12:48 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] help me to solve this math maze
At 12:44 PM +0300 4/4/07, Faisal Murad wrote: i am making a program to give money to a group of people lets say that i have to distribute 3000 among 12 people 6 of them are adult and will get 100% 6 them are children those will get 75% from the overall amount. a common solution might appear as divide 3000 to 12 which is 250 give 250 to adults and 75% percent of it to children which is 187.5 after this kind of calculation i have 375 more to give which was supposed to be equally distributed among them can anyone understand my problem and assists me. faisal Considering that others provided a solution, here's mine. What's left over send to me. :-) tedd -- --- http://sperling.com http://ancientstones.com http://earthstones.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php