Thursday, September 18, 2014

What is with "Princess Bride"?

I've been trying to convince a friend to watch "The Princess Bride". It's harder then it should be. But, I've found it's a hard movie to describe. It may just be me though.

As I try to describe it, I've realized something: I should despise this movie. I used to be into fantasy when I was 10. Honestly, it is not a genre that has grown with me like sci-fi. Science Fiction, once you get past the basic adventure type stories, has some amazing writers who show a side of humanity. They're up there with the classics like Dickens or Upton Sinclair or Steinbeck; it's not the scene that's important, it's the characters and how they act in a given situation that makes them timeless. Failing that, some sci-fi can be great showcases of science. Or it makes for good horror. Fantasy never felt that way to me, with the exception of Harry Potter.

The characters in Princess Bride don't seem that complex when I think about it. Wesley is all about true love. Really, that's it. He is so into the idea that he comes back from the dead for it. But beyond that, that his only motivation. And Buttercup? She just gives up on everything because her "True Love" isn't around. That's not a good character. In fact, I spend half my time yelling at songs on the radio with that premise. The "mawiage" guy is hilarious if you're 9. What, the only joke is he has a funny voice? My dad is a comedic genius then, even though he only uses the voice to tell the one joke he knows.

There is a lot of fucking dialogue in this film. Holy crap, even in the sword fighting scenes they won't shut the hell up. And there's a couple scenes that are sort of anti-climatic. The poison scene, for example. The little guy is built up to be smartest man in the world, no one can out smart him. He spends the whole scene showing how brilliant he is. Then he just. . . dies. The "To the pain speech". He gives this whole speech on how he will mutilate the villain, by cutting out his tongue and eyes and chopping off his feet and hands.  So the villain just gives up.

So what is it about this film? With all this against it, why can I watch it when I'm older and so much more sophisticated? The dialogue is great. The back and forth quips are fun to listen to and enjoy. "Never start a land war in Asia" always makes me chuckle for some reason. "To the pain" is bad-ass. "My name is Inigo Montoya" is as overused as "It's just a flesh wound". Really not the best part in that movie.

The music. I'm a sucker for music, and Mark Knopfler knocked it out of the park. Did you know Mark Knopfler did the music? The guy who wrote such classic hits as "Money for nothing" and "Sultans of Swing"?

Wesley and Inigo really don't have much back story and they both have really simple motivations. Revenge? True love? Please. Seen it before, so what. What Wesley goes through for "True Love" is insane. He comes back from the dead! Twice! And fights giants! And drinks poison! In fact, this movie seems to advance it's plot because of a couple people who are overly dedicated to very simple motivations.

I don't know. I've given up on trying to describe this movie to anyone who hasn't seen it. It's very hard to do. Here's a new challenge: Pick 2 scenes from the movie to show someone who hasn't seen it. You're favorite scenes, scenes that best sum up the movie, whatever.

Tuesday, September 16, 2014

Stuff on this month

I need to sit down and write. For too long, I've wanted to tackle larger, more complex posts, but my current style holds me back from doing this. In fact, my current style holds me back from improvement in general. I sit down, I write, and as soon as I finish, I post. This is great for small stuff, and some bigger stuff where I think of an idea at the beginning of the month, work it out in the notebook and then do one big post. I can't keep doing that, because it requires me to have time. Am I really that busy? Not all the time, and even when I'm busy, I usually have free time after work. The problem becomes tasks put aside for too long become big task that seem to be impossible. Anyway, this is all good, I've done some stuff right this month. Planing out what I want to do for the month is good, because it's one less thing I need to think of. What I need to do is write out at least an outline for the post so I can just add, edit and post. The question is, how to finish out this month?

Friday, September 12, 2014

Sophie Germain Primes

Growl. Here I am, back again. It's a good thing I wrote down all the things I want to cover this month. In the past, when I got this busy, I would end up avoiding the blog all together because I would have to think up a topic, research a bit, then write it. As much as the first step seems easy, when things are busy and I end up at home tired, trying to think of a topic to write about is near impossible. And funny thing is, I finished this yesterday. But then I got my fancy math machine working, my computer I can use for just doing programming and mathematics and such. Some people go through years of schooling, go to all the right places and meet the right people, then get an amazing job at a huge company where they do the work that puts them in history with people like Einstein and Maxwell and Leibniz.  I spend all my money on stupid crap, and build crappy versions of awesome tools with parts I beg from people. I will be lucky to be in the same group with Srinivasa Ramanujan.

What is a Sophie Germain prime number? If you can multiply the prime by 2 and add 1, and the answer is prime, then it's a Sophie Germain prime. For example, take the prime 29. 29 * 2 = 58. 58 + 1 = 59. Quick trick to prove if a number is prime or not: square the number, add 17, then divide by 12. If their is a remainder of 6, or if the calculator you use has .5 after it, then it's prime. In this case, 59 2 + 17 12 has a remainder of 6. So it's prime.

In the example above, 59 is called the safe prime. There's a good s&m joke there, but I'm too mature to make it. What's really cool about Sophie primes is this: 59 * 2 + 1 = 119. 119 is prime, so therefore 59 is a Sophie prime. 119 * 2 + 1 = 239. 119 is a Sophie prime. And so is 239. Same works for other Sophie Primes.

Like I said, I finished this yesterday. I didn't post it, because I also wrote this bash script for Sophie Primes. My month isn't going exactly as planned, but damn it I can at least attempt to try!

#!/bin/bash

echo "Please enter a number"
read NUMB
prime=$(($NUMB**2 + 17))
function e {
    prime=$(($1**2 + 17))
    if [ $(($NUMB)) -le 3 ]; then
       test =$(($NUMB * 2 + 1))
       echo "$NUMB is prime, and the safe prime is $test" 
    elif [ $(($prime % 12)) = 6 ]; then
       echo "$NUMB is a prime number"
       safe=$(($NUMB * 2 + 1))
       sophie=$(($safe**2 + 17))
       if [ $(($sophie % 12)) = 6 ]; then
          echo "$NUMB is a Sophie prime! The safe prime is $safe"
          exit
       else
          echo "$NUMB is prime, but it's not a Sophie prime."
          exit
       fi
    else
       echo "This number is not prime"
       exit
    fi
}
e $NUMB

It's fairly simple code, really. It uses the prime test I discussed early to test if a number is prime or not. If it is, then it multiplies it by 2 and adds one, then tests if that number is prime. Simple. Problem is this: the prime test does not work for numbers less than or equal to three. So there is a special case to check if the number entered is < 3. This is written in bash, which is not that powerful, so it does not like big numbers. If you give it 1000000000000066600000000000001, which is prime, it just says "Not prime". This is because the result of the prime test is too large to store in it's memory.

Questions, comments, thoughts? Leave them below.

Monday, September 8, 2014

Sophie Germain

Sophie Germain was a French Mathematician from the 19th century. Sophie isn't a strange name for 19th century french boys, she was a female mathematician. Women in math during the 1800's were very rare, and they were very amazing, to say the least. Today, I want to talk a bit about her life. But to many naritives focus on how hard women had it in the 19th century, not enough focus on her work. So Wednesday will be focused on her work, which deals with prime numbers.

There is two women during this time that I've done research on, and the other is a Russian women named Sophia Kovalevskaya, who became the first first woman professor of mathematics in Europe. I bring her up, because to be a woman and a mathematician you couldn't just have ambition. You also needed to come from an upper middle class family, have plenty of family friends ranging from liberal to radical, and live in a country during a time of intense political and cultural change. Kovalevskaya was mid to late 19th century Russia during the period when nihilistic and anarchist writers were forming the ideas that later inspired the Russian revolution. Germain was born in 1776 and lived during the French revolution, the Reign of Terror, and the Napoleonic Wars. Tough times make great people, I guess. They still need access to the best ideas and education.

Speaking of access to the great ideas, Germain's initial education in mathematics was by getting texts and notes of lectures from students at the Ecole Polytechnique.  This worked in her favor, as she began to come up with her own ideas and submitted a paper to the math historian, Adrien-Marie Legendre, under a boys name. He was impressed with the work and was surprised to find that the work came from a woman1.

Her real break came from the fact that she was able to keep in contact with the leading mathematicians of the day. Namely, she was able to initiate contact with Carl Friedrich Gauss (something like getting into contact with Stephen Hawking, then getting his help with problems). She used her correspondence with both men to work on her ideas of number theory, then later elasticity.

In her later years, she discovered she had breast cancer. She still worked despite the pain, then died at 55. She was not listed as a mathematician at her death, but merely "property holder". She never married, had know children, but after her death her friend Gauss was able to get an honary degree for her.

Wednesday, I'll focus on her work on prime numbers in number theory.

Sunday, September 7, 2014

Back from a long weekend.

Did the Kennett Square Mushroom Festival all weekend. Good times, but spent. Hope your weekend was good.

Saturday, September 6, 2014

On to week 2

Well, week one done. What makes this harder than the A to Z challenge and some other posts is that this is more than 1000 words. I really need an editor. In fact, that would be really nice to have for this damn thing. It would keep me from knowing how far off topic I got, it would keep my writing tighter, and I wouldn't ramble as much. Now if I could find a friend who could do math that would be willing to read my stuff.

I ended up missing two posts this week. The things I thought would get in the way, did. Since starting this blog, I've gotten much better at time management, but that still doesn't stop life from getting in the way. And sometimes I just can't things done if I have somebody walking up to me every 10 minutes asking me things. The best thing to try then, is to write some outlines of the posts I want to do this week today and tomorrow. That way, I can just add better wording and formatting and it should be quicker to write.

Yesterday I was going to do Belphegor's Prime, but as I was working on it and kept getting stopped it got way too late. I'll move that post to next week, then. Monday will be about Sophie Germain, a french mathematician I've wanted to write about for a while, Wednesday will be Sophie Germain primes, and more about Happy Primes, and then Belphegor on Friday. Tomorrow I'll figure out the other two days. Happy Saturday.

Thursday, September 4, 2014

Types of Primes

Types of primes! Thought primes were just simple elements of multiplication? Nope, there are different types of primes, and it's what changes primes from simple number theory to number game.

For the writers and the word nerds out there, there are palindromic primes, or palprimes. It's exactly what it says on the box, they are primes that are the same backwards and forwards. 11 is palprime. 919 is palprime. My obsession, 1000000000000066600000000000001, is palprime, but I'll talk about that more tomorrow. There are plenty of programming challenges out there for writing script that produces prime numbers. It's a good challenge, really. Given an integer, produce the smallest prime that is also a palprime greater than the given integer. It's a good challenge, because not only would you have to check and see if the number has any factors, but the script would also have to check and see if it's the same number forwards and backwards. If I can get back on my schedule today, I'll take a crack at it with bash. Don't count on it though.

Numbers can be happy, and so can primes. Start with an integer, any integer. (I keep saying integer. Just pick a number that's not negative, is not a fraction, and doesn't have decimal) Say, 44. First, square both numbers, so 42 and 42. Add them together, 16 + 16 to get 32, then repeat. So, 32 + 22 = 13, and 12 + 32 is 10 and 12 + 02 is 1. If the sequence ends in one, then it is happy. If it doesn't end in one, then it loops forever. A happy prime is a happy number that is prime. The first 5 are 7, 13, 19, 23, 31. Feel free to work out the rest.

Visual Representation of Eisenstein Primes
There are Eisenstein Primes. I'm putting this at the end, otherwise everyone's eyes would glaze over and get out of here too early. Eisenstein Integers are integers with the form of Z = a + bω where ω is equal to: e 2πi/3 Heh. Look at that. π and an imaginary number! It is important in higher math, but hey, look at that  Z = a + bω again. That kind of looks like a complex number (not an oxymoron), a + bi. Complex numbers are just a larger equation for (x, y), which is coordinates on a number plane. Which means you can plot Eisenstein primes. Makes a pretty picture, doesn't it?

Primes act in strange ways. Honestly, there are many more types of primes, because primes are the elements of multiplication.

Stupid Wednesday threw me off my schedule, but whatever. The point of this month is partly to prepare for next month, so I'll work around busy stupid Wednesdays. Argh. Tomorrow will be Belphgor's prime, so If I can't do bash today, then bash will work into what I want to do tomorrow.

Wednesday, September 3, 2014

IWSG - But what DO we do with the body?

Proud Member ofBlogging is dead, therefore we should kick and desecrate its corpse. Dress it in fancy clothes and a silly hat, then hang it in the window of the downtown shops. Don't worry, that sentence doesn't cross any lines because nobody shops downtown anymore. They can't be offended if they can't see it.

Now that blogging is dead, maybe we can focus on writing? I mean, blogging left behind some pretty good stuff, and I'm sure he wouldn't mind if we took it (Blogging is masculine, btw, because it ends with a "g" not an "a" which is feminine or an "e" which is gender neutral.) The blog hops, blog fests, writers groups, and general community vibe is a pretty nifty thing. This whole group of writers have banded together to help out each other get published and advertise. People can actually make money by posting journal entries on the web for others to see! It's suggested I should post about about a topic, but come on. I've come across plenty of blogs with no original ideas, no concept of language, and the whole thing looks like it was designed with mspaint on a broken tablet. In fact, you're reading such a blog right now! These guys still have books published though. Maybe it's a good thing blogging finally died. It was starting to get grotesque and boated, and its gangrenous parts were starting to stink.

This internet thing is pretty snazzy medium. Like nothing that came before it, and perhaps like nothing after it. I don't have to learn another language, because my browser tranlates stuff automatically for me. Any of you out there read mspaint adventures? What always impressed me about it, before it became 3000 pages long, is it used the medium to its advantage. Everything is possible; sound, writing, pictures, video, games. I know one of the things lacking in my writing, besides focus and good spelling, is that it doesn't use the formatting ability. Italics, bold, and underlining can emphasize things, but sizes of words can denote volume as well.So writing can become a symphony, with sentences read at a pianissimo, then they can explode into a thunderous forte! Sadly, I still can't realize that dream on blogger. Well, work within the limits,

Insecurities today? I'm reading your comments, and I'm wondering  how I can talk math without using numbers and calculations. It's very possible, you know. The greeks were very picture and geometry oriented,then i the middle ages mathematical answers were passed along using poems. But now, if you can't decpher the symbols and calculations, you're cut completely out of a very elegant language. It's something to play with while I talk primes. My prime post is going up, later! This is quicker and simpler, sort of, and it's going up first. Now for some goals. Next month I want to say "Hey guys, I picked out my 7 to 10 favorite blog posts, and over the next year I'll work on editing them so they are able to be published!" That's my goal. Happy blog hopping.

Tuesday, September 2, 2014

Hello, World

Ok, ok, ok. I've got a busy couple of months, so I'm going to pass the stuff off onto this blog. Monday, Wednesday, and Fridays, prime number posts will go up. Tuesdays and Thursdays, bash script. This blog is one of the best ways for me to learn and become better at a topic. I'm actually really bad with school, surprisingly enough.

Maybe you've heard about some sort of "Linux" thing or maybe some weird "Ubuntu" thing that the dorks and nerds are talking about these days. Maybe you've heard it's free, and uses free software, or maybe you decided that the mascot, Tux the penguin,
Tux the Penguin, cuter than an Apple
  is cute, as opposed to Windows bright color thing or Apples' apple. Maybe that made you download and then you installed it with help of "the computer person" in your family. And now it's on the computer and. . . what the fuck is the big deal?

Really, this Ubuntu thing is brown. It doesn't seem to do anything different except make some task that were once easy on a Windows harder. All you keep hearing about is "How it's so easy to customize!" Well, you can change the background and the theme, whoop-ti-frickin'-do. Could do that on a PC or a Mac, and those worked 90% of the time!

Welcome to the wonderful of bash scripting. It's not much in the world of customization, not much at all really. But it's an easy place to start, and once a person get a hang of it, well I reckon that person would have all the power in their hands. And since it's a Unix thing, Mac users can join in on the fun! Windows users have to deal with the fact that Microsoft keeps pushing their own technology and it doesn't play nice with each other. Windows users have to deal with the fact that they are like Mac users in the 90's.

Lets start. Open the program called "Terminal Emulator", which should be under accessories. You'll be looking at a box that has this in it:
[username@comp ~]$
Type in the following command:
echo "Hello World"
Yup, it's the good 'ole hello world program. All it does is display the words "Hello World". For something functional, you could backup your directory file. Simple, easy, and all you need to do is type:
mkdir Backups
That makes a new Backup file. Then type:
tar -cvzf Directory-mybackup.tar.gz Backups
Now if you accidentally delete the whole directory file, you have a backup! That's it for day one. Come back Thursday for  more. And if I have time this weekend, come back then for a rant on why people should learn programming, and not just Visual-Basic. Oh, and speaking of this weekend, there is this thing called the Kennett Square Mushroom festival in Chester County, Pa. I'll be there this weekend, answering questions about how to grow mushrooms. Stop by, say the secret word (the secret word is: swordfish) and the duck comes down!

Monday, September 1, 2014

Prime numbers go on forever

Number theory is strange. Math is a hard enough subject because you can't just memorize facts and regurgitate them later. Trying to convince a young, dumb kid that math is useful is hard enough without a entire discipline devoted to studying numbers. Not how numbers show us the beauty of the universe, not the patterns the the planets make as they dance around the sun, or even how numbers can predict life events. No, it just studies. . . numbers. It studies their relationships to each other, and maybe there is infinite numbers? Or not? There might be a reason why one pattern in a set of numbers is kind of similar to another? Again, maybe not? Maybe it's just a coincidence.

http://www.numberspiral.com/p/p005.htmlPrime numbers though, those are fascinating. Prime numbers are the first introduction a student gets to the idea that something isn't right in the world of math. That math isn't perfect. It's an easy enough introduction to the world of number theory, since all it requires is the ability to factor numbers.

A quick refresher: Prime numbers are numbers that can only be produced by multiply 1 with the prime. 3 is prime since 1 * 3 = 3, but no other real integers multiply together to make 3. 6 is not prime because it has the factors of {1, 2, 3, 6} or 1 * 6 and 2 * 3. This is kindergarten stuff, really. The world of primes is much, much deeper than that though, and this month I'll be spending 3 days a week to talk about different subjects of primes.

The earliest work into primes comes curiosity of our old friend Euclid. He was the man who proved there are infinite primes. Working with the small primes we know, {2, 3, 5, 7} if these are multiplied together, the product is 210. Add 1, and the number becomes 211. Why add 1? Well, 210 can be factored by the primes in the list, but can 211? Nope. {105.5, 70.33, 42.2, 30.1429} is the list of numbers when 211 is divided by these primes. If a number can be factored, it will be factored by a prime number. If 211 cannot be factored by the primes in the list, then there is 2 conclusions: it can be factored by a prime NOT on the list of small primes we know, or 211 is prime number. Either way, the list is incomplete.

I'll start smaller. p = {2, 5}. 2 * 5 = 10; 10 + 1 = 11. 11 is a number I happen to know is prime, but the proof is easy, divide by every prime up 11, and you'll find they don't work. So the list becomes p = {2, 5, 11} 2 * 5 * 11 = 110, 110 + 1 = 111. Again, this cannot be divided by numbers from the list p so again the conclusion can be drawn that the list is incomplete.

The actual theorem states that given a finite list p of prime numbers, {p1, p2, p3, . . . pn} these numbers can be multiplied together with 1 added to the result. This number, p + 1, cannot be factored by any of the previous primes, so the original list is incomplete. This number is also prime, and by repeating this process ad infinitum the result is more prime numbers.

I'll be talking about primes three times a week for the next few weeks, until September 27 when the Philly Math Meetup will talk about primes. For now, I'm not so sure how to get that group up here for everyone not in Philadelphia to see, but I am working on a soundcloud thing for now. It just needs to be edited and uploaded. More primes on Wednesday, and an IWSG. Tomorrow, intro to bash script.

EDIT:

This is more geared towards my animal goal update, but check out this page here for some dogs in Moscow that need help with food and shelter. Page is in English. Long story short, some dogs were found and are to be euthanized. Anyone can help by donating something to help with the care for these dogs.