As an officer of Central Austin Toastmasters, I use Meetup to advertise my club and welcome new guests. Meetup allows me to set 15 keywords that best describe my club. It also lets you (a Meetup member) set keywords that describe your interests. Meetup uses your keywords to recommend groups that would interest you.
My goal is to attract more Meetup members so that more will visit my Toastmasters club. Hence, I should select keywords that are not only relevant to my club, but will also likely coincide with your interests.
Which 15 keywords should I use to attract more members?
I wrote a simple program to help me decide on these keywords.
Continue reading “15 Keywords”
Our final problem has no known exact solution. We want to find the area of the shape formed by,
The inequality has two parameters and . They are quantities of length, so they take on a nonnegative value. Let’s try out some values and see what these parameters do. I have colored the resulting shapes in red. (Note, the scales are different.)
When (move along the diagonal, starting from bottom-left), we get the shape of a nice heart. When we increase while holding fixed, the heart morphs into a circle. On the other hand, when we increase while holding fixed, the heart turns into two petals. Well, I see bunny ears.
Clearly, the shape (i.e. area) of our heart depends on the radius and the ear length . Can you guess the formula for the area ?
Continue reading “Monte Carlo Simulations: How Big Is Your Heart?”
Since last week, I’ve been working on a side project for Robert, my former advisor and good friend. He told me that MATLAB has a function called eigshow, which creates a GUI to help us “see” singular value decomposition and eigenvalue decomposition. He wanted a GUI that would similarly help us see and understand induced matrix norm.
The GUI that eigshow creates is cool but rudimentary. What really bothers me is how poorly the code was maintained, with no documentation. I could follow it after some time, but I decided it would be better if I write my GUI from scratch.
So far, my GUI helps you visualize three things:
- Matrix norm
- Singular value decomposition
- Eigenvalue decomposition
The GUI feels great if you have touchscreen and move the vectors with your finger instead of a mouse. I’m hoping to add more features (my code are very modular!) before I get to present linear algebra here. We’ll definitely go over some of the GUI aspects then. Until then, please enjoy these screenshots that I made.
You can find the code in its entirety here:
Download from GitHub
Buffon’s needle is a classic Monte Carlo simulation that we can conduct in a classroom. We give the students, say 10 needles each, and have them drop the needles on a paper that we provide also. The paper is special, in that it has parallel lines that are separated by the length of a needle. Each student records how many needles intersect one of the lines, then we tally their numbers to arrive at a very special number. (Guess who?)
In a class of 30, we have 300 samples to determine this special number. If the students had repeated the experiment ten times (any more than this risks frustration and wrath), we would have 3,000 samples at best. But with a computer program, we can make a million samples easily. In less than a second!
So today, we will learn how to write a program that generates needles (line segments). Our program needs to determine if a needle intersects a line. In general, checking if two line segments intersect is not an easy task. It’s rather amazing how we can look at many line segments (like the ones in the picture above) and instantly tell which lines intersect with which others. In our problem, fortunately, the lines on the paper are parallel and are equally spaced apart. We can use this fact to come up with a simple solution. Lastly, we will learn how to “vectorize” our code. Vectorization allows us to arrive at the answer quickly.
Continue reading “Monte Carlo Simulations: Buffon’s Needle”
An -gram is a word of length that we can create from a set of letters. With two letters , we can form these 3-grams: , , , , , , , and . We will let stand for tails and for heads, so that a 3-gram can represent an outcome if we flip a coin 3 times.
Penney’s game concerns two good friends and their -grams. The game is simple and seemingly fair. Soon Player 1 will call off their long friendship and leave, however. We will find that, whenever , Player 2 is always more likely to win.
Continue reading “Monte Carlo Simulations: Penney’s Game”