# Sage Interact Essentials: Dynamic Table

Following up on an earlier post about tables in HTML, I put together a simple example of a Sage Interact manipulative where the table expands depending on the size of the data. I don't see much educational benefit to the manipulative; it simulates picking the order of a list of  n items and determines the experimental probability of getting a derangement. The table lists the probability of getting a derangement for lists of size 1 through n:

I've posted the code for this simple example on the Sage Interact Essentials page. If nothing else, it shows how an HTML table can make your manipulative look just a little bit nicer.

# Graphics: Circles Inscribed in (Regular) Polygons

In the Graphics: Inscribed Polygons post of February 16, 2012 I posted a collection of inscribed polygons to the Graphics page to illustrate that the area of a regular polygon inscribed in a unit circle is a lower bound on the estimate of $latex \pi$. Today I've added a collection of unit circles inscribed in regular polygons (posted on the Graphics page) which can illustrate  the area of the regular polygons is an upper bound on the estimate of $latex \pi$. Before calculators were invented, mathematicians could figure out the length of each side of the regular polygon (if the angle was "nice") and use it to calculate the area of the regular polygon which would be greater than $latex \pi$.

In the case above, $latex x=\sqrt{3}$ so the length of each side of the triangle is $latex 2\sqrt{3}$. The area formula for the regular triangle with each side of length $latex 2\sqrt{3}$ is calculated using the formula $latex A=\frac{3(2\sqrt{3})a}{2}$ where a is the apothem. Since this value is 1, the area of the triangle is just $latex A=3\sqrt{3}$, hence $latex \pi <3\sqrt{3}$. That's not a good estimate of $latex \pi$ but, of course, that estimate gets better as the number of sides increases.

# Sage Interact Essentials: Tables

Chances are, at some point, you'll find you want to create tables for your Sage Interact manipulative. Tables are a great way to organize information and can make your manipulative look a little more professional.

Having some examples to refer to as you create your own tables is useful. I've added this information on tables (along with some code) to the Sage Interact Essentials page. The output of the code looks like this:

# Web Equation

If you're new to $latex \LaTeX$, learning all the commands to typeset math takes time. Chances are you'll make some mistakes as well and end up with code that doesn't compile. That leaves you with the task of debugging the code, slowing you down even more. If that's deterring you from using $latex \LaTeX$, you might be interested in a tool that can help: Web Equation. I stumbled upon it recently and thought it might be helpful to those not yet proficient with $latex \LaTeX$. Click on the garbage can to clear the screen, write the equation you want and it will show you what it thinks you want in the bottom left hand corner. If that's correct, all you need to do is copy and paste the $latex \LaTeX$ code it gives you from the bottom right hand corner. It even gives MathML output. If you make a mistake along the way, the arrows in the upper left hand corner of the yellow region allow you to undo and redo your strokes.

I've found the site does a pretty good job with a lot of the examples I tried: complex fractions, sequences, series, integrals, and more. It couldn't handle equations with matrices, though, and I felt at times it would be nice if they'd add an eraser to let you remove part of a stroke. I've added a link to the Web Equation site on the sidebar. Note that there are more tools on the Web Equation home page.

# Sage Interact: Experimental Probability

Experimental probability comes up in a typical probability/statistics class but it's also a great topic to (re)introduce when your class is learning about the idea of limits (typically calculus or precalculus). That's because coin flipping is a relatively concrete and an easy to explain, natural example of a limit. Calculating the ratio of the number of heads flipped to the total number of coin flips is easy. Start by leading your class through the calculations for the ratio. If you do that for the first 10 or 20 flips your class should understand. They'll also get a chance to appreciate how quickly the ratio changes when there haven't been many coin flips. But as the number of flips increases, your class will definitely get bored and/or restless. That's where the Sage Interact manipulative comes in: they'll be able to see how the ratio becomes more stable when the coin has been flipped "many" times. This "stable" value, the limit, becomes our estimate of the probability of flipping heads on that particular coin.

If you're teaching prob/stats then the slider for setting the probability of getting heads on a coin flip might be useful in talking about a fair coin. If not then you can, of course, remove that section of the code.

The output is below. It's also posted on the Sage Output page:

The code is posted on the Python/Sage page.