For how many pairs of positive integers (x,y) is x+3y equal to 100?
Source
I think positive integers start at 1, don’t they?
We can continue this:
y=2
x = 100 - 3*2 = 94
…
until
y = 33
x = 100 - 3*33 = 1
for higher values of y there’s no positive x:
y = 34
x = 100 - 3*34 = 100 - 102 = -2
So, there are 33 pairs, from y=1 to y =33.
If you said “non negative integers” instead of positive integers, there would be 34 pairs: from y=0 to y=33.
It’s just that easy.
Why did I choose the y to try values?
Well, the x can be solved as an integer for every y : x = 100 - 3*y
100 - 3*y is always an integer.
But if you try some x and solve for y you can’t find always an integer:
3y = 100 - x
y = (100 - x) / 3
and (100 - x) / 3 is not always an integer.
Comments
Post a Comment