# Monthly Archives: November 2014

## Probability, Polynomials, and Sicherman Dice

Three years ago, I encountered a question on the TI-Nspire Google group asking if there was a way to use CAS to solve probability problems.  The ideas I pitched in my initial response and follow-up a year later (after first using it with students in a statistics class) have been thoroughly re-confirmed in my first year teaching AP Statistics.  I’ll quickly re-share them below before extending the concept with ideas I picked up a couple weeks ago from Steve Phelps’ session on Probability, Polynomials, and CAS at the 64th annual OCTM conference earlier this month in Cleveland, OH.

BINOMIALS:  FROM POLYNOMIALS TO SAMPLE SPACES

Once you understand them, binomial probability distributions aren’t that difficult, but the initial conjoining of combinatorics and probability makes this a perennially difficult topic for many students.  The standard formula for the probability of determining the chances of K successes in N attempts of a binomial situation where p is the probability of a single success in a single attempt is no less daunting:

$\displaystyle \left( \begin{matrix} N \\ K \end{matrix} \right) p^K (1-p)^{N-K} = \frac{N!}{K! (N-K)!} p^K (1-p)^{N-K}$

But that is almost exactly the same result one gets by raising binomials to whole number powers, so why not use a CAS to expand a polynomial and at least compute the $\displaystyle \left( \begin{matrix} N \\ K \end{matrix} \right)$ portion of the probability?  One added advantage of using a CAS is that you could use full event names instead of abbreviations, making it even easier to identify the meaning of each event.

The TI-Nspire output above shows the entire sample space resulting from flipping a coin 6 times.  Each term is an event.  Within each term, the exponent of each variable notes the number of times that variable occurs and the coefficient is the number of times that combination occurs.  The overall exponent in the expand command is the number of trials.  For example, the middle term– $20\cdot heads^3 \cdot tails^3$ –says that there are 20 ways you could get 3 heads and 3 tails when tossing a coin 6 times. The last term is just $tails^6$, and its implied coefficient is 1, meaning there is just one way to flip 6 tails in 6 tosses.

The expand command makes more sense than memorized algorithms and provides context to students until they gain a deeper understanding of what’s actually going on.

FROM POLYNOMIALS TO PROBABILITY

Still using the expand command, if each variable is preceded by its probability, the CAS result combines the entire sample space AND the corresponding probability distribution function.  For example, when rolling a fair die four times, the distribution for 1s vs. not 1s (2, 3, 4, 5, or 6) is given by

The highlighted term says there is a 38.58% chance that there will be exactly one 1 and any three other numbers (2, 3, 4, 5, or 6) in four rolls of a fair 6-sided die.  The probabilities of the other four events in the sample space are also shown.  Within the TI-Nspire (CAS or non-CAS), one could use a command to give all of these probabilities simultaneously (below), but then one has to remember whether the non-contextualized probabilities are for increasing or decreasing values of which binomial outcome.

Particularly early on in their explorations of binomial probabilities, students I’ve taught have shown a very clear preference for the polynomial approach, even when allowed to choose any approach that makes sense to them.

TAKING POLYNOMIALS FROM ONE DIE TO MANY

Given these earlier thoughts, I was naturally drawn to Steve Phelps “Probability, Polynomials, and CAS” session at the November 2014 OCTM annual meeting in Cleveland, OH.  Among the ideas he shared was using polynomials to create the distribution function for the sum of two fair 6-sided dice.  My immediate thought was to apply my earlier ideas.  As noted in my initial post, the expansion approach above is not limited to binomial situations.  My first reflexive CAS command in Steve’s session before he share anything was this.

By writing the outcomes in words, the CAS interprets them as variables.  I got the entire sample space, but didn’t learn gain anything beyond a long polynomial.  The first output– $five^2$ –with its implied coefficient says there is 1 way to get 2 fives.  The second term– $2\cdot five \cdot four$ –says there are 2 ways to get 1 five and 1 four.  Nice that the technology gives me all the terms so quickly, but it doesn’t help me get a distribution function of the sum.  I got the distributions of the specific outcomes, but the way I defined the variables didn’t permit sum of their actual numerical values.  Time to listen to the speaker.

He suggested using a common variable, X, for all faces with the value of each face expressed as an exponent.  That is, a standard 6-sided die would be represented by $X^1+X^2+ X^3+X^4+X^5+X^6$ where the six different exponents represent the numbers on the six faces of a typical 6-sided die.  Rolling two such dice simultaneously is handled as I did earlier with the binomial cases.

NOTE:  Exponents are handled in TWO different ways here.  1) Within a single polynomial, an exponent is an event value, and 2) Outside a polynomial, an exponent indicates the number of times that polynomial is applied within the specific event.  Coefficients have the same meaning as before.

Because the variables are now the same, when specific terms are multiplied, their exponents (face values) will be added–exactly what I wanted to happen.  That means the sum of the faces when you roll two dice is determined by the following.

Notice that the output is a single polynomial.  Therefore, the exponents are the values of individual cases.  For a couple examples, there are 3 ways to get a sum of 10 $\left( 3 \cdot x^{10} \right)$, 2 ways to get a sum of 3 $\left( 2 \cdot x^3 \right)$, etc.  The most commonly occurring outcome is the term with the largest coefficient.  For rolling two standard fair 6-sided dice, a sum of 7 is the most common outcome, occurring 6 times $\left( 6 \cdot x^7 \right)$.  That certainly simplifies the typical 6×6 tables used to compute the sums and probabilities resulting from rolling two dice.

While not the point of Steve’s talk, I immediately saw that technology had just opened the door to problems that had been computationally inaccessible in the past.  For example, what is the most common sum when rolling 5 dice and what is the probability of that sum?  On my CAS, I entered this.

In the middle of the expanded polynomial are two terms with the largest coefficients, $780 \cdot x^{18}$ and $780 \cdot x^{19}$, meaning a sums of 17 and 18 are the most common, equally likely outcomes when rolling 5 dice.  As there are $6^5=7776$ possible outcomes when rolling a die 5 times, the probability of each of these is $\frac{780}{7776} \approx 0.1003$, or about 10.03% chance each for a sum of 17 or 18.  This can be verified by inserting the probabilities as coefficients before each term before CAS expanding.

With thought, this shouldn’t be surprising as the expected mean value of rolling a 6-sided die many times is 3.5, and $5 \cdot 3.5 = 17.5$, so the integers on either side of 17.5 (17 & 18) should be the most common.  Technology confirms intuition.

ROLLING DIFFERENT DICE SIMULTANEOUSLY

What is the distribution of sums when rolling a 4-sided and a 6-sided die together?  No problem.  Just multiply two different polynomials, one representative of each die.

The output shows that sums of 5, 6, and 7 would be the most common, each occurring four times with probability $\frac{1}{6}$ and together accounting for half of all outcomes of rolling these two dice together.

A BEAUTIFUL EXTENSION–SICHERMAN DICE

My most unexpected gain from Steve’s talk happened when he asked if we could get the same distribution of sums as “normal” 6-sided dice, but from two different 6-sided dice.  The only restriction he gave was that all of the faces of the new dice had to have positive values.  This can be approached by realizing that the distribution of sums of the two normal dice can be found by multiplying two representative polynomials to get

$x^{12}+2x^{11}+3x^{10}+4x^9+5x^8+6x^7+5x^6+4x^5+3x^4+2x^3+x^2$.

Restating the question in the terms of this post, are there two other polynomials that could be multiplied to give the same product?  That is, does this polynomial factor into other polynomials that could multiply to the same product?  A CAS factor command gives

Any rearrangement of these eight (four distinct) sub-polynomials would create the same distribution as the sum of two dice, but what would the the separate sub-products mean in terms of the dice?  As a first example, what if the first two expressions were used for one die (line 1 below) and the two squared trinomials comprised a second die (line 2)?

Line 1 actually describes a 4-sided die with one face of 4, two faces with 3s, and one face of 2.  Line 2 describes a 9-sided die (whatever that is) with one face of 8, two faces of 6, three faces of 4, two faces of 2, and one face with a 0 ( $1=1 \cdot x^0$).  This means rolling a 4-sided and a 9-sided die as described would give exactly the same sum distribution.  Cool, but not what I wanted.  Now what?

Factorization gave four distinct sub-polynomials, each with multitude 2.  One die could contain 0, 1, or 2 of each of these with the remaining factors on the other die.  That means there are $3^4=81$ different possible dice combinations.  I could continue with a trail-and-error approach, but I wanted to be more efficient and elegant.

What follows is the result of thinking about the problem for a while.  Like most math solutions to interesting problems, ultimate solutions are typically much cleaner and more elegant than the thoughts that went into them.  Problem solving is a messy–but very rewarding–business.

SOLUTION

Here are my insights over time:

1) I realized that the $x^2$ term would raise the power (face values) of the desired dice, but would not change the coefficients (number of faces).  Because Steve asked for dice with all positive face values.  That meant each desired die had to have at least one x to prevent non-positive face values.

2) My first attempt didn’t create 6-sided dice.  The sums of the coefficients of the sub-polynomials determined the number of sides.  That sum could also be found by substituting $x=1$ into the sub-polynomial.  I want 6-sided dice, so the final coefficients must add to 6.  The coefficients of the factored polynomials of any die individually must add to 2, 3, or 6 and have a product of 6.  The coefficients of $(x+1)$ add to 2, $\left( x^2+x+1 \right)$ add to 3, and $\left( x^2-x+1 \right)$ add to 1.  The only way to get a polynomial coefficient sum of 6 (and thereby create 6-sided dice) is for each die to have one $(x+1)$ factor and one $\left( x^2+x+1 \right)$ factor.

3) That leaves the two $\left( x^2-x+1 \right)$ factors.  They could split between the two dice or both could be on one die, leaving none on the other.  We’ve already determined that each die already had to have one each of the x, $(x+1)$, and $\left( x^2+x+1 \right)$ factors.  To also split the $\left( x^2-x+1 \right)$ factors would result in the original dice:  Two normal 6-sided dice.  If I want different dice, I have to load both of these factors on one die.

That means there is ONLY ONE POSSIBLE alternative for two 6-sided dice that have the same sum distribution as two normal 6-sided dice.

One die would have single faces of 8, 6, 5, 4, 3, and 1.  The other die would have one 4, two 3s, two 2s, and one 1.  And this is exactly the result of the famous(?) Sicherman Dice.

If a 0 face value was allowed, shift one factor of x from one polynomial to the other.  This can be done two ways.

The first possibility has dice with faces {9, 7, 6, 5, 4, 2} and {3, 2, 2, 1, 1, 0}, and the second has faces {7, 5, 4, 3, 2, 0} and {5, 4, 4, 3, 3, 2}, giving the only other two non-negative solutions to the Sicherman Dice.

Both of these are nothing more than adding one to all faces of one die and subtracting one from from all faces of the other.  While not necessary to use polynomials to compute these, they are equivalent to multiplying the polynomial of one die by x and the other by $\frac{1}{x}$ as many times as desired. That means there are an infinite number of 6-sided dice with the same sum distribution as normal 6-sided dice if you allow the sides to have negative faces.  One of these is

corresponding to a pair of Sicherman Dice with faces {6, 4, 3, 2, 1, -1} and {1,5,5,4,4,3}.

CONCLUSION:

There are other very interesting properties of Sicherman Dice, but this is already a very long post.  In the end, there are tremendous connections between probability and polynomials that are accessible to students at the secondary level and beyond.  And CAS keeps the focus on student learning and away from the manipulations that aren’t even the point in these explorations.

Enjoy.

## CAS Conference

Computer algebra systems (CAS) have the potential to revolutionize mathematics education at the middle and secondary level. Experience how CAS can be integrated into Pre-algebra, Algebra 1 & 2, Precalculus, Calculus, Statistics, and Geometry classes.

Consider attending (or maybe even proposing a session) for the 9th USACAS conference, July 18-19, 2015 at Hawken School in Cleveland, OH.

• Discover how secondary and middle school teachers are using CAS in their own classrooms.
• Get classroom tested ideas developed for CAS-enhanced classrooms.
• Learn what other countries are doing with CAS.
• Interact with prominent US and International CAS pioneers.

Information on registration, speakers, presentations, Saturday outing, and hotel can be found at http://usacas.org .

Consider proposing a session at http://bit.ly/USACAS9_speakers .

## Squares and Octagons, A compilation

My last post detailed my much-too-long trigonometric proof of why the octagon formed by connecting the midpoints and vertices of the edges of a square into an 8-pointed star is always 1/6 of the area of the original square.

My proof used trigonometry, and responses to the post on Twitter  and on my ‘blog showed many cool variations.  Dave Radcliffe thought it would be cool to have a compilation of all of the different approaches.  I offer that here in the order they were shared with me.

Method 1:  My use of trigonometry in a square.  See my original post.

Method 2:  Using medians in a rectangle from Tatiana Yudovina, a colleague at Hawken School.

Below, the Area(axb rectangle) = ab = 16 blue triangles, and
Area(octagon) = 4 blue triangles – 2 red deltas..

Now look at the two green, similar triangles.  They are similar with ratio 1/2, making

Area(red delta) = $\displaystyle \frac{b}{4} \cdot \frac{a}{6} = \frac{ab}{24}$, and

Area(blue triangle) = $\displaystyle \frac{1}{16} ab$

So, Area(octagon) = $\displaystyle 2 \frac{ab}{24}-4\frac {ab}{16}=\frac{1}{6}ab$.

QED

Method 3:  Using differences in triangle areas in a square (but easily extended to rectangles)from @Five_Triangles (‘blog here).

Full solution here.

Method 4:  Very clever shorter solution using triangle area similarity in a square also from @Five_Triangles (‘blog here).

Full second solution here.

Method 5:  Great option Using dilated kitesfrom Dave Radcliffe posting as @daveinstpaul.

Full pdf and proof here.

Method 6:  Use fact that triangle medians trisect each other from Mike Lawler posting as @mikeandallie.

Tweet of solution here.

Method 7:  Use a coordinate proof on a specific square from Steve Ingrassia, a colleague at Hawken School.  Not a quick proof like some of the geometric solutions, but it’s definitely different than the others.

If students know the formula for finding the area of any polygon using its coordinates, then they can prove this result very simply with nothing more than simple algebra 1 techniques.   No trig is required.

The area of polygon with vertices (in either clockwise or counterclockwise order, starting at any vertex) of $(x_1, y_1)$, $(x_2, y_2)$, …, $(x_n, y_n)$ is

$\displaystyle Area = \left| \frac{(x_1y_2-x_2y_1)+(x_2y_3-x_3y_2)+...+(x_{n-1}y_n-x_ny_{n-1})}{2} \right|$

Use a 2×2 square situated with vertices at (0,0), (0,2), (2,2), and (2,0).  Construct segments connecting each vertex with the midpoints of the sides of the square, and find the equations of the associated lines.

• L1 (connecting (0,0) and (2,1):    y = x/2
• L2 (connecting (0,0) and (1,2):   y=2x
• L3 (connecting (0,1) and (2,0):  y= -x/2 + 1
• L4 (connecting (0,1) and (2,2):  y= x/2 + 1
• L5 (connecting (0,2) and (1,0):  y = -2x + 2
• L6 (connecting (0,2) and (2,1):  y= -x/2 + 2
• L7 (connecting (1,2) and (2,0):  y = -2x + 4
• L8 (connecting (2,2) and (1,0):  y = 2x – 2

The 8 vertices of the octagon come at pairwise intersections of some of these lines, which can be found with simple substitution:

• Vertex 1 is at the intersection of L1 and L3:   (1, 1/2)
• Vertex 2 is at the intersection of L3 and L5:  (2/3, 2/3)
• Vertex 3 is at the intersection of L2 and L5:  (1/2, 1)
• Vertex 4 is at the intersection of L2 and L4:  (2/3, 4/3)
• Vertex 5 is at the intersection of L4 and L6:  (1, 3/2)
• Vertex 6 is at the intersection of L6 and L7:  (4/3, 4/3)
• Vertex 7 is at the intersection of L7 and L8:  (3/2, 1)
• Vertex 8 is at the intersection of L1 and L8:  (4/3, 2/3)

Using the coordinates of these 8 vertices in the formula for the area of the octagon, gives

$\displaystyle \frac{ \left| 1/3 +1/3+0+(-1/3)+(-2/3)+(-1/3)+0 \right|}{2} = \frac{2}{3}$

Since the area of the original square was 4, the area of the octagon is exactly 1/6th of the area of the square.

## Squares and Octagons

Following is a really fun problem Tom Reardon showed my department last May as he led us through some TI-Nspire CAS training.  Following the introduction of the problem, I offer a mea culpa, a proof, and an extension.

THE PROBLEM:

Take any square and construct midpoints on all four sides.
Connect the four midpoints and four vertices to create a continuous 8-pointed star as shown below.  The interior of the star is an octagon.  Construct this yourself using your choice of dynamic geometry software and vary the size of the square.

Compare the areas of the external square and the internal octagon.

You should find that the area of the original square is always 6 times the area of the octagon.

I thought that was pretty cool.  Then I started to play.

MINOR OBSERVATIONS:

Using my Nspire, I measured the sides of the octagon and found it to be equilateral.

As an extension of Tom’s original problem statement, I wondered if the constant square:octagon ratio occurred in any other quadrilaterals.  I found the external quadrilateral was also six times the area of the internal octagon for parallelograms, but not for any more general quadrilaterals.  Tapping my understanding of the quadrilateral hierarchy, that means the property also holds for rectangles and rhombi.

MEA CULPA:

Math teachers always warn students to never, ever assume what they haven’t proven.  Unfortunately, my initial exploration of this problem was significantly hampered by just such an assumption.  I obviously know better (and was reminded afterwards that Tom actually had told us that the octagon was not equiangular–but like many students, I hadn’t listened).   After creating the original octagon, measuring its sides and finding them all equivalent, I errantly assumed the octagon was regular.  That isn’t true.

That false assumption created flaws in my proof and generalizations.  I discovered my error when none of my proof attempts worked out, and I eventually threw everything out and started over.  I knew better than to assume.  But I persevered, discovered my error through back-tracking, and eventually overcame.  That’s what I really hope my students learn.

THE REAL PROOF:

Goal:  Prove that the area of the original square is always 6 times the area of the internal octagon.

Assume the side length of a given square is $2x$, making its area $4x^2$.

The octagon’s area obviously is more complicated.  While it is not regular, the square’s symmetry guarantees that it can be decomposed into four congruent kites in two different ways.  Kite AFGH below is one such kite.

Therefore, the area of the octagon is 4 times the area of AFGH.  One way to express the area of any kite is $\frac{1}{2}D_1\cdot D_2$, where $D_1$ and $D_2$ are the kite’s diagonals. If I can determine the lengths of $\overline{AG}$ and $\overline {FH}$, then I will know the area of AFGH and thereby the ratio of the area of the square to the area of the octagon.

The diagonals of every kite are perpendicular, and the diagonal between a kite’s vertices connecting its non-congruent sides is bisected by the kite’s other diagonal.  In terms of AFGH, that means $\overline{AG}$ is the perpendicular bisector of $\overline{FH}$.

The square and octagon are concentric at point A, and point E is the midpoint of $\overline{BC}$, so $\Delta BAC$ is isosceles with vertex A, and $\overline{AE}$ is the perpendicular bisector of $\overline{BC}$.

That makes right triangles $\Delta BEF \sim \Delta BCD$.  Because $\displaystyle BE=\frac{1}{2} BC$, similarity gives $\displaystyle AF=FE=\frac{1}{2} DC=\frac{x}{2}$.  I know one side of the kite.

Let point I be the intersection of the diagonals of AFGH.  $\Delta BEA$ is right isosceles, so $\Delta AIF$ is, too, with $m\angle{IAF}=45$ degrees.  With $\displaystyle AF=\frac{x}{2}$, the Pythagorean Theorem gives $\displaystyle IF=\frac{x}{2\sqrt{2}}$.  Point I is the midpoint of $\overline{FH}$, so $\displaystyle FH=\frac{x}{\sqrt{2}}$.  One kite diagonal is accomplished.

Construct $\overline{JF} \parallel \overline{BC}$.  Assuming degree angle measures, if $m\angle{FBC}=m\angle{FCB}=\theta$, then $m\angle{GFJ}=\theta$ and $m\angle{AFG}=90-\theta$.  Knowing two angles of $\Delta AGF$ gives the third:  $m\angle{AGF}=45+\theta$.

I need the length of the kite’s other diagonal, $\overline{AG}$, and the Law of Sines gives

$\displaystyle \frac{AG}{sin(90-\theta )}=\frac{\frac{x}{2}}{sin(45+\theta )}$, or

$\displaystyle AG=\frac{x \cdot sin(90-\theta )}{2sin(45+\theta )}$.

Expanding using cofunction and angle sum identities gives

$\displaystyle AG=\frac{x \cdot sin(90-\theta )}{2sin(45+\theta )}=\frac{x \cdot cos(\theta )}{2 \cdot \left( sin(45)cos(\theta ) +cos(45)sin( \theta) \right)}=\frac{x \cdot cos(\theta )}{\sqrt{2} \cdot \left( cos(\theta ) +sin( \theta) \right)}$

From right $\Delta BCD$, I also know $\displaystyle sin(\theta )=\frac{1}{\sqrt{5}}$ and $\displaystyle cos(\theta)=\frac{2}{\sqrt{5}}$.  Therefore, $\displaystyle AG=\frac{x\sqrt{2}}{3}$, and the kite’s second diagonal is now known.

So, the octagon’s area is four times the kite’s area, or

$\displaystyle 4\left( \frac{1}{2} D_1 \cdot D_2 \right) = 2FH \cdot AG = 2 \cdot \frac{x}{\sqrt{2}} \cdot \frac{x\sqrt{2}}{3} = \frac{2}{3}x^2$

Therefore, the ratio of the area of the square to the area of its octagon is

$\displaystyle \frac{area_{square}}{area_{octagon}} = \frac{4x^2}{\frac{2}{3}x^2}=6$.

QED

EXTENSIONS:

This was so nice, I reasoned that it couldn’t be an isolated result.

I have extended and proved that the result is true for other modulo-3 stars like the 8-pointed star in the square for any n-gon.  I’ll share that very soon in another post.

I proved the result above, but I wonder if it can be done without resorting to trigonometric identities.  Everything else is simple geometry.   I also wonder if there are other more elegant approaches.

Finally, I assume there are other constant ratios for other modulo stars inside larger n-gons, but I haven’t explored that idea.  Anyone?

## Calculus Humor

Completely frivolous post.

OK, my Halloween “costume” at school this year was pretty lame, but I actually did put a minute amount of thought into it.

In case you can’t read the sign, it says $\int 3(ice)^2d(ice)$.  If you remember some calculus and treat ice as your variable, that works out to $ice^3$–An Ice Cube!  Ha!

But it gets better.  As there weren’t any bounds, adding the random constant of integration makes it $ice^3+C$ or “Ice Cube + C”, or maybe “Ice Cube + Sea”–I was really dressed up as an Iceberg.  Ha! Ha!  Having no idea how to dress like an iceberg, I wore a light blue shirt for the part of the iceberg above the water and dark blue pants for the part below the water.  I tried to be clever even if the underlying joke was just “punny”.

Then a colleague posted another integral joke I’d seen sometime before.  It has some lovely extensions, so I’ll share that, too.

What is $\int \frac{d(cabin)}{cabin}$?

At first glance, it’s a “log cabin.”  Funny.

But notationally, the result is actually $ln(cabin)$, so the environmentalists out there will appreciate that the answer is really a “natural log cabin.”  Even funnier.

The most correct solution is $ln(cabin)+C$.  If you call the end “+ Sea”, then the most clever answer is that $\int \frac{d(cabin)}{cabin}$ is a “Houseboat”.  Ha!

Hope you all had some fun.