# Thread: Help with Simple Math Problem Needed

1. ## Help with Simple Math Problem Needed

This is a real life problem, but I hope it is ok that I posted it here.

I have an inaccurate postal scale.

I compiled a list of weights given by the incorrect scale versus the correct weights that it should have given.

If I plot them on a graph, they are both straight lines. The incorrect scale weights are lower than the correct weights. The margin of error slowly increases as the amount of weight increases.

It seems that I should be able to derive a formula to calculate the correct weight from the incorrect weight using this data, since there is a definite consistent relationship between the two.

In an abstract sense, if I have 2 straight lines plotted on a graph, starting at 0 and gradually growing apart, how do figure out the formula which describes the relationship between them?

I need to figure out this out for tomorrow, for extremely boring and intricate reasons. Any help would be greatly appreciated as my few years of math studies are far in the past.

Max

2. Originally Posted by max6166
This is a real life problem, but I hope it is ok that I posted it here.

I have an inaccurate postal scale.

I compiled a list of weights given by the incorrect scale versus the correct weights that it should have given.

If I plot them on a graph, they are both straight lines. The incorrect scale weights are lower than the correct weights. The margin of error slowly increases as the amount of weight increases.

It seems that I should be able to derive a formula to calculate the correct weight from the incorrect weight using this data, since there is a definite consistent relationship between the two.

In an abstract sense, if I have 2 straight lines plotted on a graph, starting at 0 and gradually growing apart, how do figure out the formula which describes the relationship between them?

I need to figure out this out for tomorrow, for extremely boring and intricate reasons. Any help would be greatly appreciated as my few years of math studies are far in the past.
These values are being plotted against the actual weight?

So if I understand you correctly, you have a line, which we may consider as a function $\displaystyle f$ of $\displaystyle x$, which gives the measured weight $\displaystyle f(x)$ in terms of the actual weight $\displaystyle x$?

In that case you don't need both lines. If you have the measured weight, the actual weight will be given by $\displaystyle f^{-1}(x)$.

In other words, if your scale produces a reading $\displaystyle y$ when measuring an object of weight $\displaystyle x$ such that $\displaystyle y = ax + b,$ (since you said there was a linear relationship), then given a measured value $\displaystyle y$, you can find the actual weight to be

$\displaystyle x = \frac{y - b}a.$

It is as simple as that, unless I misinterpreted your problem.

3. Originally Posted by Reckoner
These values are being plotted against the actual weight?

So if I understand you correctly, you have a line, which we may consider as a function $\displaystyle f$ of $\displaystyle x$, which gives the measured weight $\displaystyle f(x)$ in terms of the actual weight $\displaystyle x$?

In that case you don't need both lines. If you have the measured weight, the actual weight will be given by $\displaystyle f^{-1}(x)$.

In other words, if your scale produces a reading $\displaystyle y$ when measuring an object of weight $\displaystyle x$ such that $\displaystyle y = ax + b,$ (since you said there was a linear relationship), then given a measured value $\displaystyle y$, you can find the actual weight to be

$\displaystyle x = \frac{y - b}a.$

It is as simple as that, unless I misinterpreted your problem.
Hi Reckoner,

Unfortunately, I do not really understand your explanation very well. From the little I can understand, however, I think my initial description may have been imprecise, as I do not think I have a function plotted.

It might be better if I explained it this way. Say I have ten 500 gram weights. I added the 500 gram weights to the scale one at a time, and recorded the weights the incorrect scale gave. This results in a series of measurements for the values 0 - 5kg.

Plotting these values on a graph (with the number of weights and the y axis and the weight on the x axis) results in a straight line. The correct values for those weights is also a straight line.

The incorrect values are less than the correct values, and the distance between the 2 lines grows wider as the weight increases.

I apologize for any confusion.

Max

4. Originally Posted by max6166
Hi Reckoner,

Unfortunately, I do not really understand your explanation very well. From the little I can understand, however, I think my initial description may have been imprecise, as I do not think I have a function plotted.

It might be better if I explained it this way. Say I have ten 500 gram weights. I added the 500 gram weights to the scale one at a time, and recorded the weights the incorrect scale gave. This results in a series of measurements for the values 0 - 5kg.

Plotting these values on a graph (with the number of weights and the y axis and the weight on the x axis) results in a straight line. The correct values for those weights is also a straight line.
That is exactly how I interpreted your original post, and my result still stands.

You have a line plotted (which means you have a function), and you have a clear relationship between the two variables, correct? It should be quite simple to solve for one variable in terms of the other.

The line can be represented by an equation of the form $\displaystyle y = ax + b$, for real numbers $\displaystyle a$ and $\displaystyle b$ (have you found this equation? If not, use least-squares regression or some similar method to get it; ask if you need help). From there, $\displaystyle y$ represents the measured value, and $\displaystyle x$ the actual value. So you simply solve for $\displaystyle x$, as I demonstrated before.

Edit: Let me put it to you this way:

You have some known weights which you measure with your scale to produce inaccurate weights. These values are all known, so you can consider each weight and measurement as the coordinates of a point on a curve: the $\displaystyle x$-coordinate being the actual weight, and the $\displaystyle y$-coordinate being the measured weight. You have done this, and you have a line (or something that resembles a line reasonably closely). This means that you can find the slope of the line, and its $\displaystyle y$-intercept, and using these you can represent the line as an equation that relates $\displaystyle x$ to $\displaystyle y$.

Thus, the solution to your problem comes down to this: if you have an object of known weight, you are able to simply locate the point on the line with that $\displaystyle x$-coordinate, and the $\displaystyle y$-coordinate will be the measured weight (which would be the reading you would get off of your scale). But your problem is the reverse: you have a measured weight, and you wish to find the actual weight. Thus you find the point on the line with the particular $\displaystyle y$-coordinate, and the $\displaystyle x$-coordinate of that point will be the actual weight.

So how do you put this into a convenient formula where you can just "plug in" the measured value? Simple: as I said, you already know the measured value in terms of the actual value ($\displaystyle y = ax + b$), so you just solve for the actual value in terms of the measured value $\displaystyle \left(x = \frac{y - b}a\right)$. So if your scale gives a measurement of $\displaystyle m$, the actual weight would be $\displaystyle w = \frac{m - b}a$. Does that make sense?

5. Originally Posted by Reckoner
That is exactly how I interpreted your original post, and my result still stands.

You have a line plotted (which means you have a function), and you have a clear relationship between the two variables, correct? It should be quite simple to solve for one variable in terms of the other.

The line can be represented by an equation of the form $\displaystyle y = ax + b$, for real numbers $\displaystyle a$ and $\displaystyle b$ (have you found this equation? If not, use least-squares regression or some similar method to get it; ask if you need help). From there, $\displaystyle y$ represents the measured value, and $\displaystyle x$ the actual value. So you simply solve for $\displaystyle x$, as I demonstrated before.
Thanks Reckoner. I *think* I am following you now. I was thrown because I didn't know what the variables a and b represented (I still don't really) in the equation y = ax +b

I just skimmed through the Wikipedia page on least squares regression. I am afraid it is far beyond my rudimentary math skills. This stuff is on a whole different level than anything I have dealt with previously. I don't understand even a single symbol on that page...

At the very least, this doesn't seem like something I am going to be able to figure out in time. I had mistakenly assumed there was a much simpler solution.

I might still try it anyway, but I have no idea where to start. Where can I learn what those symbols mean so that I can decipher the least squares regression equations?

6. Originally Posted by Reckoner
Edit: Let me put it to you this way:

You have some known weights which you measure with your scale to produce inaccurate weights. These values are all known, so you can consider each weight and measurement as the coordinates of a point on a curve: the $\displaystyle x$-coordinate being the actual weight, and the $\displaystyle y$-coordinate being the measured weight. You have done this, and you have a line (or something that resembles a line reasonably closely). This means that you can find the slope of the line, and its $\displaystyle y$-intercept, and using these you can represent the line as an equation that relates $\displaystyle x$ to $\displaystyle y$.

Thus, the solution to your problem comes down to this: if you have an object of known weight, you are able to simply locate the point on the line with that $\displaystyle x$-coordinate, and the $\displaystyle y$-coordinate will be the measured weight (which would be the reading you would get off of your scale). But your problem is the reverse: you have a measured weight, and you wish to find the actual weight. Thus you find the point on the line with the particular $\displaystyle y$-coordinate, and the $\displaystyle x$-coordinate of that point will be the actual weight.

So how do you put this into a convenient formula where you can just "plug in" the measured value? Simple: as I said, you already know the measured value in terms of the actual value ($\displaystyle y = ax + b$), so you just solve for the actual value in terms of the measured value $\displaystyle \left(x = \frac{y - b}a\right)$. So if your scale gives a measurement of $\displaystyle m$, the actual weight would be $\displaystyle w = \frac{m - b}a$. Does that make sense?

Thanks again. The edit was very helpful. I was not thinking of the problem that way.

I was able to follow your explanation up until the point where it is converted into an equation. The sticking point is that I don't understand what the variables a and b represent. The rest makes sense to me.

I must go to bed now, but will try and work it through again in the morning.

Thanks again for your time and trouble,
Max

7. Originally Posted by max6166
I might still try it anyway, but I have no idea where to start. Where can I learn what those symbols mean so that I can decipher the least squares regression equations?
Ah, okay. So you haven't actually found an equation for this line of yours yet.

Here is a simple method: plot your points, draw the line. Pick two points on the line, $\displaystyle (x_0,\;y_0)$ and $\displaystyle (x_1,\;y_1)$. The "slope" of the line will be

$\displaystyle m = \frac{y_1 - y_0}{x_1 - x_0}.$

This value is the $\displaystyle a$ in the equation I gave you. $\displaystyle b$ is the $\displaystyle y$-intercept (I imagine the scale is calibrated to give a reading of 0 when no weight is on it, so the $\displaystyle y$-intercept should then be 0).

Once you determine those, you have your equation.

Now, the equation you get depends on which points you pick to find the slope (ideally they are all in a perfectly straight line, but that is usually never the case when actual measurements are involved). So, you may wish to use a regression method if you want to find the line that best fits the data. However, if you plot the points and draw your line, and all the points lie pretty close to the line, or if a high accuracy isn't needed, then the above method should work fine. If your points only very loosely form a line though, you may wish to consider a method for finding a more optimal model (which doesn't necessarily have to be a line).

Edit: Sorry I didn't catch you before bed! Good luck with your work!

8. Wow Reckoner! It only took a few minutes to figure out with that explanation.

So now, I can just divide any weight on that scale by the slope of my data to get the correct weight. And the slope is just 0.9, which makes makes the whole thing fairly trivial. It seems to work. Fantastic!

This got me thinking of a last step. The scale is a typical postal scale with a round clock-like face:

The existing 360 degree dial goes from 0 to 20kg. Since I know the real weight is that amount divided by 0.9, I should be able to print out a little replacement dial to go in the centre of the faceplate.

I think I can work through this in a manual grunt fashion. I could use a protractor to record the degrees at which the major kg markings lie and divide them by .9. I could then divide the spaces in between by 10. I could then scan that into a graphics program, clean it up, and print it out.

I am pretty sure a program exists that I could use that would just chart this all for me, but I have no idea what it would be. Any suggestions or pointers would be appreciated, of course.

Thanks again for all your time and help. I can't believe I actually understand how it works. Great explanations!

Take care,
Mark

9. Originally Posted by max6166
The existing 360 degree dial goes from 0 to 20kg. Since I know the real weight is that amount divided by 0.9, I should be able to print out a little replacement dial to go in the centre of the faceplate.

I think I can work through this in a manual grunt fashion. I could use a protractor to record the degrees at which the major kg markings lie and divide them by .9. I could then divide the spaces in between by 10. I could then scan that into a graphics program, clean it up, and print it out.
Perhaps I can help with the markings on the new face:

One full revolution around the dial corresponds to 20 (measured) kilograms. We can then express the measurement reported on the dial as a function of the angle between the needle and the axis (we'll use the zero point as the axis):

$\displaystyle m = \frac{20\,\theta}{360^\circ} = \frac{20\,\theta}{2\pi} = \frac{10\,\theta}\pi$

Now we already know that if a measurement $\displaystyle m$ is reported, the actual weight will be

$\displaystyle w = \frac m{0.9} = \frac{10m}9 = \frac{10(10\,\theta / \pi)}9 = \frac{100\,\theta}{9\pi}$

Solving for $\displaystyle \theta$,

$\displaystyle \theta = \frac{9\pi w}{100}$

So what does this mean? It means that if we want to know where the marking for a weight of $\displaystyle w$ should go on the dial, we substitute it into the above equation to get the angle.

Now, suppose we want to make a marking for a particular weight (for example, you will probably want markings for 1, 2, 3, ... kilograms). Call the weight $\displaystyle w$. For simplicity, let us allow the marking to be a single point that lies some given distance $\displaystyle t$ away from the origin (the center of the dial). Then we will have something that looks like this:

Code:
  0
|
|    x      M
-+----------o
|         /|
|       /  |
y |   t /    |
|θ  /      |
| /        |
-o----------+---
Looking at this triangle, we know from simple trigonometry that the coordinates of our marking $\displaystyle M$ will be

$\displaystyle M = (t\sin\theta,\;t\cos\theta)$

$\displaystyle = \left(t\sin\left(\frac{9\pi w}{100}\right),\;t\cos\left(\frac{9\pi w}{100}\right)\right).$

Letting $\displaystyle t$ vary between two positive values will give us a line segment. This line segment can be used as a marking for that particular weight. For example, if you were constructing the new face to have markings 5 cm from the center of the dial (let's say), you wanted each marking to be 1 cm in length, and you wanted to make markings at each whole number weight in kilograms, you could simply graph the parametric equations

$\displaystyle x = t\sin\left(\frac{9\pi w}{100}\right),\;4.5\le t\le5.5$

$\displaystyle y = t\cos\left(\frac{9\pi w}{100}\right),\;4.5\le t\le5.5$

for each positive integer $\displaystyle w$ between 0 and 20 or so. The process is similar for other measurements.

Below is an example that I made using the plotting capabilities of the open source program Maxima, by plotting 220 lines to give 22 whole value markings each with 10 subdivisions (I used different thicknesses to make the markings properly readable; the numbers were added separately in Paint Shop Pro).

10. Thanks so much, Reckoner. You really didn't have to go to all the trouble of making an image and even numbering it. I am really blown away by how helpful you have been.

After reading your walkthrough a few times, I am now able to follow the general logic of the approach you gave. There is some knowledge assumed within each step which I don't possess (I didn't even know what the theta symbol meant until now, for example), but I have deciphered enough to understand the purpose and logic of each step at least.

I am essentially a high school drop out, so some things, like least squares regression, assume more advanced math skills than I possess. I have developed some interest in math recently though. I think that is partially why I wanted to "figure out" the scale rather than just throw it out.

I even purchased a few used high school texts with the intent of working through them. I found them very hard though because there was very little explanation. Are there any texts you are aware of which might be better suited to someone like me?

Anyway, thank you again Reckoner. This has been really incredible. I thought I was just looking for a "divide it by 0.9" answer, but instead I got a peek into a whole other world.

11. Originally Posted by max6166
I am essentially a high school drop out, so some things, like least squares regression, assume more advanced math skills than I possess. I have developed some interest in math recently though. I think that is partially why I wanted to "figure out" the scale rather than just throw it out.
Well, I wasn't aware of what sort of knowledge you had and I didn't want to seem patronizing by assuming you wouldn't be able to understand me. But by all means, feel free to ask if you need further clarification. I enjoy helping people with "real-life" projects, partly because such people usually have a bit more motivation than the usual high school student just looking for some homework help, and also partly because it offers others a chance to see some of the cool things they can do with the mathematics that they learned in school but maybe neglected a little.

Do not be too worried about your current lack of knowledge though. Whatever your reasons for not finishing school, there is still plenty of time to learn the things you missed. You will just need to be a bit more disciplined since you will be teaching yourself mostly.

And keep in mind that a lot of this stuff can look more difficult than it is when you aren't familiar with the symbols, notations, and terminology used. Mathematics requires us to use very precise language, so we use symbols to help express our ideas in a sufficiently precise manner, but it is not hard to pick up.

Originally Posted by max6166
I even purchased a few used high school texts with the intent of working through them. I found them very hard though because there was very little explanation. Are there any texts you are aware of which might be better suited to someone like me?
There are many great texts, and there are many abysmal ones. The important thing to note, however, is that many of the things you may want to learn in mathematics depend on your mastery of more elementary ideas--for example, you are probably easily intelligent enough to learn calculus, but you'll get nowhere if you don't first get an appropriate foundation in algebra and trigonometry. This can be a problem when choosing books, because even though a book may be high school level, it still may require you to know a bit of prerequisite material.

While I could give some good recommendations on texts for more advanced material, I'm afraid I can't help you much with the basic stuff. I do, however, have one recommendation:

Mathematics: From the Birth of Numbers by Jan Gullberg - This is a wonderful book; it covers an incredible amount of material but doesn't require much prior knowledge other than basic arithmetic. I have read it and I love it. The book covers everything from a basic introduction to numbers, up to differential and integral calculus, also covering many other things along the way, including algebra, geometry, trigonometry, logic and set theory, combinatorics, basic matrix algebra, differential equations and a little taste of more advanced topics like topology and abstract algebra. It's a little over a thousand pages, which may seem long, but that really is pretty short considering all of the topics it treats.

It is an easy read, the writing is fairly informal with a good use of humor, and there are some nice illustrations throughout. For me, the best part about it is all of the history that it goes into: with each subject or topic introduced, Gullberg gives a pretty thorough treatment of the history and development of the ideas. Reading the book from start to finish sort of feels like you're sitting in a time machine, watching mathematics develop from its early roots in ancient societies to its modern structure.

I do caution you, however, to use this book as a supplement to your learning, rather than relying on it alone. This is because the book can go through topics pretty quickly and it doesn't have a lot of exercises for you to do; I suggest that as you read this, you also go through some normal textbooks and do a number of exercises in each section to reinforce the material.

Now, if you want some more book ideas, this site has some good recommendations (though the comments for each book are brief). Take a look around there.

Originally Posted by max6166
Anyway, thank you again Reckoner. This has been really incredible. I thought I was just looking for a "divide it by 0.9" answer, but instead I got a peek into a whole other world.