analytics

Wednesday, December 28, 2011

From boolean algebra to regular algebra

Consider the following two tables, the first shows the bitwise XOR function for the first few binary numbers and the second shows the same table converted to decimal:
Bitwise Xor is defined as you look at the two numbers say (0010 and 1011) and a new number is formed that has a 1 in position i if the ith digit of either of the two starting numbers is 1 but not both. So for 0010 and 1011 XOR would give 1001.
There are 16 of these basic bitwise logical functions, another one is AND which gives a 1 in each position if both of the starting numbers have a 1 in that position. 
I'll also define one more the bitshift which takes say L(111) and produces 1110 which is just the original number with a 0 added onto the end. 
From these 3 basic operations we can define addition as the program:
add(A,B):
  t = XOR(A,B)
  u = L(AND(A,B))
  if u not equal to 0:
    add(t, u)
  else:
    return t

For example adding these:
A=111 B=101 
t=010 
u=1010 
where t is XOR(A,B) and u is AND(A,B) but shifted 1 position to the left. Then add is called on this t and u, to get:
t=1000 
u=0100 
then since u is still not 0 add is called again:
t = 1100 
u=0000
now u is 0 so the program is done and returns t which is 1100. Note that 111+101 = 1100 is 7+5=12.



Friday, December 16, 2011

Social Messaging

I thought of this idea for a social service that works like a collaborative email that's authenticated on a server and allows you to manage different groups to share different content with.
First of all you compose a message with any kind of webpage content you would like, pictures, links, attached files, whatever. And you choose what groups to send the message to.  Example:
Then a message is sent to the server to make sure whoever you are sending it to has put you in a list of people they want to receive messages from (you can only get spam from people you've authorized!):
If it is verified, the message goes to the person you're sending it to's inbox where they can see new messages:
The neat thing is on each message it gives everyone the message was sent to a place to edit the message, the server will send the update to everyone the message was originally sent to:

The app provides an interface to quickly add and remove different contacts from different groups:

There's also an interface for seeing who has sent you a contact invite or for you to send contact invites, also to remove someone from your contact list. Then they will no longer be able to send you a message. To make a connection between two people both people have to confirm by entering their password which the server verifies. 

So it's pretty simple the server I make doesn't even have to store anyone's files except temporarily it merely keeps a database of who is authorized to send messages to whom and sends the message along. I feel like it combines the best aspects of email, google+, facebook, and google wave. 

UPDATE 1:
I finished the message editing part of the program here are a couple screenshots:
Here I'm viewing a message about fire and I've filled out a comment including a picture of a bucket of water.

When I click submit it adds my comment to the main message: 
So so far so good, next is the part of the program for selecting different messages. 

Update 2:
Now I've got the main message selection window done. When you click on one of your groups/person on the left it will only show you messages from anyone in that group or from that person. 



Tuesday, December 13, 2011

Mixture of Lebesque and Riemann integral

Here are 3 types of integration, the first is the usual Riemann integration where the domain is split evenly into rectangles and the second is Lebesque where the range is split into even intervals. The bottom one in this picture is the one I thought of where you use whichever results in fewer rectangles for a given delta size over an interval. I was thinking for functions that are very expensive on a computer to evaluate it would speed up the evaluation of the integral.

Monday, December 12, 2011

possible simplification of 2d heat equation

I've been looking around at numerical solutions to the 2 dimensional heat equation, and I thought I'd make an effort at an explicit solution.
I start here with an isolated plane and a radially symmetric heat map f. The height indicates higher temperature. I then calculate a final state function g that is the integral of f over the plane divided by the total area which is 4 in my plot.

Because the plane is isolated I figure the total thermal energy is invariant. Then I consider the homeomorphism of the heat map f transitioning to the final state map g. To simulate the fact that the closer a heat map f(t) gets to g the slower it transitions, I use a logarithmic proportionality factor A.
The final command for my simulation:

Here is the animation:
It at least looks similar to simulations of the numerical heat equation, it seems to go along with the fact that the heat flow is in the opposite direction of the temperature gradient. And it goes along well with Newton's law of cooling that each small area cools slower the closer its temperature is to it's surroundings. 

Sunday, December 11, 2011

Thurston Labs

I've been running several experiments in my laboratory. Here's a picture of the gently restrained chaos.
 My first experiment was using the plastic from yogurt containers and melting it down in acetone. This makes a gooey substance that can be formed into shapes and then allowed to dry and it goes back to a flimsy plastic like you started off with. But more interesting is I found that if you grind graphite from pencil leads down very fine and knead it into the goo when it dries it hardens to much harder than the plastic started off. Here's a picture of unadulterated and the graphite hardened plastics.

The one on the left is so hard and strong that I haven't been able to bend or break it using all my force. The plain on the right bends easily.
    The next experiment was using the same kind of plastic as above but I mixed in aluminum hydroxide. I made the aluminum hydroxide by disolving aluminum foil in sodium hydroxide that I bought online. The interesting result of this experiment was that the resulting plastic conducts electricity! But on the downside it made the plastic weak and brittle. So I'm going to try and combine these two experiments and see if I can make a strong plastic that conducts.
I thought of a lot of uses for conductive plastic. One is considering that usually a flashlight has wires and metal tabs inside it touching the battery, with a conductive plastic it could be built so the "wire" is a stripe in the all-plastic body. Or a circuit board could be made with a plastic foundation and something like a hot glue gun to put down a layer of plastic instead of solder. Searching online I did find there are some examples of conductive plastic already being produced but they are I think being produced with different base materials and methods. The graphite hardening step is something similar to how they currently make carbon reinforced products but I'm using plastics instead of epoxies and ground graphite instead of fiber woven into mats.

Tuesday, November 29, 2011

Flag Generator

I had this idea as a way to generate some AC electricity. Basically as a flag ripples in the wind it is connected to a framework of springs that will tend to oscillate at their resonant frequency. This oscillation is converted to electricity by moving a magnet through a coil. The picture might help:
If you've ever held a flag in the wind you'll know that even a moderate breeze can get it jerking your arms pretty hard. Ideally you'd want to construct the flag so it ripples at the same frequency to a given wind speed that the spring's vibrate when you press and release one. In the picture above the magnet is connected to the bar that the flag is on I wasn't sure how to make that clearer. 

Update:
This is the first prototype. I'm ordering the wire for the electrical part and it's a little tough to see in the video because it was nighttime, but basically I've got a plastic streamer inducing a vibration in the springs that I'll try and capture the electricity from. The second part of the video I'm just showing how the springs thread onto the screws. 

Monday, November 21, 2011

Prime number wave

I never knew if this was possible or not but apparently so. I started with considering an infinite square wave only 0 every say, 3rd number and then multiplying all the waves of that type gives this nice wave that is only 1 where t doesn't divide any number but 1 and itself. In other words it is prime. In practice there are easier ways to find the prime numbers but I still think this function is interesting. 

Friday, November 4, 2011

Tell if a series is generated by a Polynomial with integer coefficents

Theorem: A series of integers is generated by a polynomial P(x) with integer coefficients if for every choice of x:
m mod P(x) = m mod P(x+m)
Proof: Consider the polynomials:
P(x) = a*x^n + b*x^(n-1) + ... + k
P(x+m) = a*(x+m)^n + b*(x+m)^(n-1)+...+k
When P(x+m) is expanded, there are two types of terms, those that do not contain m and those that do. The collection of terms that do not contain m are exactly those terms found in P(x). The rest we said all divide m. Therefore:
P(x+m) = P(x) + m*(B(x)) for some polynomial B(x) with integer coefficients.
So whatever the remainder of P(x) when divided by m is, because m*(B(x)) divides m evenly and B(x) is an integer at any x,  P(x+m) will have the same remainder when divided by m.

In practice what that means is if you look at a series of integers, and then the remainders when divided by for example 3, if it produces a pattern that repeats over and over again every 3 remainders it is produced by a polynomial with integer coefficients.
  For example:
 3*x^3 + 2*x^2 + x + 4 for x from 1 to 10 has remainders when divided by 3 of:


1,2,1,1,2,1,1,2,1

This pattern repeats every 3 as it should.

Try a random series:
5,12,21,27,35,45
The remainders when divided by 3:
2,0,0,0,2,0
Since this pattern does not repeat every 3 it can't be formed by any polynomial with integer coefficents. Of course there is a polynomial going through these 6 points for x from 0 to 6 but it is:
 5-(7/6)*x+(5/3)*x^4+(43/3)*x^2-(185/24)*x^3-(1/8)*x^5
It doesn't have all integer coefficients.

Now I'm not sure if this result has ever been discovered before, thanks to Dr. Rose for the idea for the proof that I've tried to generalize here.

Monday, October 24, 2011

Looks repetitive but isn't

Suppose you start with 13. Then if the number you have is smaller than 16 double it, if it is larger than 16 divide it by 3. If it gets to exactly 16 stop. Otherwise repeat with this new number you reach. Here are the first few:

13
26.0
8.66666666667
17.3333333333
5.77777777778
11.5555555556
23.1111111111
7.7037037037
15.4074074074
30.8148148148
10.2716049383
20.5432098765
6.84773662551
13.695473251
27.3909465021
9.13031550069
18.2606310014
6.08687700046
12.1737540009


Here are the first 800 numbers of the series plotted in this 800 pixel wide image. The height of each is rounded to the nearest pixel.
(You really have to click and zoom in to be able to see the pattern)

Isn't that interesting there is a clear regularity to the pattern but I have verified that the heights of any two of these pixels are no closer than .005 apart. That means in the first 800 of the series you never repeat exactly a value. So it can't be a simple repetitive pattern.

Tuesday, October 18, 2011

A Monte Carlo for approximating e

I noticed experimentally that if you pick a random series of consecutive floating point numbers between 0 and 1 and stop when you've exceeded a sum of 1.0, you've picked on average e numbers. It always takes at least 2 numbers to add to more than 1 because each less than 1, but it could take an infinitely long time to exceed a sum of 1.0 because a floating point number can be infinitely close to 0. But in practice on average it takes a little less than three numbers, so close to e that I'm kind of assuming that it is e though I'd like to prove it.
For instance, say I picked randomly:
.248727...
.671823...
These add to only .92...
so I pick another:
.31333
Ok that exceeded 1.0 when you add all 3 so 3 goes on a list. Then I do this, say 100,000 times and average the number of tries and it came out to in one case:
2.71859
which is very close to the correct value of e:
2.71828...

I've heard many facts about e but I've never heard this particular simple one so I thought I'd post it. Here is some python source code:

import random
def trial():
    sum = 0
    counter = 0
    while sum < 1:
        sum+=random.random()
        counter+=1
    return counter
def main():
    t = 0.0
    for i in range(0, 100000):
        t+=trial()
    print t/100000
main()

Wednesday, October 5, 2011

Prime island

I made this graphic by looking at the primes smaller than 550,000. What I did was start at the center and with the number 7; I went left, up, right or down if the next prime ended with 7,1,3, or 9 respectively. Every 2200 numbers I would randomly change the color. It stayed closer to the center than I thought it would. To me I'm struck by how much it looks like geography.

Monday, September 26, 2011

Finding primes with binary search

Here's an algorithm for testing the primality of a number that should be fast on a computer because it uses all operations that are easy in binary.
  So say you have a number like: 71
Find the perfect powers of 2 less and more than 71.
2*2*2*2*2*2=64
2*2*2*2*2*2*2=128
What I'm going to do is a binary search between these two numbers looking for 71 which means I look at the number that is halfway between 64 and 128 and see if that is bigger or smaller than the number I'm looking for, if the number I'm looking for is less than that I look at the number halfway between 64 and halfway between 64 and 128 which is 96 and keep proceeding like that until I end up with 71.
  2*2*2*2*2*2=64
  2*2*2*2*2*2*2=128
  Now to find the number halfway between 64 and 128 you look at the largest part they share in common without being the whole of either number such that the remaining two parts have a number halfway between them, like above they both have 5 2's and one is 2*2^5 and the other 4*2^5 so since halfway between 2 and 4 is 3, 3*2^5 is halfway between 2*2^5 and 4*2^5.
3*2*2*2*2*2=96 you can either think of it as replacing 2 from 64 with 3 or 2*2 from 128 with 3.
96 is still bigger than 71 so we want halfway between 64 and 96
If we think of it as 2*2^5 and 3*2^5 there is no number halfway between 2 and 3 so we have to go to halfway between 4*2^4 and 6*2^4 and halfway between 4 and 6 is 5.
5*2*2*2*2 = 80
which is still bigger than 71 so look at halfway between 80 and 64. The largest part they share in common where there is still a number halfway between the part they don't have in common is 2^3 which makes them 2^3*10 and 2^3*8 so halfway between 8 and 10 is 9.
9*2*2*2=72
still bigger than 71so do the same process process but this time the biggest part they have in common that leaves 2 numbers with a number between them is 2^2 which leaves 16*2^2 and 18*2^2 Halfway between 16 and 18 is 17.
17*2*2 = 68 same process again but since 68 is less than 71 do between 68 and the last number we had that was bigger than 71 which was 72
35*2 = 70 35 is halfway between 34 and 36
Then between 70 and 72:
That part of the process can't continue because there is no number between 36 and 35 so you can't take what's common to them which is 2 and halfway between.
The next part is to check the last two numbers 35*2 and 36*2 to see that the 35 and 36 aren't being multiplied by two numbers that there is something halfway in between. In this case there are both multiplied by 2 so that's not a problem. 71 must be prime.
 
Let's try an odd that's not prime like 93:
2*2*2*2*2*2 = 64
2*2*2*2*2*2*2 = 128
3*2*2*2*2*2 = 96
5*2*2*2*2 = 80
11*2*2*2 = 88
23*2*2 = 92
47*2 = 94
In this case with 23*2*2 and 47*2, 23 and 47 are being multiplied by 2 and 2*2, and there is a number between 2 and 2*2 which is 3 so 93 either divides 3 or is prime.

Genetic matching of a function

This post is about using an algorithm designed to mimic natural selection to find the formula for an unknown polynomial.
I started with a random polynomial of degree 5 with integer coefficients between -10 and 10.

I picked the formula to test the program with as:

All my program ever knew about the above equation, called the Target Equation,  is what its value was at 20 test points between -5 and 5.
So the algorithm starts with picking 100 completely random equations with integer coefficients between      ( -10 and 10).
For example one my program picks might be:
Now to compare this random equation with the Target equation, I take what this one above evaluates to at a point and subtract what the Target evaluates to and then square that difference. Like say the target was                      yt at x=-3.5 and this random one is yr at x=-3.5 so the difference is (yt-yr) and then square that.  Then add all those differences squared up for every point in the 20 evenly spaced points between -5 and 5 to get the total "fitness".
So then out of those 100, it picks the 10 with the best fitness. By best I mean those with the fitness closest to 0 or the best matches to the Target equation.
Then it takes those 10 equations and produces offspring equations by averaging every possible pair together. That's just adding the two equations together and then dividing by 2. But I only want equations with integer coefficients so round the coefficients to an integer. Like the offspring of x^2 + 2 and 3*x^2 + 3 would be (x^2 + 2 + 3*x^2+3)/2 which rounds to 2*x^2+2.  So for the 10 equations I had I now have those 10 and 45 more that come from every possible pair out of those 10. To this I had 55 random "new blood" equations to keep the population at 100.
  Now there is a mutation rate, which I set to be once a generation it makes a "mistake" and one of the coefficients just gets a random number instead of what it would be by averaging the formulas. More on this below.
  So now I have 100 equations, and I take the best 10 of those the way I did before, and then breed 45 new ones and add 55 random ones that I take the best 10 of those and on and on...
  So the Target equation was:

100 generations later member of the population with the best fitness was:

It had already arrived at the biggest 2 terms correctly. After 1000 generations one of the population matched the Target exactly. 
   But, this is on a modern computer, doing those 1,000 generations only took about 15 seconds. I compared it with simply generating random equations until one happened to match and it took 500 seconds and hadn't reached the correct answer yet. That's a pretty good speed up, if my solution space were a lot bigger that could mean the difference between 15 hours and 500 hours or 20 days. 
   Anyway it was interesting designing the algorithm because I had to add in the mutation rate and the "new blood" step to keep from getting stuck at a certain best fitness and never getting to the right answer. I imagine that probably has an analogy in actual genetic selection.  

Friday, September 23, 2011

The Sixteenths Temperament for a musical scale

I made this new scale that I feel combines the best of the two dominant scales that exist today. On the one hand I made every note the same interval apart except the pairs F#,G and G#,A and B,C are twice that interval apart. So in that way it is very close to having the nice properties that the equal tempered scale does. But on the other hand every note is a simple fraction so the ratio between two notes works out to a simple fraction exactly as in the just scale.
  Here is a comparison of the new scale put between the other two popular scales I've mentioned:

    In this new scale every note is a multiple of 1/16th of the distance between 1 and 2. That would be 16 multiples though, and the scale only has 12 notes. The ones that are skipped are 7,12, and 15 parts of 16.
                   The light grey boxes in the diagram are where this new scale exactly matches the just temperament scale, and the dark grey are where the new scale matches the equal tempered scale more closely than the just scale does.
   So the nice thing is evident when you look at how the notes are arranged when you think of them going around a circle; after all once you pass B you are back to C so a circle makes sense. A helix would make even more sense but that's too hard to draw :)
So you can see most of the notes are the same space apart like equal temperament with the exception of a few that are double that same amount. But I've marked off perfect just fifths in the diagram that are exactly a 3/2 ratio apart and will sound really good. 
  I guess there could be a 16 note scale that doesn't skip spaces like this one does. Maybe I'll try to find a program that you can play exact frequencies in and post a continuation of this showing what that would sound like. 

Sunday, September 18, 2011

Approximation of Heron's formula

Heron's formula is a formula from antiquity relating the area of a triangle to the lengths of it's 3 sides. It's a nice formula because it works for any 3 sided figure not just right triangles. I was messing around with Heron's formula and I noticed something, if you solve it for one of the sides of the triangle for a particular Area and graph it, it looks like this (I'm only showing where you choose Y to be the second largest number bigger or equal to X)




  This is the graph of the formula for an area of 25 solved for one of the variables. I noticed for most of the solution area the graph is pretty flat. So I approximated it with this:


I did that by putting a plane through the points:
                    


These are valid points on the plane I'm looking for no matter the area A. That took a while to figure out. 

  Finding the plane that goes through those 3 points and simplifying yields:



It is linear in x,y,z for a constant A. That should make a few things more easily possible than with the original Heron's formula without losing much accuracy in the domain of possible triangles. 

  







Friday, September 16, 2011

Generalization of Heron's Formula

I thought if you start off with some kind of general convex region and all you know is the lengths of the segments around the outside and the order they go in, you could the following:
Connect every other vertex going around back to the beginning unless you're on the last vertex, in that case just connect around to the beginning.
Then iterate that process over the last vertices that were connected:
So until you get to just the last 3 vertices every step eliminated at least 2 vertices, so if there started off with N vertices it would take at most (N-3)/2 steps. Anyway if you know the N sides around, this process creates less than or equal to 2/3 but more than 1/2 new lines. And every knew line creates an additional triangle.
  Anyway that point of analyzing that is that there are more knowns necessarily than unknowns in the system as a whole and enough equations from Heron's formula for each triangle that the length of every line can be solved for algebraically, so therefore the total area  can be known from adding them all together. Which is pretty surprising considering that at first thought it seems that possibly all the outside could be adjusted somehow to make a shape with the same perimeter and side lengths but different area, but apparently not.

Sunday, September 11, 2011

Fermat's Little Theorem

Ok, Fermat's Little Theorem states that the formula A^n=B^n+C^n can only be true with whole numbers for n less than or equal to 2. It was proven about a decade ago, but the proof is like a hundred pages long and involves some really complex math and is hard to verify. So I felt motivated to try for a simpler one.
 


In the picture above, I took A^n=B^n + C^n, solved for A, then took two derivatives with respect to B, then I called what that right side equals k. Then I divided the right side by k so I had 1 on the left side. Then I substituted into that formula everywhere I saw a nth root of (B^n + C^n)  an A. Then I solved that formula for A.  That gave me the last line in the above picture. But I like the way it looks better if I pull a b^2 out of what's in the parenthesis. So here is the final formula I'll be using:

Ok, so look at the above solved for k:

Let's start by writing the A^(2n-1) as A/A^(2n) . Also multiply the b^(n-2) by b^2/2 to get (b^n)/2 for reasons that will be explained later. 
  Let's by convention say c is larger than b. 
  Now for k*(b^2)/2  to be a whole number every factor in 2*A^(2n) would have to cancel, so assume to factor the most out we replace c^n*b^(n) with 2*c^n*c^(n)=2*c^2n and all of the factors in that go towards canceling out factors in 2*A^(2n). The 2 multiple in each cancel.  Ok, now on the bottom of the fraction we will when all those factors cancel have p^(2n) left on the bottom where p was the one factor not in c that was in A. We know there must have been at least one because A divides c completely cancels the most terms from A but something is left over because A is larger than c. Then raise that one factor p to the 2n power because there was one left over for each A in A^(2n).  
  So we have now k*b^2/2 = A*(1-n)/p^2n if the denominator is as small as possible, remember that A and p^2n have only one factor in common because dividing A^2n by c^2n left only one factor for each A term p. So we have w*(1-n)/p^(2n-1) where w is A/p. 
So can (-1+n) cancel p^(2n-1)? No because for n> 2 even 2^(2n-1) is larger than (-1+n), and certainly for any larger p even more so. 
  So k*b^2/2 is a fraction with a different numerator from denominator in reduced form because the denominator can never completely cancel.   Now let's substitute and call k by itself x/y. 
Remember k is actually shorthand for the second derivative of A=(b^n + c^n)^(1/n) with respect to b. So we can integrate x/y twice with respect to b and get back to A. 

x/y twice integrated with respect to b is x*b^2 / 2*y. But, x/y=k when multiplied by b^2/2 can't be a whole number as we've proven.  So since x*b^2/2*y = A is not a whole number, A^n must not be a whole number. 
  Notice that this proof only works because the second derivative is non-zero and non constant, so it would not work on A=B+C or A^2 = B^2 + C^2,as required. 


Thursday, August 18, 2011

Evolution through disability and religious thought

  I was thinking maybe millions of years ago there was a monkey-like creature born to a species of tree dwelling monkey-like creatures that through a genetic defect somewhere in his upper body didn't have the strength to grasp the limbs and swing around in the trees and pick his own food to eat so he was forced to live on the ground around the tree, eating whatever discarded remains of food he could find amongst all the feces. If his fellow creatures had had intelligence enough they probably would have either pitied or loathed the disabled one never realizing that the whole future of the species would come to revolve around walking around on the ground, and not living in the trees.
  It seems that there have been at least a couple modern humans born with not a physical defect but a mental one where they are born without the usual survival instincts like wanting to dominate over others or even the desire to reproduce sexually. The two that come to mind are Jesus and Buddha. So they live at the base of the tree as it were by their lack of the usual instincts that all the other humans have in common living only off what's given to them by the other humans. But anyway maybe like with the monkey-like creature the lack of the ability to thrive as the others of their species do has a beneficial side-effect to the future of the evolution of the species just as not being able to swing from the trees did a long time ago.

Sunday, August 7, 2011

Digital and Film

So if you've seen any of the Blu-Ray movies on a 1920x1080 HD display most of them look like this:
So you've got this nice 1920x1080 display but only 75 percent of it is actually showing movie, the rest is the black bars at the top and bottom. The reason for that is HD TV's are 1.77 times as wide as they are tall, and all these movies are filmed at 2.4 times as wide as they are tall, so they don't match and they have to either put the black bars around a smaller movie or stretch up and down which is even worse.
  Some movies were filmed at something close to 1.77 times as wide as they are tall, but it seems to me that almost all of the movies I looked at do the black bar thing as above.
  So it would be nice to have a screen that has 2.4 times as many pixels horizontally as vertically to watch all of these movies. But then I got wondering what the ideal resolution would be to capture all the detail present on the film that they recorded the movie on.
  I came up with 6570x2740! This is because it turns out that 35 mm film has just about 5000 dots per square inch making up the picture...  and they use about 72% of an inch  to make most 2.4 aspect ratio movies (Super 32 filmstock), which comes out to 18 megapixel, which in the correct aspect ratio gives 6570x2740.
  So yeah digital technology has a way to go before it can reproduce accurately what you see in the theater.

Saturday, July 30, 2011

Continuation of Competitive Rankings

I wrote a program that implements the algorithm in the last blog entry... It took about four hours but I put all the info for the 2010 Division I football season (All but the final bowls) into the program and then it took about a second for the computer to process into this ranking of the top 25 (I did all the teams but I'm only displaying the top 25), I've put it next to three other rankings to compare...

So these three on the right were how the rankings looked before all the bowls at the end of the season were played and mine on the left is using information only from before the bowls as well.
So here is how the bowls played out:
]
My ranking system predicted the winner by the pre-bowl ranking:
12/25
AP Poll:
14/25


Tuesday, July 26, 2011

Competition Rankings

I developed a way to do what I feel is a very fair way to rank the teams in a competition after they've completed their schedule. The data below is taken from the 2010 college football schedule for the Big East.

I've put a 1 in a column/row cell if the team in the column beat the team in the row. Then at the bottom I have 7 rows labeled A,b,C...
Row A puts a number in a teams column that counts how many wins each team they beat had. For instance Louisville beat Connecticut, Syracuse, and Rutgers. Those teams had   5, 4, and 1 wins respectively so the Louisville column gets a 5+4+1=10 in row A.
Then Row B in a teams column adds every team they beat's Row A score. For instance, Louisville beat Connecticut, Syracuse, and Rutgers, who had 19,11, and 5 in their Row A scores. So Louisville gets 19+11+5=35 in its Row B score.
So now you can see for  a team T, in Row B it starts to be important how many wins a team R had that was beaten by a team S that was in turn beaten by T.
Row C does the same thing with Row B that Row B did with Row A and now with Row C the analysis goes 4 teams deep.
So you go to Row G following the same principle, One less generation than there are teams so you've included every possible chain of who beat who.
Then as I have you can organize the teams by their row G score which should give you a very reasonable ranking of how the teams stack up against each other.

Friday, July 15, 2011

A grid paper game

This game can be played on any size grid, below I show a game on an 8x8 grid. Graph paper works good.  There are 2 players, one player plays the odd numbers and goes first the other plays the even numbers. When it's a players turn they have to play the next number to the left, right, above, or below the last number played on an unoccupied square, and when someone can't make a legal play the other person wins.
 Here's an example game:
Player A played the 1, then Player B played the 2, then Player A the 3, and so on...As Player B played 8 Player A knew that he couldn't play to the right with his 9 because then Player B could put the 10 in the top right square and win because there would be no place to put the 11. When Player A played the 17 Player B knew he couldn't play the 18 below the 17 because then Player A could play the 19 in the bottom right square and win after 2 more moves. After player A played the 23 Player B knew he couldn't play the 24 above the 23 because then Player A could play the 25 to the right and win every possible way the play could continue. After Player B played the 32 Player A saw that no matter what he did he would lose so he resigned.
  So you see the rules are so simple but the strategy and planning ahead can get pretty involved.  I haven't named the game yet, I'd like to hear any suggestions.

Tuesday, July 12, 2011

Study on Perspective

I found it surprising that with the same camera and same lens from the same angle, how big the continents are relative to the size of the globe change depending on how far away you are.
I'm trying to figure out if the one on the right is more or less accurate to actual distances between places on the Earth but I'd need a higher megapixel camera to get a detailed enough picture from that distance.

Monday, July 11, 2011

Proving new infinite sums

I found how to prove the sum of an (infinite number) of infinite series that Maple didn't know the answer to!

Sunday, July 10, 2011

Internet Idea

I was thinking, if these wireless routers everyone has set up around town would be configured to listen for messages that had a destination address and a payload (encrypted of course!), then pass it along further to another router along the route towards the destination address... eventually no one would even need to buy their internet from these big telecom companies.
   For instance, suppose my Dad has a server set up at his office with his company website on it across town, the route from my house to there looks like this...

All those little red dots if you zoom in are different people's wifi hotspots that my request for his webpage would go through jumping from one to the next along the physical route to his office and then the data for the webpage would come back through.
 So to send an email to someone you would send it to their street address just like you would regular mail and eventually it would get there jumping from the house down the road from you to the next house and through a bunch more until it gets to theirs.
  Anyway I thought it was kind of fun to think about.

Friday, June 24, 2011

In 3d

Continuing that last thing , I found out that if you have a cube, the total of the distances to the 8 corners squared generates a spherical gradient much like the square made a circular one. So I thought my first attempt at designing a charge concentrator could look like this (sort of):
The cube is flooded with deuterium gas plasma and all the positively charged ions have less potential energy as they move towards the center. Hopefully with a high enough voltage you could get them to fuse. 

 

Tuesday, June 21, 2011

Circle from Square

I got thinking of a thought experiment where you are in a square room and thinking about the four distances to each of the four corners all added together. I wanted to know what that would look like if you graphed it at different points around the room. I was having trouble visualizing it though so I used Maple (a math program) to graph it for me.
The formula up top is adding the four distances to the corners up... I was surprised at the graph, it's like a black hole! Looking at it for a couple seconds starts tricking my eyes like an optical illusion. The darkest part is where the total distance from the four corners is the least,  2*(square root of 2) and it's the most at each corner 2+(square root of 2) . I was suprised at how you can make a circle by saying where this function is equal to say, 3. That's different than the way you usually define a circle as a certain distance from the center.

*EDIT*
  I worked some more on the math behind it but if you just want to hear what I think might be practical applications you can skip to the *APPLICATIONS* below....

 A professor of mine, Dr. Rose, was asking me how I knew that that where the above graph is the same color creates circles, not some other shape that just appears circular at a glance. Well, the way I defined it above where the four distances to the corners are added up ends up being pretty hard for me to prove. But I did prove that adding the square of each distance together results in a circle. It goes like this:
 In polar coordinates, the distances A^2+B^2+C^2+D^2 from a point somewhere within the square to the four corners is:

Which at first doesn't look very simple or nice, but through the magic of my math program Maple an equivalent formula or simplification to that above is:
Now that is much nicer. In polar coordinates the fact that the theta cancels out means the distances squared to the four corners added together only depend on how far you are from the center of the square, not the angle from the center. In other words, you can move around the center of the square in a circle and not change the sum of the squares of the distances to the corners. The graph still looks pretty much the same as the one in the beginning of this post but the dark area is a bit tighter towards the center.

*APPLICATIONS*
 So my formula above says that if you have four equal forces pulling towards something from the corners of a square, the place where it should go to get as close as it can to all four is the very center. And it's like a funnel (circular) that will move anything affected by the forces to the center.
  So, in fusion experiments, what I've seen is they try to use a bunch of magnets around the middle in a circle to "push" what they are trying to concentrate in the middle, but I've shown that you can concentrate it with just four magnets flipped the other way "pulling" in the four opposite directions. It seems kind of counter intuitive at first, but the math shows that it would work. And with a circle of magnets pushing in, there will usually be dead spots in between the magnets that allow the material to escape, but with just these four magnets pulling you get a perfect funnel type field to concentrate the particles.