## Tuesday, July 17, 2012

### The Coathanger

The last couple of nights have had some clear skies in Michigan, and since I can't sleep (thinking about the imminent second daughter coming any day now) I have been doing a lot of stargazing lately. I was reminded of the amazing creativity and power of God as I brought out a new simple tool to help me stargaze, a pair of binoculars.

The first time I saw in an astronomy book a picture of a family using binoculars to look at the stars, I thought "Wow -- how desperate!"  I had major skepticism on how well they could really help the view. But as I tried them this week (and my binoculars are by no means that spectacular -- they're small) I must admit being amazed at how much more I could see. Yes, it made things slightly bigger -- mine were 7x -- but more impressive to me was that you can see more stars!

 The Coathanger
Nothing made that more evident then when I discovered a new constellation (new to me that is) called the Coathanger. I was just wandering around looking at the stars (actually, following one of satellites that I couldn't see with the naked eye) when I ran into a tight grouping of stars, technically an "open cluster" that I instantly recognized as "The Coathanger" that I had coincidentally read about that morning. Typically constellations don't look anything like they're supposed to for me, but this one most definitely did.

Technically, the recognizable shape of stars called the Coathanger is an asterism, as opposed to a constellation which is really just a chunk of the sky. As another example, the big dipper is another asterism, that is located in the constellation Ursa Major.  What made the Coathanger so impressive to me, was the fact that I cannot see it at all, without my binoculars. Click here for more information on Brocchi's Cluster, or Collinder 399, which is the catalog name for the cluster containing the asterism of the Coathanger.

If you'd like to find the Coathanger yourself, Here's a map of the stars that are visible in the evenings of midsummer in the Northern Hemisphere. If you need to look up different latitudes or months, try this more general link

Before we find the Coathanger, let me set the stage for you. If you have the map in front of you, it might help as I describe what you can see. To the northwest you should see the Big Dipper. I recommend you start by looking at the Big Dipper through your binoculars, and practice moving from star to star to get a feel for how big the binoculars are, and how many more stars you can see than you're familiar with.  For my set, each major star in the 7-8 that make up the dipper required me to move about one field of view in my binoculars, and it took some time before I could confidently move from star to star, so don't be surprised if it's a little difficult at first.

To the right of the big dipper, in the northeast, you'll find the "W" which is in the constellation Cassiopeia.

Behind you, in the south along the horizon, you should be able to find Scorpius, which is in my opinion a fairly obvious constellation that looks like a scorpion. Just behind it, to the left, you might be able to spot "the teapot" in Sagittarius.
 Sky Map provided by skymaps.com Looking east, this snippet covers from about 45 degrees up to directly overhead.
Now turn towards the east, and then look straight above you. The point directly above you is called the zenith and the bright star Vega is pretty close to the zenith during the summer evening hours. You should come back and look at the stars around Vega in Lyra, as there are some beautiful and obvious double stars there that pop out with a binoculars, but try to locate the other constellations as shown in the snippet of the map above.  Below and to the left you should see what I call the "Northern Cross" which is in the constellation Cygnus, a swan flying south over the Milkyway river.  Below and to the right is a less obvious constellation of stars called Aquila, an eagle who is also flying south.

I find the Coathanger most easily by finding the three right stars in Aquila's tail, (the middle one is the brightest, and is named Altair) and following that line up about two binoculars widths (10 or so degrees). You should be able to see CR399 labeled on the portion of the map above. CR 399 is actually a little wider than a full binocular width for me, and coat hanger is slightly left of the line. If you see it, you'll know, because the line of stars marking the hanger part is so perfectly straight that it jumps right out at you.

Let me know if you spot it!  Also, be sure to say high to Jolly Mon and the Dolphin, my favorite constellation (Delphinus) while your looking in his neighborhood, and have fun checking out the skies!

## Wednesday, July 11, 2012

### What's the comma good for?

 How NOT to add the large numbers: 324,568,116 + 538,246
The other day I was typing a huge number into my calculator, and was reminded of an error my students often make, that of using the comma. You may have noticed that there is a comma in the middle of the TI-83 and 84's buttons, and maybe even tried to use it before? Get the "Syntax Error" message before? Though we  typically separate large numbers into chunks of three digits each, that is not what the comma was designed to do in calculators, and if you try to use it to do that, as shown to the right, your calculator gets confused. I often tell my students "You are smarter than your calculator" meaning -- it has no idea that commas are used in that way. It thinks you're crazy.

So, what is the comma there for then, if not to separate large numbers into chunks of three digits? Here's a handful of reasons the comma is useful, and things you can use it for:

• An argument separator:  the most common use of a comma on a TI-83 or TI-84 is to separate different inputs of a function.  Lots of words here... let me summarize:
function - some sort of a command that takes input from you and calculates something.
argument - the "input" that you put into a function
Here's a few examples:  Hidden in the Math button are some functions you might want to know about that require more than one input. Try typing in gcd(100, 84) and you'll find that the calculator will give you the greatest common factor (or divisor) of 100 and 84. Notice because you had two inputs, you had to separate them with a comma. Further right in the menu is randInt(1,6) which will give you a random number between 1 and 6, like rolling a dice. Add a third number in like randInt(1,6,5) and it will give you a list of random numbers, as if you rolled 5 dice, like if math class was really boring and you wanted to play Yahtzee but knew the teacher would be annoyed with the sound of dice on your desk.

• A list separator:  you can also create lists of numbers in your calculator, using the braces {} and commas. You might want to do this if you are doing things with statistics, or if you are trying to answer many different questions at once. There are different list functions in the List menu, and in the Stats menu. Usually I will type my list up, say: {1, 3, 5, 7, 9, 11} and then store it using the STO button, and then I can do all sorts of things with or to the list, a few of which are demonstrated to the right.

• A matrix separator: similar to the lists option, this will help you to create and store a matrix of numbers, for which you need to use the [] brackets instead of parentheses. Matrices are far to rich a topic to explore in depth here, and I think it's much easier to use the Edit option in the Matrix menu when I work with them myself, but you can type up a matrix on the main screen, or in the programming screens by using [ [a, b, c, ...] [d, e, f, ...] ...] if you wanted to, and when programming its the only way.
• An ordered pair separator: if you have a set of x,y coordinates, you use the comma to tell the calculator when x stops and y begins.  Among other places, there are a few useful functions in the Angle menu that require you to enter in an x- and a y- coordinate, such as when calculating the length and angle of a vector?  Suppose you want to know the distance from (0,0) to (3, 4) and what angle you need to travel at? Type in R>Pr(3,4) and R>Ptheta(3,4) to get the distance (5 units) and the angle (~53 degrees).

## Tuesday, July 10, 2012

### Divisibility by 7

There are lots of different divisibility tests out there -- here's a review of techniques for checking if a number N is divisible by seven:

1. Divide it. If you have a calculator, type N / 7 and see what comes up. If you get a clean integer, then N is divisible. If you don't have a calculator, then use long division or another approach and see what you get. Of course, this isn't really a "divisibility test" in the usual sense, but with a calculator its usually the fastest technique.

2. Arrange it. Grab N objects and line them up in rows of 7. If there is no objects left over at the end, then N is divisible. Again, not the most practical, but it would be fun. Even better, grab N volunteers and have them arrange themselves on a football field in rows of 7. Again, the key would be to have no incomplete rows when you are done.

3. Write the number in base 7. If the number ends in a 0, then N is divisible by seven. This method might be less practical than #2.

4. Recognize it. Some numbers, especially the 2-digit numbers, you might just recognize as being divisible by 7. It is helpful to recognize them all, for some of the later tests, but the only two-digit ones you might not already have memorized are 84, 91, and 98. I'll include in this category a couple of others you probably didn't already know:
Any 6 digit number that repeats in groups of three is divisible by 7. For example, 326,326 and 199,199 are multiples of 7, as is 36,036.  That's because each of these numbers is a multiple of 1001, which is divisible by 7.

5. Subtract ones from the rest twice:  Here I'll discuss our first "legitimate" divisibility test, which takes as many steps as the number of digits in N. Chop off the last digit of N and subtract it twice from the rest of N. Then do this again, and again, until your number is small enough to recognize as a multiple of 7. Here's an example:
Is 765898 divisible by 7?
Subtract 8 from 76589 twice: 76581, 76573
Subtract 3 from 7657 twice: 7654, 7651
Subtract 1 from 765 twice: 764 763
Subtract 3 from 76 twice: 73, 70
Recognize that 70 is a multiple of 7 and therefore 765898 must have been also.

6. The technique can be helped if you take advantage of another property. At any point in the process if a digit is too big or two small, you can add or subtract 7 from it without affecting the test. This can help reduce the number of times you have to borrow in the process -- which I made mistakes on three times in just the four step example above. Also, any 7's at the beginning or end of a number can be chopped off without affecting the test.  Here's another look at it, with a few short cuts.
Is 765898 divisible by 7?  Chop off the first 7, and reduce the ones digit by 7.
Is 65891 divisible by 7?
Subtract 1 from 6589 twice: 6588 6587
Chop the 7, is 658 divisible by 7?
Is 651 divisible by 7?  Subtract the 1 twice from 65.  64, 63. Bingo! 63 is 7*9.

7. For 4, 5, or 6 digit numbers, subtract the chunks of three digits and test their difference: Using the same example, 765898 is divisible by 7 because 898 - 765 is 133 and 133 is divisible by 7.

8. Add or subtract 7's (or 70's, or 700's, etc.) till you recognize a multiple. In the example above, I noticed that 133 is 7 short of 140, a known multiple of 7.  Earlier, I noticed that 658 was 28 more than 630, and so I recognized that 658 would have been a multiple of 7.

9. For larger numbers (more than 6 digits) alternately subtract and add chunks of three digits and apply a test:
Is 369,339,554,237,199 divisible by 7? 369-339+554-237+199 = 546.  Since 546 is 14 short of 560, it is divisible by 7. This number was to big to use my calculator for, but I could still figure out if it's divisible by 7, in just about as much time as it takes for me to type it in, as shown below.

 Three Tests for Divisibility by Seven: 1. Direct test (number was too big to use) 2. Reduce by alternating sum/differences 3. Fractional Part Test.
10. Try modular arithmetic. Some calculators can find the remainder of an answer, even though the number itself is beyond the size the calculator can handle. For TI80's, this can be exploited using fpart() located in the math menu. Include this in your calculation and it will only handle the remainder. If you find that the fpart of a division is zero, than the number divided evenly. If it something between 0 and 1, you can multiply it by 7 and that whole number is the remainder.  It worked with remarkably big numbers on my calculator -- I could work with numbers with 100 digits, but it gave me an over flow at 120 digits -- so somewhere in there is the calculator's limit. I suppose if you have a bigger number than that, you could either reduce it down using #8 above, or just wolfram it.

Your turn: Assignment: Prove why some of the techniques from #4-9 work. Alternatively, find a 8 digit number that is divisible by 7, and one that isn't, and demonstrate several of techniques. Go!

## Monday, July 9, 2012

### Algorithms, Recursion, and Fractals

Woke up to this facebook message expressing a late night math observation, and thought I would reply to everyone. (Names have been removed to protect the innocent).

On Monday, July 9, 2012, Facebook wrote:
Random Student
Hey Mr. Roer, I have a sort of math question for you. I happened to look at my clock at 12:24 a.m. tonight, and in my brain automatically thought about how 1+2=3 and 2+4= 6 and how 3 is half of 6 just as 12 is half of 24. I then thought about how 48 is 4+8= 12 which is double of 6. So then I decided to be a math nerd for a minute and tried it going from 10-19. It worked with the other numbers to a degree, except for 15, 16, and 17. 15 just goes back and forth between 6 and 3 until you reach 480. 16 and 17 countdown (7 to 6, and 8 to 7) and then stop. So, my question is what is this? lol Or is it just coincidence?

Well, Random, I'm not exactly clear what your algorithm was (I think in your sleepiness your message ended up being a little less obvious than you might have thought it was) but I appreciate your curiosity and looking for fun patterns. I'll try to suggest a couple that came to mind while reading it.

The first is a simple "divisibility by nine" test -- if you add up all the digits in a number, and then repeat, and repeat until there is only one digit remaining, and that digit is 9, then the number is divisible by nine.  A related fact is the "divisibility by three" test -- if you add up all the digits and continue etc. and your final answer is either 3, 6, or 9, then the number is divisible by 3.

Another algorithm that came to mind was the "hail stone numbers" which is a famous open question in math -- meaning the answer is still unknown. The algorithm is simple enough -- if a number is even, cut it in half, and if it is odd, multiply it by 3 and add 1. Starting with any number (that people have tried so far) these numbers all eventually cascade down to 1.  The open question is will EVERY number do that -- there's a lot of numbers (especially huge numbers of 50+ digits) that have not been tested, and I believe there is a million dollar prize available for anyone who can prove what would happen.  They're called the hailstone numbers because like hailstones, they go up and down and up and down and can grow really big, before eventually falling down to the ground.

A fun pattern I have written about before involves cubing the digits of a number, and adding them up, and continuing that process indefinitely. It can produce cycles of repeating numbers, or get sucked in and stuck on numbers like 153.  A similar concept is described in a video where this process is called "Happification".

In general, this type of operation, when you do something and then you use that result to do the same again and again and again, is called a recursive function. Recursion can produce all sorts of different things -- from endless loops that freeze up your computer, interesting "steady state" results like 1, and 153 described above, or even beautiful images such as these fractals:

If that last one looks familiar, its because it's very similiar to the shape a cauliflower has. Next time you eat one, zoom in on it and you'll see a similar pattern occurring at smaller and smaller sizes. In fact, using recursion is mankind's best (truest? most accurate?) way of "drawing" nature, and is used quite frequently to produce backgrounds for movies and computer games. If you have 17 minutes and are interested in this further, I highly suggest listening to the "master" and discoverer of fractals Benoit Mandlebrot give his last lecture -- one of TED talks I came across recently. (If you only have three minutes, then pick up at the 14:00 minute mark where he describes and shows pictures of his Mandlebrot set, the first image shown above.

Feel free to describe your particular algorithm in more detail if you want more input for me, or better yet, draw a map of the routes numbers take using your algorithm. For the best algorithms, I suggest listing just a few short rules or steps and seeing what happens -- there is often much chaos and craziness in even the simplest rules.

## Wednesday, July 4, 2012

### Just how big was that firework anyway?

One of my favorite summer activities are watching the fireworks. The lake I lived on as I grew up hosts a fireworks show every year, and this year will be only the 3rd or 4th time I've ever missed it. But the question I wanted to write about can be answered at any fireworks show, and I'm going to use memories from our cities display last Labor day, which I can conveniently watch from my front yard.

The question is how big is an "average" firework? Of course, they come in all sorts of different sizes, shapes, and colors, but lets consider an easy spherical shot like the one pictured above.

We'll calculate this using very simple measurements. I used "one-thou-sand-ONE-one-thou" to figure out how far away the burst occurred, and used my held hand up to estimate that it took up approximately 20 degrees in my vision. These two measurements should be enough to calculate the volume of the firework.

First, lets calculate how far away the firework was when it exploded. You probably know sound moves faster than the light, which is why you see the firework before you hear the boom. I hate loud noises, and so this gives me a chance to cover my ears before any big ones...  I counted a number of times and estimated that fireworks were exploding approximately 1.5 sound-seconds away from me. (Hey, if you can measure distances in light-years, then surely you can understand sound-seconds right?) How far is that in meters? I know the speed of sound through air is approximately 343 m/s (it can vary because of things like temperature, humidity, etc) and so this conversion is:
$\frac{1.5 sec}{ } \frac{343 meters}{1 sec} = 514.5 m$

This seems reasonable to me, because I know where the fireworks are launched from and I verified on Google maps that distance.  The distance was a little longer than the map provided, but the fireworks were also high in the air, and that extra dimension is probably what added the extra distance to my observation.

Now I can use the trigonometry we learned about when analyzing pictures last week and calculate the width of the firework. First a quick triangle:

The angle I measured was approximately 20° -- which has a lot of uncertainty I know, but we're not exactly measuring a fixed object. Some fireworks are bigger than others, some smaller. But most of the fireworks I saw spread out to fill about a hand width in the sky.  The width of a firework, represented by the height of this right triangle which is directly "opposite" the angle, can be found from trigonometry. For now I'll assume that the 514.5 meters we measured earlier represents the bottom leg of the triangle -- what we call the leg "adjacent" to the angle. Then we have:
$\begin{matrix} tan(20^{\circ})=\frac{opposite}{adjacent} = \frac{w}{514.5}n \to w=514.5\cdot tan(20^{\circ})= 187 m \end{matrix}$
That gives us a radius of one of these fireworks as being nearly a football field in length. That seems incredibly wide to me, but I am trying to remember these measurements from a year ago -- I'll see if I can measure things more precisely this year. Of course, maybe the distance is closer to the hypotenuse of the triangle, in which case:
$\begin{matrix} sin(20^{\circ})=\frac{opposite}{hypotenuse }=\frac{w}{514.5} \to w = 514.5 \cdot sin(20^{\circ})= 176 m \end{matrix}$

Let's try a new picture...
Using this triangle, I know that the distance is the center line -- and I can draw two right triangles on either side, which split my viewing angle into two equal pieces. Then the opposite side is a single "radius" of the firework, which I could double to get the width. With this arrangement, I find:
$\begin{matrix} tan(\frac{20^{\circ}}{2})=\frac{opposite}{adjacent }=\frac{r}{514.5} \to w = 514.5 \cdot tan(10^{\circ})= 91m \end{matrix}$
Doubling this leads to the same basic width as before -- approximately 182m.

The volume of the firework then is just a simple formula for a sphere:
$V_{sphere} = \tfrac{4}{3}\pi r^3 = \tfrac{4}{3}\cdot\pi\cdot{91}^3 = 3 \, million \; {m}^3$

As I said earlier, these measurements are from year ago. I'm hoping I have given you enough time to try this at your fireworks shows this season. If you do, feel free to share your measurements, or links to any pictures, in the comments below! For a combination challenge, see if you can determine the size of the San Diego firework ball -- their entire fireworks display went up all at once on accident creating a ridiculously huge "firework":

## Tuesday, July 3, 2012

### Do I need to order more orange beads?

This past week at my church we are doing Vacation Bible School, using Group's Sky Curriculum. My role is to lead the imagination station, which is a small 15 minute block of time where students essentially create a little mini-science demonstration, relate it to how God works in their lives, and create a small take-away activity they can bring home to show their friends and parents.

One small part of this station is an opening question to get the students thinking about the idea of the day. This question is a "would you rather" type of question that has only two possible answers -- and the students depending on their answer select a little orange bead or a little blue bead, which they keep. At the end of the week, some students might have responded with the first option each time and have 5 orange beads, or perhaps have five blue beads, or most likely something in between.

We anticipated 100 students, and bought 3 beads of each color for each student, so we have 300 orange beads, and 300 blue ones, as was recommended by the company. My concern was that today's question was highly skewed in direction of the orange, so even though we have only 94 students, 75 of them received an orange bead, and only 19 took a blue one. I'm wondering if I should order more beads, or trust that in the grand scheme of things, it will balance out?

To answer this question, I need to invoke a little work with probability. To do so, I am going to make a few assumptions, which as always I'll list before getting started:

• Each of the remaining four days I will also have 94 students
• Each of the remaining four questions will be "fair" meaning a student would pick either option with 50% likelihood.
To begin, suppose worst case scenario, every student from here on out chooses the orange response.  That would mean 94+94+94+94 more orange beads are given out, plus the 75 I've already given away which would be 451 total orange beads, or 151 more than I have. So one solution could be to order another 151 beads (they come in packs of 100 though, so I'd have to order 200 more) and then I'll know I'll be safe -- at least with orange.

How many beads do I have left anyway?  300-75 = 225. Divided by four days, means I have an average of 56.25 beads I could give away each day, which would mean students would average their responses to less than 56.25/94 = 59% favoring orange. Hmm... a little nervewracking, but if any of the days is a blue-heavy day, than that probability would go up, and surely one of the days will be blue-heavy, right?

Ultimately, this can be simplified to a 'coin-flipping' problem.  I have 94*4 or 376 more beads to give away, some of which will be orange and some will be blue. If I split 50/50 I'll give away 376/2 or 188 more orange beads, which is well under the 225 I've got left.  What I'd ultimately like to know is what is the probability that I'll have to give away 226 or more beads?  That is, if I flip a coin 376 times, what's the probability that I'll get 226 heads?

This question is simple enough in concept to answer, but because of the large number of flips needed, it will be a little more difficult to practice. The concept is simply to find out how many different combinations of orange/blue giveaways are possible - lets call that X - and then count how many of those options contain 226 or more orange beads -- lets call that O. A probability is always the number of combinations that win (or in this case, "lose") divided by the total number possible, so using our notation, that's O/X.  Lets look at a simpler question, and then we'll return to the question at hand.

Suppose it was the last day and we had only five students. What responses are possible. Suppose I had 3 of each bead -- what's the probability that I'll be able to give the students what they need?

First, lets figure out how many combinations are possible, which I'll do by listing, because there aren't that many (2^5 is 32 -- so I can do that relatively painlessly)
ooooo oooob ooobo ooobb ooboo oobob oobbo oobbb
obooo oboob obobo obobb obboo obbob obbbo obbbb
boooo booob boobo boobb boboo bobob bobbo bobbb
bbooo bboob bbobo bbobb bbboo bbbob bbbbo bbbbb
That's 32 possibilities, which means in this example, X = 32.

Now lets highlight the ones that I can handle -- that is, the cases that give away at most 3 beads of any color -- because I don't have four.
ooooo oooob ooobo ooobb ooboo oobob oobbo oobbb
obooo oboob obobo obobb obboo obbob obbbo obbbb
boooo booob boobo boobb boboo bobob bobbo bobbb
bbooo bboob bbobo bbobb bbboo bbbob bbbbo bbbbb
There are 20 possible outcomes that will ok, which I've highlighted. That means our O = 20. The probability that I'll be able to give things away with no difficulty then is O/X = 20/32 or 62.5%.

Now the same process could theoretically be used to answer the real question at hand, but each possible chain is 376 letters long, and I would have to list 2^376 possibilities, which is a number that has 113 digits in it. No thank you. Not to mention I would then have to look through each of those combinations to see which ones have 226 or more orange beads....

Thankfully, there is a shortcut, and even though these calculations involve enormously big numbers of possibilities, a calculator can handle them for us. One such calculator that I used can be found online, and the relevant numbers you would need to type in are n = 376 (number of flips) k = 226 (highest number of flips of one type desired) and p = .5 for 50% probability per flip.  You may also use a TI-83 or TI-84 in which case you're looking for the binomialcdf function in the Distribution menu. (More info) When I calculated the answer, I got a 0.0052234269% possibility of running out of orange beads. I'm fairly confident I'll be ok, as long as the rest of the questions are basically 50-50.

Tomorrow we'll continue this discussion, and see how a little triangle of numbers can help us answer this question.