June 28, 2006 3:46 AM Subscribe

Math help. (Practical, I'm not in school!)

n = xy

a = x/y

If I know the values of "n" and "a", can I calculate what x and y are?
posted by Mwongozi to Science & Nature (7 answers total) 1 user marked this as a favorite

n = xy

a = x/y

If I know the values of "n" and "a", can I calculate what x and y are?

Yes.

x = n/y

then

a = x/y = (n/y)/y = n/(y^2)

solve for y

a/n = 1/y^2 --> n/a = y^2 --> y = sqrt(n/a)

Then

x = n/y = n/sqrt(n/a) = sqrt(n a)

posted by gregvr at 4:08 AM on June 28, 2006

x = n/y

then

a = x/y = (n/y)/y = n/(y^2)

solve for y

a/n = 1/y^2 --> n/a = y^2 --> y = sqrt(n/a)

Then

x = n/y = n/sqrt(n/a) = sqrt(n a)

posted by gregvr at 4:08 AM on June 28, 2006

The algebra above is correct. I'll just add that sometimes you can calculate x and y, but sometimes not. (Assuming real numbers.) It depends on what a and n are:

If an<0 there are no solutions for x and y.

If a=0 and n=0 there are infinite solutions for x and y.

If a=0 and n!=0 there are no solutions for x and y.

If a!=0 and n=0 there are no solutions for x and y.

If an>0 there are two solutions for x and y.

posted by blue mustard at 4:22 AM on June 28, 2006

If an<0 there are no solutions for x and y.

If a=0 and n=0 there are infinite solutions for x and y.

If a=0 and n!=0 there are no solutions for x and y.

If a!=0 and n=0 there are no solutions for x and y.

If an>0 there are two solutions for x and y.

posted by blue mustard at 4:22 AM on June 28, 2006

Thanks all. In case anyone's wondering, the practical application of this is working out the resolution of a digital camera - it seems these days they only tell you the number of pixels and not the actual resolution.

With the above formula, you can figure out what it is, as long as you know the aspect ratio. (Most are 4:3 = 1.33, but some are 3:2 = 1.5.)

posted by Mwongozi at 4:49 AM on June 28, 2006

With the above formula, you can figure out what it is, as long as you know the aspect ratio. (Most are 4:3 = 1.33, but some are 3:2 = 1.5.)

posted by Mwongozi at 4:49 AM on June 28, 2006

Do keep in mind that the number of pixels they give is always rounded pretty severely.

For example, a 3.1 megapixel camera doesn't have 3100000 pixels (3.1 * 1E7) or 3250585.6 pixels (3.1 * 2^20, where mega- is used as it would be for megabytes). Instead, it's 3145728 pixels, which corresponds to a resolution of 2048x1536. (If solve with 3100000 and 4:3, you'd get 2033X1525.)

Anyhow, my (hopefully obvious) caveat is that you need to take the numbers you get with this algorithm as an approximation. That having been said, the difference between 2048x1536 and 2033x1525 should be pretty inconsequential if you're just looking for a general idea.

posted by JMOZ at 10:25 AM on June 28, 2006

For example, a 3.1 megapixel camera doesn't have 3100000 pixels (3.1 * 1E7) or 3250585.6 pixels (3.1 * 2^20, where mega- is used as it would be for megabytes). Instead, it's 3145728 pixels, which corresponds to a resolution of 2048x1536. (If solve with 3100000 and 4:3, you'd get 2033X1525.)

Anyhow, my (hopefully obvious) caveat is that you need to take the numbers you get with this algorithm as an approximation. That having been said, the difference between 2048x1536 and 2033x1525 should be pretty inconsequential if you're just looking for a general idea.

posted by JMOZ at 10:25 AM on June 28, 2006

If this is a camera you already own, you could always just set it to the maximum resolution, take a picture, transfer the file to a computer, and use any imaging program to find the dimensions of the image.

posted by epugachev at 1:08 PM on June 28, 2006

posted by epugachev at 1:08 PM on June 28, 2006

This thread is closed to new comments.

rewrite your first equation to be

x = n/y

Then you plug into the second equation to get:

a = n/y^2

Thus y^2 = n/a, so you can solve for y if you have n and a (although you won't know whether it is positive or negative).

Once you have y, you know that x = ya, so plug in for x.

posted by allen.spaulding at 4:05 AM on June 28, 2006