Tag Archives: technology

Birthdays, CAS, Probability, and Student Creativity

Many readers are familiar with the very counter-intuitive Birthday Problem:

It is always fun to be in a group when two people suddenly discover that they share a birthday.  Should we be surprised when this happens?  Asked a different way, how large a group of randomly selected people is required to have at least a 50% probability of having a birthday match within the group?

I posed this question to both of my sections of AP Statistics in the first week of school this year.  In a quick poll, one section had a birthday match–two students who had taken classes together for a few years without even realizing what they had in common.  Was I lucky, or was this a commonplace occurrence?

Intrigue over this question motivated our early study of probability.  The remainder of this post follows what I believe is the traditional approach to the problem, supplemented by the computational power of a computer algebra system (CAS)–the TI Nspire CX CAS–available on each of my students’ laptops.

Initial Attempt:

Their first try at a solution was direct.  The difficulty was the number of ways a common birthday could occur.  After establishing that we wanted any common birthday to count as a match and not just an a priori specific birthday, we tried to find the number of ways birthday matches could happen for different sized groups.  Starting small, they reasoned that

  • If there were 2 people in a room, there was only 1 possible birthday connection.
  • If there were 3 people (A, B, and C), there were 4 possible birthday connections–three pairs (A-B, A-C, and B-C) and one triple (A-B-C).
  • For four people (A, B, C, and D), they realized they had to look for pair, triple, and quad connections.  The latter two were easiest:  one quad (A-B-C-D) and four triples (A-B-C, A-B-D, A-C-D, and B-C-D).  For the pairs, we considered the problem as four points and looked for all the ways we could create segments.  That gave (A-B, A-C, A-D, B-C, B-D, and C-D).  These could also occur as double pairs in three ways (A-B & C-D, A-C & B-D, and A-D & B-C).  All together, this made 1+4+6+3=14 ways.

This required lots of support from me and was becoming VERY COMPLICATED VERY QUICKLY.  Two people had 1 connection, 3 people had 4 connections, and 4 people had 14 connections.  Tracking all of the possible connections as the group size expanded–and especially not losing track of any possibilities–was making this approach difficult.  This created a perfect opportunity to use complement probabilities.

The traditional solution:

While there were MANY ways to have a shared birthday, for every sized group, there is one and only one way to not have any shared birthdays–they all had to be different.  And computing a probability for a single possibility was a much simpler task.

We imagined an empty room with random people entering one at a time.  The first person entering could have any birthday without matching anyone, so P \left( \text{no match with 1 person} \right) = \frac{365}{365}  .  When the second person entered, there were 364 unchosen birthdays remaining, giving P \left( \text{no match with 2 people} \right) = \frac{365}{365} \cdot \frac{364}{365} , and P \left( \text{no match with 3 people} \right) = \frac{365}{365} \cdot \frac{364}{365} \cdot \frac{363}{365} .  And the complements to each of these are the probabilities we sought:

P \left( \text{birthday match with 1 person} \right) = 1- \frac{365}{365} = 0
P \left( \text{birthday match with 2 people} \right) = 1- \frac{365}{365} \cdot \frac{364}{365} \approx 0.002740
P \left( \text{birthday match with 3 people} \right) = 1- \frac{365}{365} \cdot \frac{364}{365} \cdot \frac{363}{365} \approx 0.008204 .

The probabilities were small, but with persistent data entry from a few classmates, they found that the 50% threshold was reached with 23 people.

Probability1

The hard work was finished, but some wanted to find an easier way to compute the solution.  A few students noticed that the numerator looked like the start of a factorial and revised the equation:

\begin{matrix} \displaystyle  P \left( \text{birthday match with n people} \right ) & = & 1- \frac{365}{365} \cdot \frac{364}{365} \dots \frac{(366-n)}{365} \\  \\  & = & 1- \frac{365 \cdot 364 \dots (366-n)}{365^n} \\  \\  & = & 1- \frac{365\cdot 364 \dots (366-n)\cdot (366-n-1)!}{365^n \cdot (366-n-1)!} \\  \\  & = & 1- \frac{365!}{365^n \cdot (365-n)!}  \end{matrix}

It was much simpler to plug in values to this simplified equation, confirming the earlier result.

Probability2

Not everyone saw the “complete the factorial” manipulation, but one noticed in the first solution the linear pattern in the numerators of the probability fractions.  While it was easy enough to write a formula for the fractions, he didn’t know an easy way to multiply all the fractions together.  He had experience with Sigma Notation for sums, so I introduced him to Pi Notation–it works exactly the same as Sigma Notation, except Pi multiplies the individual terms instead of adding them.  On the TI-Nspire, the Pi Notation command is available in the template menu or under the calculus menu.

Probability3

Conclusion:

I really like two things about this problem:  the extremely counterintuitive result (just 23 people gives a 50% chance of a birthday match) and discovering the multiple ways you could determine the solution.  Between student pattern recognition and my support in formalizing computation suggestions, students learned that translating different recognized patterns into mathematics symbols, supported by technology, can provide different equally valid ways to solve a problem.

Now I can answer the question I posed about the likelihood of me finding a birthday match among my two statistics classes.  The two sections have 15 and 21 students, respectively.  The probability of having at least one match is the complement of not having any matches.  Using the Pi Notation version of the solution gives

Probability4 I wasn’t guaranteed a match, but the 58.4% probability gave me a decent chance of having a nice punch line to start the class.  It worked pretty well this time!

Extension:

My students are currently working on their first project, determining a way to simulate groups of people entering a room with randomly determined birthdays to see if the 23 person theoretical threshold bears out with experimental results.

Advertisements

FREE TI-Nspire iPad App Workshop

Nspire_Wshop

On Saturday, 31 May 2014, Texas Instruments (@TICalculators) and @HawkenSchool are hosting a FREE TI-Nspire iPad Workshop at Hawken’s Gries Center in Cleveland’s University Circle.  The workshop is designed for educators who are interested in or are just beginning to use the TI- Nspire App for iPad® (either CAS or numeric). It will cover the basics of getting started and teaching with the Apps.  Tom Reardon will be leading the training!

Sign up for the workshop here.  A pdf flyer for the workshop is here:   iPad App Training.

Cover Article

I was pretty excited yesterday when the latest issue of NCTM’s Mathematics Teacher arrived in the mail and the cover story was an article I co-wrote with a former student who’s now at MIT.

The topic was the finding and proof of a cool interconnected property of the foci of hyperbolas and ellipses that I made years ago when setting up my TI-Nspire CAS to model conic sections via the polynomial definition.

Image5a

Image5b

After pitching the idea to teachers at professional conferences for a couple years with no response, I asked one of my 9th grade students if she’d be interested in a challenge.  Her eventual proof paralleled mine, and our work together enhanced and polished each other’s understanding and proofs.

While all of the initial work was done with the TI-Nspire CAS, we wrote the article using GeoGebra so that readers could freely access Web-based documents to explore the mathematics for themselves.

You can access the article on the NCTM site here.

While a few minor changes happened after it was created, here is a pre-publication proof of the article.

A Student’s Powerful Polar Exploration

I posted last summer on a surprising discovery of a polar function that appeared to be a horizontal translation of another polar function.  Translations happen all the time, but not really in polar coordinates.  The polar coordinate system just isn’t constructed in a way that makes translations appear in any clear way.

That’s why I was so surprised when I first saw a graph of \displaystyle r=cos \left( \frac{\theta}{3} \right).

Polar1

 

It looks just like a 0.5 left translation of r=\frac{1}{2} +cos( \theta ) .

Polar2

But that’s not supposed to happen so cleanly in polar coordinates.  AND, the equation forms don’t suggest at all that a translation is happening.  So is it real or is it a graphical illusion?

I proved in my earlier post that the effect was real.  In my approach, I dealt with the different periods of the two equations and converted into parametric equations to establish the proof.  Because I was working in parametrics, I had to solve two different identities to establish the individual equalities of the parametric version of the Cartesian x- and y-coordinates.

As a challenge to my precalculus students this year, I pitched the problem to see what they could discover. What follows is a solution from about a month ago by one of my juniors, S.  I paraphrase her solution, but the basic gist is that S managed her proof while avoiding the differing periods and parametric equations I had employed, and she did so by leveraging the power of CAS.  The result was that S’s solution was briefer and far more elegant than mine, in my opinion.

S’s Proof:

Multiply both sides of r = \frac{1}{2} + cos(\theta ) by r and translate to Cartesian.

r^2 = \frac{1}{2} r+r\cdot cos(\theta )
x^2 + y^2 = \frac{1}{2} \sqrt{x^2+y^2} +x
\left( 2\left( x^2 + y^2 -x \right) \right) ^2= \sqrt{x^2+y^2} ^2

At this point, S employed some CAS power.

Polar3

[Full disclosure: That final CAS step is actually mine, but it dovetails so nicely with S’s brilliant approach. I am always delightfully surprised when my students return using a tool (technological or mental) I have been promoting but hadn’t seen to apply in a particular situation.]

S had used her CAS to accomplish the translation in a more convenient coordinate system before moving the equation back into polar.

Clearly, r \ne 0, so

4r^3 - 3r = cos(\theta ) .

In an attachment (included below), S proved an identity she had never seen, \displaystyle cos(\theta) = 4cos^3 \left( \frac{\theta }{3} \right) - 3cos \left( \frac{\theta }{3} \right) , which she now applied to her CAS result.

\displaystyle 4r^3 - 3r = 4cos^3 \left( \frac{\theta }{3} \right) - 3cos \left( \frac{\theta }{3} \right)

So, \displaystyle r = cos \left( \frac{\theta }{3} \right)

Therefore, \displaystyle r = cos \left( \frac{\theta }{3} \right) is the image of \displaystyle r = \frac{1}{2} + cos(\theta ) after translating \displaystyle \frac{1}{2} unit left.  QED

Simple. Beautiful.

Obviously, this could have been accomplished using lots of by-hand manipulations.  But, in my opinion, that would have been a horrible, potentially error-prone waste of time for a problem that wasn’t concerned at all about whether one knew some Algebra I arithmetic skills.  Great job, S!

S’s proof of her identity, \displaystyle cos(\theta) = 4cos^3 \left( \frac{\theta }{3} \right) - 3cos \left( \frac{\theta }{3} \right) :

Polar4

Algebra Explorations Before Algebra

Here’s a short post to share two great tools for students to learn algebra–long before any formal algebra course and without seeming like you’re even learning algebra.

ACTIVITY ONE:  The first is a phenomenal recent set of posts on Imbalance Problems (here and here) from Paul Salomon.  If you’re on Twitter, interested in math or math education, and haven’t already, you should definitely follow him  (@lostinrecursion).

Paul is (or was) hosting an Imbalance Problem competition (mentioned at the end of his first post on  imbalance problems), but the following image from his post gives the general idea. Can you figure these out?  Better yet, can you write some of your own?  Can you encourage your students (or kids) to create some?  The process of thinking about the values of the unknown measures of the circles, squares, and triangles necessary to create these puzzles lies at the very heart of the concept of unknown variables that is so critical to algebraic reasoning.  Best of all, this feels like a game, and puzzle solvers don’t even realize they’re learning algebra.

ACTIVITY TWO:  Several months ago, a Westminster alumnus (Thanks, Phillip!) suggested an iPad app that my 3rd grade daughter instantly fell in love with–Dragon Box.  The app is available for $5.99 on both iOS and Android platforms. Screen Shot 2013-03-29 at 9.07.05 PM Jonathan H. Liu (@jonathanhliu) wrote such a great overview of the play on DragonBox for Wired.  Rather than trying to imitate his post, I recommend you read his review:  DragonBox: Algebra Beats Angry Birds.  

The play of the game is great for teaching algebraic skills, again without ever seeming like it’s teaching as much as it is.  As a parent, I was THRILLED to see an educational game pull my daughter in so effectively and completely.  A high point came when I was driving carpool last week and my daughter recommended to a friend who was wondering what app would be fun to play for the ride, “Try DragonBox.  It’s fun!”

As a math teacher, I certainly can appreciate the game’s end-of-level challenges to get the box alone (solve for a variable) in the right number of moves (efficiency) using the right number of cards (also efficiency).  Still, there were a few times when I noted that a particular scenario could have been solved using a different sequence of equally-efficient moves that were not appropriately acknowledged as such by the software.  My teacher side wasn’t particularly pleased with the only-one-way-earns-top-recognition approach of the app, especially when other alternatives are equally valid.  Too many times, I fear students are faced with similar scenarios in their math classes.  Efficiency and elegance are certainly valuable skills in mathematics, but I think we too often try to impose rigor on young learners long before they have achieved basic understanding.

My grousing aside, my daughter and her friends weren’t bothered at all by the rare times where I had identified alternatives–I don’t think they even noticed.  Back to my point about too much emphasis on “the ‘right’ way” too early, I decided not to mention it to them.  As Mark Twain noted, I decided not “to let schooling get in the way of [their] education.”

CONCLUSION:  I hope you get a kick out of Paul’s imbalance problems (no matter what your age) and DragonBox if you have some younger kids around.  As always, make learning fun and not obvious–your charges will learn in spite of themselves!

Polar Derivatives on TI-Nspire CAS

The following question about how to compute derivatives of polar functions was posted on the College Board’s AP Calculus Community bulletin board today.

AP Calculus Polar

From what I can tell, there are no direct ways to get derivative values for polar functions.  There are two ways I imagined to get the polar derivative value, one graphically and the other CAS-powered.  The CAS approach is much  more accurate, especially in locations where the value of the derivative changes quickly, but I don’t think it’s necessarily more intuitive unless you’re comfortable using CAS commands.  For an example, I’ll use r=2+3sin(\theta ) and assume you want the derivative at \theta = \frac{\pi }{6}.

METHOD 1:  Graphical

Remember that a derivative at a point is the slope of the tangent line to the curve at that point.  So, finding an equation of a tangent line to the polar curve at the point of interest should find the desired result.

Create a graphing window and enter your polar equation (menu –> 3:Graph Entry –> 4:Polar).  Then drop a tangent line on the polar curve (menu –> 8:Geometry –> 1:Points&Lines –> 7:Tangent).  You would then click on the polar curve once to select the curve and a second time to place the tangent line.  Then press ESC to exit the Tangent Line command.

Polar1

To get the current coordinates of the point and the equation of the tangent line, use the Coordinates & Equation tool (menu –> 1:Actions –> 8:Coordinates and Equations).  Click on the point and the line to get the current location’s information.  After each click, you’ll need to click again to tell the nSpire where you want the information displayed.

Polar2

To get the tangent line at \theta =\frac{\pi }{6}, you could drag the point, but the graph settings seem to produce only Cartesian coordinates.  Converting \theta =\frac{\pi }{6} on r=2+3sin(\theta ) to Cartesian gives

\left( x,y \right) = \left( r \cdot cos(\theta ), r \cdot sin(\theta ) \right)=\left( \frac{7\sqrt{3}}{4},\frac{7}{4} \right) .

So the x-coordinate is \frac{7\sqrt{3}}{4} \approx 3.031.  Drag the point to find the approximate slope, \frac{dy}{dx} \approx 8.37.  Because the slope of the tangent line changes rapidly at this location on this polar curve, this value of 8.37 will be shown in the next method to be a bit off.

Polar3

Unfortunately, I tried to double-click the x-coordinate to set it to exactly \frac{7\sqrt{3}}{4}, but that property is also disabled in polar mode.

METHOD 2:  CAS

Using the Chain Rule, \displaystyle \frac{dy}{dx} = \frac{dy}{d\theta }\cdot \frac{d\theta }{dx} = \frac{\frac{dy}{d\theta }}{\frac{dx}{d\theta }}.  I can use this and the nSpire’s ability to define user-created functions to create a \displaystyle \frac{dy}{dx} polar differentiator for any polar function r=a(\theta ).  On a Calculator page, I use the Define function (menu –> 1:Actions –> 1:Define) to make the polar differentiator.  All you need to do is enter the expression for a as shown in line 2 below.

Polar4This can be evaluated exactly or approximately at \theta=\frac{\pi }{6} to show \displaystyle \frac{dy}{dx} = 5\sqrt{3}=\approx 8.660.

Polar5

Conclusion:

As with all technologies, getting the answers you want often boils down to learning what questions to ask and how to phrase them.

Binomial Probability and CAS

I posted previously about a year ago an idea for using CAS in a statistics course with probability.  I’ve finally had an opportunity to use it with students in my senior one-semester statistics course over the last few weeks, so I thought I’d share some refinements.  To demonstrate the mathematics, I’ll use the following problem situation.

Assume in a given country that women represent 40% of the total work force.  A company in that country has 10 employees, only 2 of which are women.
1) What is the probability that by pure chance a 10-employee company in that country might employ exactly 2 women?
2) What is the probability that by pure chance a 10-employee company in that country might employ 2 or fewer women?

Over a decade ago, I used binomial probability situations like this as an application of polynomial expansions, tapping Pascal’s Triangle and combinatorics to find the number of ways a group of exactly 2 women can appear in a total group size of 10.  Historically, I encouraged students to approach this problem by defining m=men and w=women and expand (m+w)^{10} where the exponent was the number of employees, or more generally, the number of trials.  Because question 1 asks about the probability of exactly 2 women, I was interested in the specific term in the binomial expansion that contained w^2.  Whether you use Pascal’s Triangle or combinations, that term is 45w^2m^8.  Substituting in given percentages of women and men in the workforce, P(w)=0.4 and P(m)=0.6, answers the first question.  I used a TI-nSpire to determine that there is a 12.1% chance of this.

That was 10-20 years ago and I hadn’t taught a statistics course in a very long time.  I suspect most statistics classes using TI-nSpires (CAS or non-CAS) today use the binompdf command to get this probability.

The slight differences in the input parameters determine whether you get the probability of the single event or the probabilities for all of the events in the entire sample space.  The challenge for the latter is remembering that the order of the probabilities starts at 0 occurrences of the event whose probability is defined by the second parameter.  Counting over carefully from the correct end of the sequence gives the desired probability.

With my exploration of CAS in the classroom over the past decade, I saw this problem very differently when I posted last year.  The binompdf command works well, but you need to remember what the outputs mean.  The earlier algebra does this, but it is clearly more cumbersome.  Together, all of this screams (IMO) for a CAS.  A CAS could enable me to see the number of ways each event in the sample space could occur.  The TI-nSpire CAS‘s output using an expand command follows.

The cool part is that all 11 terms in this expansion appear simultaneously.  It would be nice if I could see all of the terms at once, but a little scrolling leads to the highlighted term which could then be evaluated using a substitute command.

The insight from my previous post was that when expanding binomials, any coefficients of the individual terms “received” the same exponents as the individual variables in the expansion.  With that in mind, I repeated the expansion.

The resulting polynomial now shows all the possible combinations of men and women, but now each coefficient is the probability of its corresponding event.  In other words, in a single command this approach defines the entire probability distribution!  The highlighted portion above shows the answer to question 1 in a single step.

Last week one of my students reminded me that TI-nSpire CAS variables need not be restricted to a single character.  Some didn’t like the extra typing, but others really liked the fully descriptive output.

To answer question 2, TI-nSpire users could add up the individual binompdf outputs -OR- use a binomcdf command.

This gets the answer quickly, but suffers somewhat from the lack of descriptives noted earlier.  Some of my students this year preferred to copy the binomial expansion terms from the CAS expand command results above, delete the variable terms, and sum the results.  Then one suggested a cool way around the somewhat cumbersome algebra would be to substitute 1s for both variables.

CONCLUSION:  I’ve loved the way my students have developed a very organic understanding of binomial probabilities over this last unit.  They are using technology as a scaffold to support cumbersome, repetitive computations and have enhanced in a few directions my initial presentations of optional ways to incorporate CAS.  This is technology serving its appropriate role as a supporter of student learning.

OTHER CAS:  I focused on the TI-nSpire CAS for the examples above because that is the technology is my students have.  Obviously any CAS system would do.  For a free, Web-based CAS system, I always investigate what Wolfram Alpha has to offer.  Surprisingly, it didn’t deal well with the expanded variable names in (0.4women+0.6men)^{10}.  Perhaps I could have used a syntax variation, but what to do wasn’t intuitive, so I simplified the variables here to get

Huge Pro:  The entire probability distribution with its descriptors is shown.
Very minor Con:  Variables aren’t as fully readable as with the fully expanded variables on the nSpire CAS.