Category Archives: Uncategorized

Sum of Squares

Here is an interesting problem I have been playing around with. We all remember square numbers from grade school:  22 = 4 or 62 = 36. Now consider the lowly number 5. While it can be squared, it, by itself, is not a square number. That makes 5 sad. However, maybe 5 could be the next best thing. Could we find a way to write 5 as the sum of two squares?

Well, we could try 5 = 2 + 3. But neither 2 or 3 is a square. What about 5 = 4 + 1? Bingo! 4 = 22 and 1 = 12. The interesting thing, is that if you try to do this with 6, you find that is simply doesn’t work. It won’t work with 7 either, but it does with 8. Can you find the two squares that add up to 8?

Of course you can; 8 = 22 + 22.

Now for the fun part. I guarantee you that it will work for 40. Why 40 you might ask? Well, if it worked for 5 and it worked for 8, then it will work for 5 × 8, or 40.

Sure enough, 40 = 36 + 4 = 62 + 22.

Using this insight, we could go even higher. 40 × 8 = 320. Assuming I am correct, it should work for 320. Now I don’t know about you, but I have a hard time spotting two squares that add up to 320. Wouldn’t it be nice if there was a formula that would use what I already know about 8 and 40 to tell us which squares add up to 320?

As I was working through this problem, I stumbled upon just such a formula. It’s called the “sum of squares” because it sums two squares.  The nice thing is that it tells us how to arrive at the two squares that we are going to add together.

Let’s first return to the case with 5 and 8. The base numbers that produced the squares for 5 were 2 and 1. Let’s call these a and b. For 8, the numbers are 2 and 2. Let’s call these c and d. I’m going to give you the formula and then explain at the end how we obtained it.  For now, just trust me.  At first glance, the formula may not feel intuitive.  But if you hang in there and do the example yourself a couple of times, you’ll get comfortable with it pretty quickly.

First square = a × c + b × d

Second square = a × db × c

Not what you would expect hey? Those are some complicated formulas for such a simple puzzle. However, if we plug in our values, we get:

First square = 2 × 2 + 1 × 2 = 6

Second square = 2 × 21 × 2 = 2

Thus: 40 = 62 + 22

Pretty cool hey! Let’s see if it works for 8 and 40:

8 = 22 + 22

40 = 62 + 22.

First square = 2 × 6 + 2 × 2 = 16

Second square = 2 × 22 × 6 = -8

So, we get: 320 = 162 + (-8)2

 

Ok, one more fun example.

13 = 22 + 32

17 = 12 + 42

First square = 2 × 1 + 3 × 4 = 14

Second square = 2 × 43 × 1 = 5

And we get: 221 = 142 + 52

That’s all there is to it. A fun exercise is to find out which numbers between 1 and 100 can be written as the sum of two squares. For example, of the three numbers 71, 72, 73, only 2 can be written as the sum of two squares. Can you tell which ones?

 

Aside:

For those of you wondering why the formula works, a bit of algebra does the trick.

Let n1 and n2 be two positive integers where n1 = a2 + b2 and n2 = c2 + d2. To show that the product, n1n2, can be written as the sum of two squares of integers, observe the following:

n1n2 = (a2 + b2)(c2 + d2)

= a2c2 + a2d2 + b2c2 + b2d2

= (a2c2 + b2d2) + (a2d2 + b2c2)

= (a2c2 + 2abcd + b2d2) + (a2d2 – 2abcd + b2c2)

=(ac + bd)2 + (ad – bc)2

 

Advertisements

1 Comment

Filed under Uncategorized

Fractions and their many names

I have often wondered why some students find fractions so challenging when, for me, the rules of the fraction world are second nature. It just makes sense to me that 1/2 = 2/4. However, new students often struggle with these concepts. What if the answer is related to the fact that the same object can have many different names? In “normal” math, 5 is just 5. It doesn’t go by any other strange or wacky name. But in the fraction world, things are different.

Consider the quantity 15/35. In no way does this resemble the quantity 3/7. Where did the 7 come from? Why is the 3 on the top now instead of the bottom? For no intuitively obvious reason however, the world of fractions declares that these are in fact equivalent! Same object, radically different names. Math, being the logical subject that it is, shouldn’t go around giving the same thing a bunch of different names, right? Or is there a reason for all this relabelling? Consider an analogy.

I usually refer to my father as “Dad.” At work, he is known as “Harv.” His birth certificate declares his name is “Harvey.” My mom usually calls him “Hon.” And if you bumped into him on the street, you might call him “Sir.” While these names are drastically different, they all refer to same person. The reason for the difference is that each name serves a different purpose, depending on the context. Fractions are the same.
Suppose I am baking and the recipe calls for a half cup of flour. That seems simple enough. But what if my half cup measure is dirty. Maybe I would want to use my quarter cup to do the measuring. Then I would use 2 quarter cups since 1/2 = 2/4. The same quantity, but a different name.

Imagine that I am looking for a new job. One job would give me 15 vacation days per year. As a fraction, this is represented as 15/365. A different job offers me 4 days of vacation per 73 calendar days. As a fraction, this is represented as 4/73. To choose the best job, I need to compare these quantities. Using fraction knowledge, I use a different name for 4/73. I use instead, the name 20/365. Now I can clearly see that the second job offer is more appealing with those 20 vacation days per year.

What if your phone battery said, “you have 8/25 of battery remaining.” That would be silly. Of course, the phone should say, “you have 32/100 of battery remaining.” This second name makes it so much easier to understand how many more YouTube’s you can watch until your phone dies.
And personally, I think it is fun for numbers and people to have different names in different contexts. My friend’s grandmother was always affectionately referred to as “Babcia.” Maybe consider that next time you fret over 1/3 being called 2/6.

Leave a comment

Filed under Uncategorized

Speeding

As I was driving home from my road trip a couple of days ago, a thought occurred to me. Several cars were passing me on the highway, clearly going 10 km/h over the speed limit. Of course, people speed to save time and to get where they are going in a hurry. Sometimes they go 10 km/h over the limit on the highway, and sometimes they do the same thing in the city. I wondered, is there a difference?

More precisely, suppose you had to travel 100 km. In the first situation, you are on the highway clipping along at 100 km/h. The urge to speed wells up inside and you long to shave some time off your trip. If you increase your speed to 110 km/h, how much time do you save?

At your original speed, it will take you 60 minutes to complete the trip. At the increased speed, the trip will only take 54.5 minutes. Thus, you save 5.5 minutes on your trip. Not a ton of time, but still a temptation if you need to get somewhere in a hurry.

Now consider the second situation. You still need to travel 100 km, but you are in the city traveling at a gentle 60 km/h. Suppose you increase your speed to 70 km/h, how much time will save? Take a guess!

My first instinct was that you would still save about 5.5 minutes on the trip since the distance travelled is the same. However, if you crunch the numbers, you find the following:

Time at 60 km/h: 100 minutes

Time at 70 km/h: 85.7 minutes

Time saved: 14.3 minutes

You more than double your time savings! Let’s push this idea to the extreme. Consider a third situation, where you still need to travel 100 km, but the entire time you are stuck in a school zone and must travel 30 km/h! The kind of malicious person who would create a school zone like that escapes me. However, we will continue for the sake of the math. Here are the results:

Time at 30 km/h: 200 minutes

Time at 40 km/h: 150 minutes

Time saved: 50 minutes

You save almost an hour by speeding! Incredible and unexpected! A word of caution. I am in no way advocating speeding, it is a dangerous habit with potentially fatal consequences. However, by investigating the math of the situation, I believe I have uncovered something about human nature. While driving down the highway, speeding feels like a 50-50 choice. You could go a bit faster and cut some time off your trip. Or you could obey the speed limit. In either case, the difference won’t be that noteworthy. Yet, when people are stuck in a school zone, the temptation to speed can feel overwhelming. The vehicle is moving so slowly and it feels like going even 10 km/h over the speed limit would drastically reduce your commute. I think that this temptation, this intuition, is illuminated in the math above. Speeding in a school zone really does save you much more time than speeding on the highway.

Being a teacher, I can not, in good conscious, leave the discussion there. In the final, real life scenario, when the school zone is only 0.5 km long, here are the numbers:

Time at 30 km/h: 1 minute

Time at 40 km/h: 0.75 minutes

Time saved: 15 seconds

While it might be reasonable to try and speed through a 100 km school zone of torture, the 15 seconds saved in a regular school zone is not worth the risk of a child’s life. As the slogan goes, “normal speed meets every need.”

 

Leave a comment

Filed under Uncategorized

Puzzling Probability Part 3

This is part 3 of a series in which I am exploring some interesting probability puzzles.

As someone who loves to walk, probability puzzles that involve considering different routes to the same destination are interesting to me. However, this puzzle requires a warm up. Consider the following:

How many ways are there to walk from A to B (assuming no back tracking)?

path-1

At first, I tried to draw all the possible paths:

path-1-5

Then I realized that it was going to take far too long and I could never be sure that I didn’t miss a path. I needed another approach. Instead of trying to figure out how many ways there were to get from A to B, I asked a simpler question: How many ways to get from A to C?

path-1-75

Clearly, we can only get to C in only 1 way. We place a number 1 at the intersection. Similarly, we only have 1 way to get to each intersection point along the top and along the left side. Next, we need to determine how many ways to get to point D.

path-3

Since there is 1 way to get to the point above D and 1 way to get to the point left of D, we add these and obtain 2 ways to get to D. Continuing like this with each intersection point on the grid, we have:

path-4

Thus, there are 20 different ways to walk from A to B.

Now we can answer the actual question. What is the probability that a random walk from A to B (assuming no back tracking) passes through the middle of the grid below?

path-5

Using the above method, we find that there are 70 ways of walking from A to B. To count the number of ways through the middle, we simply redraw the gird to force us through the middle as follows:

path-6

Again, using the above method, we find that there are 36 ways of walking through middle.

Hence, the probability is 36/70. If you try this exercise for a 6 by 6 grid, you will find that the probability is 4900/12870.

This was counter intuitive to me. In a very large gird, if you were to randomly walk from one end to the other, it seemed to me very unlikely you would pass exactly through the center. The above solution shows that even for a 6 by 6 grid, the probability of walking through the exact center is 38%. As an extension, what do you think happens to this probably as the grid grows larger? Does it approach a specific value? Or does the probability eventually tend to zero?

Leave a comment

Filed under Uncategorized

Puzzling Probability Part 2

This is part 2 of a series, in which I am exploring some interesting probability puzzles.

Imagine a typical dice game. You roll 2 dice and compute their sum. For example, the first die is a 4 and the second die is a 3. The sum is 4 + 3 = 7. From our everyday experience with rolling dice, we know that 7 comes up most often, and numbers like 3 or 11 are rarer.

Now imagine a pair of strange dice, with the following numbers:

Die 1: 1, 3, 4, 5, 6, 8

Die 2: 1, 2, 2, 3, 3, 4

Is rolling these two dice is the same as rolling 2 standard dice? Or better yet, how could we determine if the strange dice are equivalent to standard dice?

The first idea I had was to add up all the numbers on both dice:

(1 + 3 + 4 + 5 + 6 + 8) + (1 + 2 + 2 + 3 + 3 + 4) = 42

If you add up all the numbers on two standard dice, you also get a sum of 42. At first, I thought this might be enough to confirm that the strange dice were equivalent. However, consider the following two dice:

Die 3: 6, 6, 6, 6, 6, 6

Die 4: 1, 1, 1, 1, 1, 1

The sum of the all the numbers on the above two dice is clearly 42. But the only number that comes up when rolling both is 7. For an alternate pair of dice to be equivalent to the standard dice, there should be a way of rolling a 2, or a 12, or the other numbers typically rolled from standard dice.

Creating a table is very helpful for eliciting the answer in this particular situation. Here are all the possible sums for two standard dice:

dice-1

The numbers along the outside are the standard dice numbers and the numbers on the inside of the grid are the sums. If we count up the occurrences of each sum, we have the following:

dice-2

Now, we can repeat the same process with the strange dice:

dice-3

dice-4

How interesting! The strange dice have the same sums with the same frequency as the standard dice. However, I doubt I could get away with using these dice at a casino, even if they are mathematically equivalent.

Leave a comment

Filed under Uncategorized

Puzzling Probability Part 1

In this series, I am going to explore some interesting probability puzzles. First, I want to consider a question about selecting balls from an urn.

“An urn contains four colored balls: two orange and two blue. Two balls are selected at random without replacement, and you are told that at least one of them is orange. What is the probability that the other ball is also orange?”

What an interesting problem. Take a guess at what the answer might be.

At first, I was partial to the idea that the probability would be 1/3. After you have been told the first ball is orange, there is a 1 orange ball left out of the total of 3 remaining balls.

Then, I thought the answer must be 1/6. The probability of drawing an orange on the first selection is 2/4 and the probability of drawing an orange on the second selection is 1/3. Using multiplication, we get 1/6.

Unfortunately, neither of these approaches is correct. In fact, the answer is 1/5. Why 1/5 you might ask? Let’s diagram out the situation.

I labelled the balls: O1, O2, B1, B2. We are told that of the 2 balls selected, 1 of the balls is orange. Thus, we must have one of the following situations:

O1, O2

O1, B1

O1, B2

O2, B1

O2, B2

As you can see, there are only 5 possible selections where at least 1 of the balls selected is orange. Further, only 1 of these possibilities has 2 orange balls. Thus, the probability that the other ball is also orange is 1/5.

This was very shocking to me. I did not expect such a strange answer from a seemingly simple problem.

Leave a comment

Filed under Uncategorized

Card Probability

Suppose that a deck of 52 cards has been shuffled and placed face down. You draw 1 card but do not look at it. You place it face down and off to the side. What is the probability that you drew the Ace of Hearts?

Since there is 1 Ace of Hearts in the deck and 52 cards total, the probability is 1/52.

Now you prepare to draw a second card. What is the probably that the new card is an Ace of Hearts? Is it more likely than before? Less likely? The same? Impossible to know?

To determine the answer, we need to use a probability tree. Here are all the different options that could occur:

pic 1

If we first drew the Ace of Hearts and placed it face down, there is no chance of drawing the Ace of Hearts for our second card. However, if we didn’t draw the Ace of Hearts, then our second card could or could not be the Ace of hearts.

To compute probabilities, we multiply. We want to determine the probability of drawing an Ace of Hearts on the second card. Hence, we multiply the probability of “Not Ace” by the probability of “Ace.”

pic 2

The above fraction reduces to 1/52. This is the same probability as before! We could apply this logic to drawing a third card (assuming we didn’t peak at the second card). We would find that the probability of drawing the Ace of Hearts is still only 1 in 52. No matter how many cards you remove, the probability doesn’t change. Why is this?

One way of understanding this enigma is to consider the information you have. At the beginning, you know that there are 52 cards and 1 specific card you are looking for. Once you start drawing cards, although you keep removing the cards from the deck, you don’t know which cards you are removing. You could be removing the Ace of Hearts, or you could be removing random cards. You don’t gain any new information with each card you remove. So each time you have the same probability as in the beginning.

Or consider another scenario. Suppose I draw a card from the bottom of a full deck. What is the probability that it is an Ace of Hearts? Since the deck is shuffled, the probability should be 1/52. But to get to this card, I could have physically removed all 51 cards above it (without looking at them), placed them in a pile, and then selected the bottom card. Having a pile of unknown cards does not change the probability of the remaining card being an Ace of Hearts.

2 Comments

Filed under Uncategorized