Friday, January 30, 2009

Interesting occurrence with 7th root of unity

PDF of this post
I've come across a property of that is rather interesting. Letting , we let , we will see that .

Instead of working directly with this difference, we square the expression for something more easily manipulated. . Using the equalities , etc., we can simplify this down to . Since the sum of the 7th roots of unity equals 0 and the sum only neglects the root , we see that . Thus . Amazing stuff, right?

Thursday, January 8, 2009

A bash script I wrote and love

I, like many Linux geeks before me, love to use the terminal for just about everything. However when I need to use programs with GUIs (Firefox, amarok, okular, etc), I wanted to execute them silently and to get them to return focus to the terminal. Normally if you type
$ firefox

You get a bunch of X and Gtk warnings during execution of Firefox, and you can't use that shell anymore. You have to open another tab in konsole. So, this script I wrote is called "sex" for "silent execute." Mainly for the brevity and the humor of having
$ sex dolphin

be a valid command. This script also allows parameters to be sent correctly to an executable, so
$ sex okular A\ document\ with\ spaces.pdf

opens "A document with spaces.pdf" in okular correctly.
#!/bin/sh
CONCAT="${1}"; shift
for ARG in "$@"; do
CONCAT="${CONCAT} \"${ARG}\""
done
eval "$CONCAT >> /dev/null 2>&1 &"

Simply put this in /usr/bin/sex (need root) and do a chmod +x /usr/bin/sex. I recommend adding
alias ff='sex firefox'

to your ~/.bashrc or your /etc/bash.bashrc too. It's a nice shortcut.

Friday, December 5, 2008

Divide by 0 != universe explode

Post inspired by: The Last Denominator

I just want to let people know that there is no way that any (true) theorem about the field of real numbers (or any field) has a division by zero. In order to get to the concluding statement would require an element that is 1/0 (which I will call the inverse of zero) to be summoned. Since this element does not exist in a field other than the zero ring (in which case 0 = 1), it cannot be used. The step taken is invalid.

Now that I have shown that the usage of zero's inverse is invalid, I will show that no true statement can imply a theorem that involves zero's inverse. By the axioms of inference that logicians, philosophers and mathematicians have developed, A implies B is equivalent to (NOT A) OR B. Therefore since B = conclusion with zero's inverse, if A is true, then the implication is false. And so we conclude that only false statements can imply the existence of zero's inverse (with the exception of the extremely uninteresting case of the zero ring).

To those of you who do not know to what I refer to as a ring and field, here is the break down (first we need the concept of a group):
A group G is a set of elements with a very limited amount of structure imposed on them under one operation (call it *):
1) There exists an identity element, 1, such that 1*x = x for each element x in G.
2) There exists an inverse element 1/x such that 1/x * x = 1 for each x in G.
3) For two elements in G, x and y, x*y is also in G.
4) For three elements in G, x,y and z, (x*y)*z = x*(y*z). In other words, * is an associative operation.

A ring R is simply a set of elements that have a certain structure under two operations defined among the elements (call them + and *):
1) R is an abelian group under + (abelian just means that for x,y in R, x + y = y + x. In other words, + is commutative).
2) For two elements x, y in R, x*y is in R.
3) The distributive laws hold: x,y,z in R imply x(y + z) = xy + xz, and (x + y)z = xz + yz.

A field F is a special kind of ring that really has a lot of great qualities that allow us to prove a lot of cool things:
1) F is a ring.
2) All elements of F except the identity of + form an abelian group under *.

The "except the identity of +" is the key term. Since we commonly call the identity of +, 0, this means that 0 is not required to have an inverse (with regards to *) in F. We know that the real numbers form a field because every element other than 0 has a multiplicative inverse (namely 1/x), and every element has an additive inverse (-x), and you can't add or multiply two numbers and get an answer that isn't a real number. Since 0*x = 0 for any x in the reals, 0 does not have an inverse z such that 0*z = 1. Thus 0 does not have an inverse in the real numbers.

Okay? Now you can be sure that if you get a division by 0 that either the number is too small for your calculator to keep the correct precision and it just rounded to 0, you started off with a false statement, or you had an incorrect deductive step.

Tuesday, November 25, 2008

The intersection inference problem is NP-complete

PDF for this post
First let me start off by defining the intersection inference problem.

Given a set , some finite number () subsets , and constants , is there a subset such that for ranging all values?

First we prove that intersection inference is in NP. Suppose we have a solution . In order to verify that is indeed a solution, we perform the intersections of with and confirm that . Set intersection can be performed (naively) in time, so this process is indeed polynomial and clearly yields the correct answer. Thus intersection inference is in NP.

To prove intersection inference is NP-complete, we will show a reduction from 3-dimensional mapping to the intersection inference problem. With an arbitrary instance of the 3-dimensional mapping problem defined as sets such that , and . To reduce this to the intersection inference problem, let , and define to be the subsets of triples that contain respectively. Define in a similar manner from to for and from to for . Finally define . The constraints are and for . We can see that to create these subsets takes time in the rather straightforward manner of iterating over 's elements to divvy up the elements into arrays representing .

Through this construction we can see that exactly triples must match, and only one triple can contain each specific element in . Thus if there exists a solution to this intersection inference problem, the solution is exactly the triples that satisfy the 3-dimensional matching problem. If there does not exist a solution, then at least one constraint was not satisfied, meaning at least one element in was not covered, or all elements were covered with some redundancies. Thus the reduction is correct and intersection inference is NP-complete because a known NP-complete problem was poly-time reducible to the intersection inference problem which is in NP.