100 units for $100

wsd

Verified User
Joined
Jul 9, 2010
Messages
48
Location
Denmark
A hosting provider will sell a package containing 100 units for $100

Domains for $10 piece
Hosting for $3 piece
pop3 accounts to $0.50 piece

He should have at least one of each unit and the 100 units he needs $100

Here is the question - how many kinds of each unit, he sells out of 3 different units, and do not forget that it is 100 units for $100 :)
 
Hello,

with your prices, there is no solution, as it seems to me:


PHP:
#!/bin/php
<?php
for ($z=1; $z<=100; $z++) {
    for ($y=1; $y<=100; $y++) {
        for ($x=1; $x<=100; $x++) {
            if (($z+$y+$x) === 100) {
                $price = $z*0.50 + $y*3 + 10*$x;
                //print "$z $y $x = $price USD \n";
                if ((int) $price === 100) {
                    print "BINGO: $z $y $x\n";
                }
            }
        }
    }
 }
?>
 
Last edited:
PHP:
<?php 
for ($z=1; $z<=100; $z++) { 
    for ($y=1; $y<=100; $y++) { 
        for ($x=1; $x<=100; $x++) { 
            if (($z+$y+$x) === 100) { 
                $price = $z*10 + $y*3 + $x*0.50;
               // print "$z $y $x = $price USD \n"; 
                if ($price === 100.0) { 
                    print "BINGO: $z $y $x $price\n"; 
                } 
            } 
        } 
    } 
 } 
?>

($price === 100.0)
 
Hmm, right you are. And my mistake. Here are results:

BINGO: 91 5 4
BINGO: 94 1 5
 
So

Domains for $10 piece - 4
Hosting for $3 piece - 5
pop3 accounts to $0.50 piece - 91

or

Domains for $10 piece - 5
Hosting for $3 piece - 1
pop3 accounts to $0.50 piece - 94
 
Hi Alex,

It is probably the most serious solution I've seen on this joke.
 
Domains for $10 piece - 5
Hosting for $3 piece - 1
pop3 accounts to $0.50 piece - 94
 
Yes, it's a joke, but it's a good joke for it to be used to make it much easier to figure out a packet mix, and I remembered this joke.

So many thanks to you Alex

5 1 94 = 100 USD
10 2 188 = 200 USD
15 3 282 = 300 USD
 
Last edited:
You're welcome. But how can it be calculated mathematically?

Units: X + Y + Z = 100
Price: Z*10 + Y*3 + X*0.50 = 100

Z stands for Domains
Y stands for Hosting
X stands for pop3 accounts

It's much easier for me to write a small program, than to do math.
 
OK, just for an interest, if anybody knows how to solve the equation, or has a link on a solution, I'd like you to share it.
 
Back
Top