Friday, November 19, 2021

Hot Dogs And Number Theory

Who ever thought that number theory could be applied to hot dogs.  I certainly didn't until I read all about it.  This is also one of those wonderful real life applications of the Chinese remainder theorem and least common multiple.  

Think about it.  Hot dogs come in packs of 10 while the buns come in a packs of 8, so you end up figuring out how many of each you need. So the easiest way is to buy 8 packs of hot dogs and 10 packs of buns but who wants to deal with 80 hot dogs.

On the other hand, if you use the least common multiple methodology, you end up buying 4 bags of hot dogs and 5 bags of buns to get 40 hot dogs.  If you were my mother, you'd buy a bunch of hot dogs, freeze them, and then thaw the exact number needed and the same for buns but that's no fun mathematically. 

Now it turns out that the the factors of 4 and 5 are relatively prime because the two numbers have no factors in common and the lowest common multiple is their product.  If two numbers are not relatively prime such as 12 and 15, they will have a least common multiple that is less than their product. So what happens if you have one or two hot dogs left over. The left over hot dogs then take the whole problem into the Chinese Remainder Theorem which was identified by a Chinese mathematician over 2,000 years ago. 

The Chinese Remainder Theorem belongs to a field of study referred to as modular arithmetic which looks at the remainders left after a division problem. This particular area is used in a variety of applications from astronomy to cryptography.  Basically what the theorem says is that if you are dividing a number by relatively prime numbers, there will a unique solution that is greater than or equal to zero but less than the product of the two factors regardless of the remainder.

For instance, if you have a packs of 5 hot dogs and packages of buns with 8 and you have one hot dog left over, you start with 6 hot dogs and 8 buns.  If you add packs to each, you get a solution of 3 hot dog packs and two packages of buns which is 1 unique solution less than the product of 5 x 8 or 40.  Thus the Chinese Remainder Theorem tells us there exists a solution and provides us with a method to find the solution. 

As far as notation, it is written as X = remainder mod base.  The base is the number of objects. This notation, can be rewritten into algebraic equations such as base(a) + 2nd base (b) = remainder and from here it can be solved. It is possible the answer might be a negative number.  Interesting connection between hot dogs, lowest common multiple, and the Chinese Remainder Theorem.  Let me know what you think, I'd love to hear.  Have a great day.



No comments:

Post a Comment