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:
  t = XOR(A,B)
  u = L(AND(A,B))
  if u not equal to 0:
    add(t, u)
    return t

For example adding these:
A=111 B=101 
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:
then since u is still not 0 add is called again:
t = 1100 
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. 

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.