Friday, December 18, 2009

Facebook app update

I've had ideas for other apps for a while now, so I thought I was done with Are you prime?, but I ended up updating it. I (re)learned some SQL to do some rudimentary logging. I'm not 100% sure that it's impervious to injection attacks, but we'll see. More visibly, I also used AJAX so that it can now check all of a user's friends.

The bug I pointed out on phpseclib was acknowledged and fixed. More importantly, though, now that I had the time to look at the code more carefully, I realized that their primality test algorithm is Miller-Rabin's, i.e. it's probabilistic. That defeats the purpose of the app as a silly little quiz based on absolute mathematical truth, but on the bright side, I learned a lot from the experience.
I just sent in a request for a Wolfram Alpha API key. I'm determined to do some more ambitious things with this idea.

I think it's a good idea for them to give me a free API key so I can help promote Wolfram Alpha within Facebook through my app. Of course, it's probably a better idea for them to write their own official Facebook app to do the same thing.


  1. The probability that Miller-Rabin is wrong is about 2**-80. In fact, I tried it on the RSA numbers and correctly determined that they were indeed composite even though the factorization of most of those numbers is (still) not known:

  2. Are you aware of any instance(s) where a published probable prime was later infamously proven to be a composite? I thought this would be an interesting piece of mathematical history, and I didn't look too hard but I couldn't find any compilation of such records.