Thursday, February 28, 2013

Hey, guess how many Pythagorean Triplets there are?

You guessed it! But how many do you think you can actually find? I bet you 13228 moneyz in geometric currency that you can't beat my supercomputer. I dare you to check all of them:

Click Here For a Lot of Numbers

At the start, Wolfram Mathematica was being a little obtuse with me, but then I switched to Python, and it turned out just fine. Here is the Python file for those of you who are interested.

Thursday, February 21, 2013

A Cute Triangle Walks into a Bar...

Just kidding, I don't have a knock knock joke. But I do have a fascinating mathematical exploration to tell you about! After figuring out how to identify the acuteness of a triangle with only knowing side lengths in class (shoutout to Vikram for helping me/telling me what the answer was), I decided to write a little program to do these calculations.

Its nice. It does nice things. But I'm starting to worry about its accuracy. Here is the algorithm I am using:

Right triangle (never happens because I use random coordinate inputs that are decimals):
     A^2 + B^2 = C^2
     A^2 + B^2 < C^2
     A^2 + B^2 > C^2

Also note that these are all real triangles, no floppy arm business like this:

The thing that perplexed me was that there seemed to be A LOT more acute triangles than obtuse. I've been running this program with random triangles (in a finite 500 by 500 space) 200 times a second for over 10 minutes and the obtuse to acute ratio seems to be wavering around 1:2.645. Why? Is it a problem with my program, or a problem with...MATH?

Update: Whoops, I think I got my alligator teeth mixed up again! Its 2.645:1 which makes a bit more sense.

Another update: As you change the dimensions of the rectangle you are generating the triangles in the ratio changes. What is the correlation between the dimensions of the rectangle and the acute/obtuse ratio?