Originally posted by: joneboneOriginally posted by: Miss Clawful
....
And therein lies the beauty of algebra and math. Your post inspired me to look up UPCs, and this simple formula summarizes everything you just typed:
Assume the 12 digits are d1, d2, d3, ..., d11, d12. In a valid UPC barcode, d12 is so selected as to make the following identity true:
(1) |
3×d1 + d2 + 3×d3 + d4 + ... + 3×d11 + d12 = 0 (mod 10).
|
To put it differently, let Sodd and Seven be the sums of the digits in the odd and even positions, starting with 1. Then, for a valid UPC-12 code
(1') |
3×Sodd + Seven = 0 (mod 10).
|
Note that (1) and (1') (' = "prime" in math lingo) are identical formulas just written differently.
I''ve noticed that a lot of people who have problems with math just shut down with they see variables. I think this formula is much more eloquent and concise than your step by step analysis, although you would argue that your way is simpler because there are no variable numbers or strange signs. When you see the word "Mod or Modulo" just think "remainder". I.e. if something = 0 mod 10, that means the remainder would be 0 when you divide by ten, i.e. the number is a multple of ten. 100 = 0 mod 10.
Either way, nice find. I don't know if it is a touchy subject, but I'm not sure why you are unemployed if you possess sound mathematical thinking and exercise good grammar usage in writing.
It took me a bit, but I was starting to feel stupid so I worked at this my way.
The Wizard (took this as my example to test this out)
My original method:
0 25192 93242 7
2+2+9+9+5+0=27
27*3=81
4+3+2+1+2=12
81+12=93
93+7=100
Your method, from my understanding:
3*0+2+3*5+1+3*9+2+3*9+3+3*2+4+3*2+7
So taking it in simplified steps:
Multiply the odd numbers:
3*0=0, 3*5=15, 3*9=27, 3*9=27, 3*2=6, 3*2=6
Add up the multiplied answers:
0+15+27+27+6+6=81
Add up the even numbers:
2+1+2+3+4=12
Add both final odd and even answers:
81+12=93
And finally 93+7=100 (check sum is correct)
Again, this took me a bit to grasp, to understand the point of the letters which while they are there as placeholders for what could be anything, they just confuse the hell out of me, always have (I had tons of arguments with the teacher I remember back in high school revolving around this wondering why I had to put them at all when I could just write out the damn answer and be done with it) and I had to completely ignore the math terms used because that just makes it feel more complicated than what it is. So I believe I get the way you've done it, but still more comfortable with my way, but at least I learned an alternative, there's usually more than one way to an answer and its good to know them all even if you just stick to what you think is the best way.