Showing posts with label Computer Science. Show all posts
Showing posts with label Computer Science. Show all posts

Thursday, June 2, 2011

Are Computers Isomorphic to Humans?

      Let me preface this essay by admitting that artificial intelligence is an old problem, and acknowledging that better minds have attacked the question before me (and certainly better minds will come after). Hence I can in no way expect to resolve the query at hand; only to jot down a few thoughts on the matter, seeking to move myself a bit closer to understanding truths which may ultimately be beyond human reach. Perhaps it is just as well that most “objective truth” is, at the end of the day, of this nature – for it may well be that we find meaning only by searching for it. Since I have probably crushed my own credibility enough on the matter at hand, 'tis high time to move on to actually getting lost in the fog, eh?
      No discussion of artificial intelligence would be complete without mentioning the ill-fated Alan Turing. His test, designed well before the computer era, is nonetheless still one of the most respected processes for determining whether or not a computer has “intelligence.” If you are not familiar with the Turing Test I will try and concisely explain it: Given a judge deciphering typewritten messages from two subjects (one a computer, one a human), have the judge attempt to distinguish which subject is the computer, and which the human. Supposedly, if the judge guesses wrong about half the time or more, we can at that point say that computers have intelligence or are close enough. Now granted, this idea for a test is not particularly novel (when one thinks of proving a thing sentient, what could be more natural than to compare the thing against himself?), but it has served as a good base to build thought experiments from. And, hey, it has become something of a tradition to hold such tests as a sideshow at computer conventions, especially those involving artificial intelligence. Anyway, let us move on to discussing some of the theoretical conclusions arrived at in attempting to build machines that could pass the test, as well as some of the problems inherent to the approach.
      First and foremost, the kind of answers a computer retorts back to user input hypothetically considered by Turing are pretty much as relevant today as they were in Turing's time. Certainly, a subject having the capacity to do arithmetic correctly at lightning speeds would arouse suspicions that said subject was of more metallic origins. Yet, as Turing pointed out, and as anyone who is familiar with programming “easier” settings for video games could tell you: it is quite simple to program a computer to occasionally give wrong answers, and to wait any given amount of time before replying. So clearly, making a computer behave “as poorly” at math as your typical human is not particularly difficult – and in learning this we have largely set such behaviors aside as being irrelevant to determining how intelligent computers really are. Indeed, we were probably barking up the wrong tree from the start by trying to define intelligence as the ability to make mistakes. Or perhaps I should say “appear to make mistakes.” More on that in a bit.
For now, let us consider how a computer might answer a question of aesthetic beauty. Suppose you showed the computer a painting and asked if it were beautiful or not. What kind of answer would give the computer away? To paraphrase the author of the main text we have been reading in this class (Godel, Escher, Bach by Douglas Hofstadter), does the computer have a large enough soul to appreciate Bach? We could simply give the computer a learning algorithm (such as a Support Vector Machine or a Neural Network) and a ton of examples of various types of music and artwork, letting it form itself a rough aesthetic scale. The computer could then turn around and spit out an answer about where on the scale a given piece of art fell, and have it be a rough enough consideration to pass muster with our Turing Test judge. (For a rough estimate is all humans really give about such a nebulous thing as “beauty” anyway). What other foils must a computer surmount to pass a Turing Test?
      How about language and communication? Surely a computer that gave responses which sound repetitive or canned would give itself away. Or, alternatively, a computer that could not piece together the intended meaning of a given phrase could never return to the user some useful commentary on the phrase; nevermind a meaningful response to the message. Yet, assuming our judge has an infinite amount of time to keep asking questions (English providing a framework to form an infinite number of different meaningful sentences), it stands to reason that a computer can only have a finite number of potential responses. And, while a meaningful sentence-forming algorithm seems possible hypothetically, humanity has yet to produce one that actually works well enough to imagine it fooling anyone for very long. Likewise, we have yet to perfect a parsing algorithm that can be guaranteed to parse any and every meaningful sentence, which is best illustrated by the fact that we still code in “Do What I Say” mode instead of “Do What I Mean” mode. Which is to say that programming languages are still not in the same category as natural language is.
      Now, one could write really complex code such as what Mr. Hofstadter demonstrated in his dialogue between the MIT graduate student and his pet AI. But, I submit that even such code as that would have problems dealing with an infinite number of different queries from a judge. For a more in-depth example, consider compilers. Compilers require their input to fit specific syntactic rules, along with a small number of semantic constraints. The only way to guarantee a compiler can interpret and take appropriate action on any given string is if the compiler is allowed to “lookahead” towards the next 'symbol' in the given string, an infinite number of times. But computers cannot do this, because all possible implementations will have limited amounts of lookahead possible. At the very least, I cannot say I have seen an algorithm capable of accomplishing either interpretation or generation of an infinite number of different meaningful phrases. Or more simply, there is no algorithm that can keep it up indefinitely. At some point the computer will come up with an unnatural enough sentence or phrase, or will respond in a completely unexpected way to a misinterpreted sentence, that it will be found out by our judge.
      Of course, all this discussion might be quite moot, because much of what we just asked a computer to do, a human may have just as much trouble doing. Does the idiom “lost in translation” ring a bell? Even when two perfectly healthy humans are speaking the same language, with words both know very well, it is not so uncommon to encounter misunderstandings and barriers to communication of meaning and intent over completely human means of discussion. So, if we are trying to make computers human-like, why even bother with considering linguistic operations past some decently approximate level? Perhaps we have lost sight of our goal: To write an artificial intelligence capable of fooling a human into believing that the artificial intelligence is not artificial after all. Well, sure enough, we can imagine a finite set of human-tailored responses the computer could use to fool a human over a short term, and even something more along the lines of a learning program might be used to good effect if the judge queries only within a particular subset of language. But on the other hand, if we remove the constraints upon the judge's time and number of queries, it is virtually impossible to indefinitely fool the judge into believing the computer responses and requests might have arisen from a human.
     So, perhaps you were wondering when and if I would ever pick back up that thread about the “appearance” of a computer making mistakes. Well, I suppose I have kept you waiting long enough. It is my opinion that, while trying to satisfy the Turing test has steered computer science in the direction of building better and better artificial intelligence in the truest sense of artificial, it is quite a pointless venture to begin a journey towards creating intelligence by trying to “fool” a human into thinking a computer is a human. In fact, if our goal is to produce intelligence equivalent to what we have as humans, we should be far more concerned with the implementation than anything it actually does. Who cares if this electrical brain can play checkers; is it self-conscious? Does it make decisions in a non-deterministic way? Does it have a will?
     But here we have encountered a bit of circular logic. For, here we are asking if computers can perform in a way we are not actually sure humans do. We need to ask if thought really is just a higher level representation of neurons firings, and not something more. Without the notion of free will, all behavior is simply a set of programmed responses to the environment, based upon some unique combination of genes and how our learning algorithms adapted themselves to our environments over time. In such a case the Turing test would actually be quite appropriate, because our own sense of ourselves as free-willed and non-deterministic beings would be utterly delusional. If we accept our own sentience in these terms, we can quite easily answer our original query (whether humans and computers are isomorphic) in the affirmative, but can we reason our way to such a conclusion? Perhaps, in the same way Escher's Dragon cannot actually become three-dimensional, and analogous to the way Godel proved any formal system sufficiently strong enough to reason about itself must always be incomplete (“incomplete” meaning there are well-formed propositions the system can make which cannot be decided within the system), we humans cannot find our way to a decision about whether we are sentient using a system of predicate logic. Granted, we cannot even prove that the aforementioned question is undecidable at this juncture, but I could hardly do justice to you the reader if I left us wandering through the fog without expressing any kind of solid ground to stand upon. So humor me in accepting the question as currently undecidable.
     Now we are allowed to do one of three things. We could leave the question as undecidable, and appreciate the zen of it all from a distance. We could accept that humans have sentience in the frame of context we have been discussing (having free will, among other concepts intentionally left somewhat nebulous). Lastly, we could accept the contrary notion, that humans are not sentient. I am going to ignore the first option because taking that route would leave us adrift in the same murky waters we were in before accepting the question was undecidable. Given that the immediate consequences of accepting the notion that humans are not sentient are quite depressing (essentially it would mean accepting a completely deterministic world, where any notions of individuality, achievement, right and wrong, etc are wholly delusional), I think I will hold off on accepting that conclusion. Where does this leave us? Accepting that humans have a brand of intelligence that includes free will. If we accept that, then we have pretty much answered our fundamental query in the negative, because computers and whatever output we get from them are ultimately limited to how we interpret their electrical signals; by definition this puts computers in an entirely different category from humanity.

Wednesday, May 11, 2011

Dev Diary

     Spent most of this last week switching between work on developing a Check() hierarchy for validating xml importation, and a minesweeper app for my android app programming class.  The former project I can't discuss too much, only to say that I need to learn how to work with registry design patterns, and am not quite clear where the hierarchy is going to go.  The latter I am finding much more difficult than it seemed at first.

     Apparently, most everyone is treating the actual setup of the boxes manually instead of programattically, putting their positioning information into the xml by hand.  The way I envision it is more automated (but in turn, more difficult to figure out how to do), with the number and size of the boxes adapting to user input.

Wednesday, May 4, 2011

Dev Diary May 4th, 2011

      So, I got a job working as an intern working for a company by the name of Data In Motion as of this last Monday.  Not much to say about it as of yet except that there's a ton to the job, and I am currently... whelmed at the tasks ahead.  That is to say, it's certainly daunting, but I think if I take it one piece at a time (like one of my favorite Johnny Cash songs) I'll get to understanding it, and be able to make myself useful to my employers.  For the time being, they are doing a lot more for me than I am for them, and it is currently just a hope to be a good return on that investment.

     All that having been said, I probably won't be sharing my code from work-related projects here on my blog, unless given explicit permission to do so.  I am also starting a class for developing android applications, and may share some of the toy programs from that class (albeit if it looks even marginally profitable I'd be keeping mum).  So that's the situation if you were wondering when my next interesting tidbit of code would appear.

     And now I'm off to spend the rest of the evening getting used to some new equipment.  And to read up on marker, visitor, and singleton design patterns.  On a complete sidenote, I should remind myself to strongly suggest to my professors here at Westminster to implement a class focused on design patterns.

Thursday, April 28, 2011

SVM Tester

function [score iter correct falseNeg falsePos unsures] = TestVectorMachine( weight, kernel, labels, bias )

%Test function for vector machien -- takes in a set of training data and
%its labels and tests a given set of alphas and a bias against it
[xn xm] = size(kernel);
[yn ym] = size(labels);
[an am] = size(weight);

%if(xn ~= am || ym ~= xn)
  %  display('Sorry, this is an idiot proof function.  Try again!');
 %   return;
%end
falseNeg = 0;
falsePos = 0;
unsures = 0;
iter = 0;
for i = 1:xn
    fXi = (weight .* labels) * kernel(i,:) + bias;
    if (fXi * labels(i))  <= 0
        if(fXi > 0)
            falsePos = falsePos + 1;
        end
       
        if(fXi < 0)
            falseNeg = falseNeg + 1;
        end
       
        if(fXi == 0)
            unsures = unsures + 1;
        end
       
        iter = iter + 1;
    end
end

score = (xn - iter) / xn * 100;
correct = xm - iter;

Soft Margin one-norm SVM

function [ weights bias ] = TannSchmidVectorMachineSoftMarginUno( K, H, labels, C)
%Toggle details which kernel we use

[xm xn] = size(K);
[ym yn] = size(labels);

%scale C down
C = C / xm;

%check to make sure training & labels have same dimension and toggle is
%valid

if xm ~= ym
    display('Sorry, this is an idiot proof function. Try feeding in valid parameters next time, doof!');
    return;
end

%allocate space for different parts
f = zeros(xm, 1);
A = zeros(2 * xm + 4, xm);
b = zeros(2 * xm + 4, 1);

%build constraints matrix
A(1,:) = labels';
A(2,:) = -labels';
A(3,:) = ones(1, xm);
A(4,:) = -ones(1, xm);
for i = 1:xm
    A(i+4, i) = 1;
end
for i = 1:xm
    A(i+4+xm, i) = -1;
end

b = [0; 0; 1; -1; (C - 10^(-7)) * ones(xm,1); zeros(xm, 1)];
          
[weights v] = quadprog(H, f, A, b);

%find the bias
bias = GetSoftBiasUno(weights, K, labels, C);
bias = bias / sqrt(weights' * H * weights);

save('recordedResults0', 'weights', 'bias', 'K');

Soft Margin 2-norm SVM

function [ weights bias ] = TannSchmidVectorMachineSoftMarginDos( K, H, labels, C)
%Toggle details which kernel we use

[xm xn] = size(K);
[ym yn] = size(labels);

%scale C down
C = C / xm;
H = (1/2) * (H + (1 / C) * eye(xm, xn));

%check to make sure training & labels have same dimension and toggle is
%valid

if xm ~= ym
    display('Sorry, this is an idiot proof function. Try feeding in valid parameters next time, doof!');
    return;
end

%allocate space for different parts
f = zeros(xm, 1);
A = zeros(xm + 4, xm);
b = zeros(xm + 4, 1);

%build constraints matrix
A(1,:) = labels';
A(2,:) = -labels';
A(3,:) = ones(1, xm);
A(4,:) = -ones(1, xm);
for i = 1:xm
    A(i+4, i) = -1;
end

b = [0; 0; 1; -1; zeros(xm, 1)];
          
[weights v] = quadprog(H, f, A, b);

%find the bias
bias = GetSoftBiasDos(weights, K, labels, C);
bias = bias / sqrt(weights' * H * weights);

save('recordedResults0', 'weights', 'bias', 'K');

Hard Margin one-norm SVM

function [ weights bias ] = TannSchmidVectorMachineHardMarginUno( K, H, labels)
%Toggle details which kernel we use

[xm xn] = size(K);
[ym yn] = size(labels);

%check to make sure training & labels have same dimension and toggle is
%valid

if xm ~= ym
    display('Sorry, this is an idiot proof function. Try feeding in valid parameters next time, doof!');
    return;
end

%allocate space for different parts
f = -ones(xm, 1);
A = zeros(xm +2, xm);
bias = zeros(xm +2, 1);

%build constraints matrix
A(1,:) = labels';
A(2,:) = -labels';
for i = 1:xm
    A(i+2, i) = -1;
end
          
[weights v] = quadprog(H, f, A, bias);

%find the bias
bias = getHardMarginBias(weights, K, labels);

save('recordedResults0', 'weights', 'bias', 'K');

Soft Margin one-norm Bias Calculator

function [ bias ] = GetSoftBiasUno( weights, kernel, labels, C)
[xm xn] = size(kernel);
counter = 0;
bias = 0;

for i = 1:xm
    if weights(i) > (10^-10) && weights(i) < (C - 10^(-10))  %calculate first <w xi>
        sgnLastY = labels(i) > 0;
        partialSum = 0;
        for j = 1:xm
            partialSum = partialSum + labels(j) * kernel(i,j) * weights(j);
        end
       
        %reset partial sum
        wXi = partialSum;
        partialSum = 0;
       
        for j = i:xm
            if weights(i) > (10^-10) && weights(i) < (C - 10^(-10)) && sgnLastY ~= (labels(j) > 0)
              for j = 1:xm
                 partialSum = partialSum + labels(j) * kernel(i,j) * weights(j);
              end
             
              %save second <w xj>
              wXj = partialSum;
              bias = bias + -(wXi + wXj) / 2;
              counter = counter + 1;
            end
        end
    end
end

bias = bias / counter;

Soft-Margin 2-norm Bias Calculator

function [ bias ] = GetSoftBiasDos( weights, kernel, labels, C)
[xm xn] = size(kernel);
counter = 0;
bias = 0;

for i = 1:xm
    if weights(i) > (10^-10)  %calculate first <w xi>
        sgnLastY = labels(i) > 0;
        partialSum = 0;
        for j = 1:xm
            partialSum = partialSum + labels(j) * kernel(i,j) * weights(j);
        end
       
        %reset partial sum
        wXi = partialSum;
        partialSum = 0;
       
        for j = i:xm
            if weights(i) > (10^-10) && sgnLastY ~= (labels(j) > 0)
              for j = 1:xm
                 partialSum = partialSum + labels(j) * kernel(i,j) * weights(j);
              end
             
              %save second <w xj>
              wXj = partialSum;
              bias = bias + -(wXi + wXj) / 2 - (labels(i) * weights(i) - labels(j) * weights(j)) / (2 * C);
              counter = counter + 1;
            end
        end
    end
end

bias = bias / counter;

Hard Margin Bias Calculator

function [ bias ] = getHardMarginBias(weights, kernel, labels)
%returns the bias
[xm xn] = size(kernel);
counter = 0;
bias = 0;
for i = 1:xm
    if weights(i, 1) > 0.000000000001
        partialSum = 0;
        for j = 1:xm
            partialSum = partialSum + label(j) * kernel(i,j) * weights(j);
        end
        bias = bias + labels(i) - partialSum;
        counter = counter + 1;
    end
end

bias = bias / counter;

end

Gaussian Kernel

function [ result ] = GaussKernel( x, y, sigma )
result = norm(x - y)^2;
result = result / sigma;
result = exp(-result);

end

Default Kernel

function [ result ] = defaultKernel(x, y, A)
%One of many kernel functions.  Takes vectors x and y, returns kernel
%function as a dot product using a positive definite matrix A
[xm xn] = size(x);
[ym yn] = size(y);
[R isPosDef] = chol(A);
if isPosDef ~= 0 || xm ~= ym || xn ~= yn || xn == 1
    disp('sorry, this function is idiot proof.  Please enter in a positive definite matrix A');
    result = -1;
    return;
end

result = x * (A * y');

Kernel Creator

function [ K H ] = KernelKreator( training, labels, scale, toggle)

[xm xn] = size(training);
[ym yn] = size(labels);


if xm ~= ym || toggle < 0
    display('Sorry, this is an idiot proof function. Try feeding in valid parameters next time, doof!');
    return;
end

K = zeros(xm, xm);
H = zeros(xm, xm);
iter = 0;
%build kernel based on toggle used
if toggle == 0 %use regular dot product
    for i = 1:xm
        for j = i:xm
            K(i,j) = (defaultKernel(training(i, :), training(j, :), eye(xn))) / scale;
            K(j, i) = K(i,j);
            H(i,j) = (K(i,j) * labels(i) * labels(j));
            H(j,i) = H(i,j);
            iter = iter + 1;
        end
    end
%put other toggles here for other kernels
elseif toggle == 1
    for i = 1:xm
        for j = i:xm
            K(i,j) = (defaultKernel(training(i, :), training(j, :), eye(xn))) / scale;
            K(i,j) = (K(i,j) + 1)^2;
            K(j, i) = K(i,j);
            H(i,j) = (K(i,j) * labels(i) * labels(j));
            H(j,i) = H(i,j);
        end
    end
elseif toggle == 2
    for i = 1:xm
        for j = i:xm
            K(i,j) = (defaultKernel(training(i, :), training(j, :), eye(xn))) / scale;
            K(i,j) = (K(i,j) + 1)^3;
            K(j, i) = K(i,j);
            H(i,j) = (K(i,j) * labels(i) * labels(j));
            H(j,i) = H(i,j);
        end
    end
elseif toggle == 3
    for i = 1:xm
        for j = i:xm
            K(i,j) = GaussKernel(training(i, :), training(j, :), scale);
            K(j,i) = K(i,j);
            H(i,j) = (K(i,j) * labels(i) * labels(j));
            H(j,i) = H(i,j);
        end
    end
end

Support Vector Machines

For our Applied Topics in Mathematics class we had to code up some basic versions of support vector machines.  One of my classmates and I coded the following 3:  A hard margin, one-margin maximal weight SVM and 2 soft-margin maximal margin SVMs (one-norm & two-norm versions).  The next few posts will be the MATLAB code of those machines.  Feel free to comment on them and offer any suggestions where appropriate.

Monday, January 10, 2011

Some MATLAB functions to create matrices representing steps in Gaussian Elimination

function interchangeRows = interchangeRows(i, j, n, m)
A = eye(n,m);
A(i,i) = A(j,j) = 0;
A(i,j) = A(j,i) = 1;
interchangeRows = A;

function multiplyRowbyScalar = multiplyRowbyScalar(j, alpha, n, m)
A = eye(n,m);
A(j, j) = alpha;
multiplyRowbyScalar = A;

function multiplyRowIbyScalarAddRowJ = multiplyRowIbyScalarAddRowJ(i, j, alpha, n, m)
A = eye(n, m);
A(j, i) = alpha;
multiplyRowIbyScalarAddRowJ = A;

Tuesday, November 23, 2010

Net Neutrality Summary

     The following is a summary of a presentation I'm to give on the Tuesday of next week.  Lemme know what you think -- whether or not it hits all the points of interest on the topic, if the organization is well structured, etc.  Do note that this is merely a summary, not a full on paper, so use of abbreviations and conversational inconsistency of person shouldn't be of particular concern.

Daniel Tanner
November 23rd, 2010
CMPT 335
Net Neutrality Presentation

     My security presentation covers the topic of Net Neutrality.  It is relevant to our class in security because it has to do with the availability and integrity of internet services.  Definition of the term "Network Neutrality" itself is as good a place as any to begin.  I should like to follow up with a consideration of various bills that have been introduced or passed in congress relating to the issue, leading into a discussion of the current one on the table.  Naturally this will lead into consideration of the current policies in place at the Federal Communications Commission and some cases which have come up.  Since the presentation up to said point will mostly engender the 'for' or 'pro' side of the issue, it seems only fair to round it out by discussing some of the concerns of parties opposed to the bill.
     "Net Neutrality" is rather difficult to pin down to one specific definition, since the definition used in legislative bills on the subject use one definition, internet service providers and network administrators use another, and the popular media uses still another.  The current policy of the Federal Communication Commission is often described as one of network neutrality, where all content is treated equally and there is no prioritization.  To put that into more specific terminology, it would seem to mean that no packet prioritization is in play (routers act as a 'dumb' network where the actual content of packet doesn't come into consideration).  This is not quite how the network works in reality (for example, compare UDP and TCP/IP protocols and how TCP is built to scale itself back when traffic gets heavy, while UDP does not.  This effectively gives any content using UDP priority over TCP traffic).  This is where another definition of network neutrality comes into play; that it is a policy of equal treatment in regard to users using certain services.  Providers are prohibited from blocking or throttling any 'lawful' services and/or any 'lawful' content (where lawful is generally taken to refer to trafficking of certain content like child pornography being illegalized).
     A number of bills have come and gone through congress in an effort to pass more regulations concerning network traffic control.  The first of these bills comes from around 2005, under the name of the Internet Freedom and Nondiscrimination Act.  When that failed, congress attempted to include most of the basic legislation as a rider on the COPE Act, though this was also shot down.  It was again brought to the floor as the Net Neutrality Bill.   This one also failed to pass, and the modern incarnation which is currently in committee hearings is called the Internet Freedom Preservation Act.  I've included the summary of the bill as part of the presentation and intend to read the main points of the policy, but it essentially prohibits ISPs from:  preventing any particular individual from using internet access services, imposing special charges on particular types of content providers, preventing the usage of any 'lawful' device in conjunction with said services, establishing a scheme for prioritizing any given host's traffic over other hosts, and/or installing any network functionality to enable any of the aforementioned activities.  It also sets the FCC up as the agency in charge of enforcing said regulations.
     The current policy of the FCC isn't actually all that different than the proposed bill, though the regulations tend towards the vague and nebulous.  Basically the policy is that all users should have access to lawful content, be able to run lawful applications/services, use lawful devices, and the FCC is directed to promote competition among iSPs and various content providers.  A few incidents have arisen where these various powers have been tested.  Whether it has proven enough, too much, or too little has been a primary point of contention among the various parties who have thrown their hats into the socio-political arena of ideas concerning this topic.
     Comcast has become perhaps the most (in)famous ISP because of a related incident.  In October 2007, the company, primarily in an effort to cooperate and comply with RIAA, MPAA, and federal rulings on copyright infringement, decided to block and/or interfere with network traffic assumed to contain pirated music and movies transferred over Bittorrent and other peer-to-peer filesharing software.  The method of blocking was rather indirect (a DoS attack using reset packets), but due to the fact that a number of customers had legitimate services hindered or blocked by this incident, Comcast was brought to court by both a class action civil suit and a criminal charge from the FCC.  While the criminal charge was not successful (apparently still active in appeals, though), Comcast was charged $16 per share to settle the civil suit.  I'll go into more detail on the other events in class, since this summary is already getting long (admittedly, this is the best-documented one).
     Let's finish out with the arguments against.  The primary argument is not so much against the idea of Net Neutrality per se, as it is that the system already in place gets the job done.  More specifically, the market as it is prevents ISPs from enacting the kind of priority systems previously mentioned; partly because the changing of the hardware is either technically infeasible (too expensive if even possible) or would end up cutting that particular ISP off from the rest of the internet, which is hardly the kind of service customers would want or pay for.  Another argument against is the consideration of ISPs as the owners of these various communications networks, which they have paid to implement.  Several property, which is, as ever, the central right, would seem to dictate that ISPs ought to have complete control over their own networks and their use (much as wireless communications companies have over their networks); and that any regulations to enforce government control would be unconstitutional.  The next argument of note is the consideration of innovation in the network core -- that different methods of network management would be more difficult to attempt, or ISPs would be less likely to try in a more regulated environment.  More technically inclined individuals provide yet another argument (and this goes back to the original way in which net neutrality is defined) -- that not all services are equal, and for the network to operate efficiently, different services must necessarily be treated differently.  That should cover most, if not all, of the views in both directions.

     Sources used in gathering the information in this summary and for the presentation are as follows (using Chicago Style Citations):

1  Lessig, Lawrence.  “No Tolls on the Internet.”  The Washington Post.  Posted June 8th, 2006.  Accessed November 23rd, 2010.  http://www.washingtonpost.com/wp-dyn/content/article/2006/06/07/AR2006060702108.html .
2  Wu, Tim.  “Network Neutrality FAQ.”  Posted December 26th, 2008.  Accessed November 23rd, 2010. http://timwu.org/network_neutrality.html .
3  Markey, Edward (Sponsor D-MA) et al.  H.R. 3458 – Internet Freedom Preservation Act of 2009. http://www.opencongress.org/bill/111-h3458 .
4  Carter, Nick.  “What is Network Neutrality?”  Accel Networks:  Fixed Wireless Broadband Blog.  Posted August 10, 2010.  Accessed November 23rd, 2010. http://www.accel-networks.com/blog/index.php?q=/2010/08/what-is-net-neutrality.html .
5  Google et al.  Open letter to Congress concerning Net Neutrality policy.  Dated March 1, 2006.  Accessed November 23rd, 2010. http://www.publicknowledge.org/pdf/nn-letter-20060301.pdf .
6  Dortch, Marlene H.  Policy Statement.  Federal Communications Commission.  Dated September 23rd, 2005.  Accessed November 23rd, 2010. http://hraunfoss.fcc.gov/edocs_public/attachmatch/FCC-05-151A1.pdf
7  “Net Neutrality.”  Wikipedia.  Last modified November 10th, 2010.  Accessed November 23rd, 2010. http://en.wikipedia.org/wiki/Net_neutrality
8  Hart, Jonathan D. (2007). Internet Law. BNA Books. p. 750.  (Referenced in 7).
9.  Andrews, Tim.  “Does ‘Net Neutrality’ Violate the First Amendment?”  Americans for Tax Reform.  Posted November 11th, 2009.  Accessed November 23rd, 2010. http://www.atr.org/net-neutrality-violate-first-amendment-a4189
10.  Majoras, Deborah et al.  “Broadband Competition Policy.”  FTC Staff Report June 2007.  Accessed November 23rd, 2010. http://www.ftc.gov/reports/broadband/v070000report.pdf
11.  Solomon, David H. et al.  “In the Matter of Madison River Communications, LLC. And Affiliated Companies.”  Federal Communications Commission.  Accessed November 23rd. http://hraunfoss.fcc.gov/edocs_public/attachmatch/DA-05-543A2.pdf

Monday, November 15, 2010

An n^n algorithm (or a surefire way to freeze up your memory lickety-split)

     So one of my friends and I were talking about algorithm analysis and tried to think up a quick and dirty n^n algorithm (that is, one which grows on a more than factorial order) and this is what we came up with.  Be forewarned:  Calling this function with an argument of more than 30 is likely to eat all your memory (on the school computer we tried it on we got a BSOD.  Wheeeeee!)

void int sum(int n)
{
      //base case
      if(n == 0)
          return 1;

      int sum = 0;
      for(int i = 0; i < n; i++)
           sum += sum(i);
      return sum;
}

This is like the fibonacci series on crack (in terms of the call hierarchy), though it ends up falling into a pattern of simply doubling.  You get a slightly more interesting pattern by switching the initialization of sum from 0 to n, but the main point here is to maximize the number of operations in as little code as possible without generating an infinite loop.

Monday, November 1, 2010

Voting Machine Security (CMPT 335 Assignment 9)


Security in the Ballot Box - Issues with Electronic Voting Machines (Part A & B)
            For this assignment I decided to look into the recent allegations of voting machine malfunctions in Las Vegas.  I would like to begin by giving a brief summary of events according to local newspapers and accounts.  I should like to follow up with some information about the particular voting machine used and any relevant security concerns having to do with the specific machine.  This essay will end on my thoughts on the issue -- whether it is being handled effectively, whether it will affect the upcoming election, and so on.
            According to some early voters in Boulder City, Nevada, before getting a chance to cast their ballots the voting machines already had Democrat Harry Reid’s name selected.  It’s not clear if this was already selected as a default (and could be changed) or whether the printed paper ballot would force a vote for Mr. Reid.  Election officials claim that their poll workers have heard no complaints on the matter.  Furthermore Mr. Lemox (the Registrar) claims such malfunctions are impossible, given the technology being used.
            While the model of voting machine went unmentioned in the mass media articles, according to an article on truthout.com the model in question is the Sequioa AVC Edge, which is apparently secure enough to emulate pac-man on – without removing the tamper-evident seals, even.  Now, whether Sequoia has updated their model to be more secure now (and whether truthout’s information on which model is being used is credible) I do not know.  But, the information taken at face value certainly fails to inspire confidence in the security of Nevada voting.  Furthermore, the New Jersey’s Center for Information Age Technology ran a number of tests on this particular model, and while functionality passed most of the criteria given by the State Attorney General, there are some interesting exceptions mentioned.  Specifically of note is that the machine’s paper ballot printer needs to be refilled about once every 120 voters, it doesn’t keep a log of when the paper is refilled, and during a refill, the stored paper ballots are accessible and subject to tampering.  All of this leads to a number of conclusions, few of them reassuring.
            While the machines have no apparent defect in and of themselves, it seems like they are relatively easily hacked into and reprogrammed.  Even regular maintenance allows stored votes to be at risk.  Given that, it is not hard to believe it possible that the allegations made about machines set up to cast votes for the Democrat by default may be true.  And, if these are indeed the voting systems in use, it seems Mr. Lemox and other state officials seem to have jumped the gun a bit in declaring these machines inviolable.
References:
German, Jeff.  “Audit Resolves Voting Irregularity Questions.”  Las Vegas Review-Journal.  Oct. 28, 2010.  Accessed Oct. 30th, 2010.   http://www.lvrj.com/news/audit-resolves-questions-of-irregularities-105990348.html .

“County Denies Voting Machine Malfunction Claims” Fox 5 News, Las Vegas.  Oct. 26, 2010.  Accessed Oct. 30th, 2010
http://www.fox5vegas.com/news/25524494/detail.html .

Friedman, Brad.  “Hacking Harry Reid (or Sharron’s Angle).”  Oct. 26, 2010.  Accessed Oct. 30th, 2010.  http://www.truth-out.org/hacking-harry-reid-or-sharrons-angle64548
Feldman, Ariel J and J. Alex Halderman.  “PAC-MAN on the Sequoia AVC-Edge DRE voting machine.”  http://www.cse.umich.edu/~jhalderm/pacman/

“Report to the Office of the Attorney General:  Sequoia AVC Edge Voter-verified Paper Record System Assessment.”  New Jersey Institute of Technology Center for Information Age Technology.  July 2007.  Accessed Oct. 30th, 2010.   http://nj.gov/state/elections/Hearing-Reports-7.07/NJIT-Edge-report-7.07.pdf
(B) Impressions on technology in voting
            As long as I can remember, I have read articles and watched television news around election time, detailing stories of voter fraud or election fraud of one type or another.  So, I would like to detail a few recurring threads that always seem to come to the fore around voting time (well, my personal experiences and impressions anyway) and discuss whether or not technology has improved these things.
            First of all, I would like to point out that doubts and worries over the accuracy of ballot counts long predate their automation.  Whether you are reading Horace Greeley’s accounts about the corrupt Democrat machine in the 1800s, or about voter intimidation in the South during and after the Jim Crow era (where the Klu Klux Klan tried to force everyone to vote Democrat)... such concerns are hardly limited to the computer era.  In more recent history, the Helping Americans Vote Act of 2002 essentially budgeted something in the neighborhood of $2 billion of federal funds to improve many counties’ electoral systems.  This lead to the widespread use of electronic voting machines, digitized voter registration databases, and was aimed at preventing a repeat of the 2000 presidential election in Florida (where so-called ‘butterfly ballots’ supposedly led to voter confusion and a long cycle of recounts were finally put to an end by a Supreme Court decision).  Did this harm or help the accuracy of our voting system?
            The cynical side of me wants to say it ultimately accomplished nothing.  Whether it’s the aforementioned issues in Las Vegas, or the odiously suspicious election of Al Franken in Minnesota a year or two ago, it all comes down to how much we trust the poll workers to honestly and competently count the ballots at the end of the day.  It’s ultimately the same question whether we’re asking them to manually count those votes, or to provide physical security to prevent the hacking of voter machines.  On the bright side, it has made the poll workers life easier, in that the counting is automated, now.  And for the voter, a touch screen is easy to use, and certainly less annoying than butterfly ballots.  Though, in turn, voting machines are more expensive to buy and maintain than, say, marking down your vote with pen and paper.  And, if environmentalism is your fetish of choice, the requirement of printing out each ballot for extra verification means you’re not really saving on paper.  So, all in all, I have to say the computerization of voting has made things easier in some ways, but also more expensive and just as subject to suspicion.

Thursday, September 23, 2010

GNU Protection Guard Public Key

Just in case you ever wanted to send me coded messages via RSA encryption, the following is my public key:

-----BEGIN PGP PUBLIC KEY BLOCK-----
Version: GnuPG v1.4.10 (MingW32)

mQINBEycKnkBEADWpbvu5NwVMHTf6Sncg4UX5ffWV2c9F4XU5vflDh9IbuTvgowz
uAD9nKbZid3d3sU1jzb5iKp9ddJ7QyhnS3xF3kw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IdWnuNTNlorEMLLt5S8iD6tFGxFCNOVmqAYTJurG
upRXf7RwGIcAEQEAAYkCHwQYAQIACQUCTJwqeQIbDAAKCRB+8Nnl2qMm528SD/9h
papabz4QBDdL8IvVxD8yesKJO6tQH1PYB+RIyRv8SyMOCpoTr4jNCvn2mgS9ayDg
7Xg+RgVRNsTfTm+fgxybiJYSh3Y9XcGWK7V33wGRp5uoq+l21xoSRXs2xGFyqWTo
h8h9qvtKCkP1XNrifaqmr4ma31HXw2IePRVQwC0R7BJnp2BwhN7kMF5a3sx2OZ8k
EtcJF5gMXpyX5F3ECq0VTHW/SipAYWZ4O6LA0sDWKicwVRa4XCe4tgi/f3l+q3x2
WbBqXYpBj+jNkVyVvr2dThZ6fQ4KUWFDN38IQtNvP91aAmsyHPQxL8YwKGMlCPfK
qBygAXq/yiB5zWKFQJTsFrb/BLQjJNFqhKNSujxs8U2D8ZtPER6QEFiw5yxFNEnF
Jj8b2dsZKhaGAHfUCMFPFvqcBapLidclDtMHxAwkDeh2kTqPQMfEIeBkXP/u/Qe6
81QZXS+kzkZY3Ce3PcQVDqVKob6XhmSWWbtHNEWfjKyD1/xzfzReaAeMBgm64/Fv
6GoXPDj7OzFCxNtCGCfxrYsMw5VwRCWaX70bj/lDEtSIjoE1gkfrTXv9RKsCPM1n
Yz/gkijQb2XtW/5QkCNOJAe5HQEosXNarv6SVFN+3dZymYdfZggqt/tru5JjJeSQ
ISyfa8D/Q6Du+3dXz5c+bQUXk//7EfQA6aC2XwX2OA==
=yUP0
-----END PGP PUBLIC KEY BLOCK-----

Thursday, June 17, 2010

Passing Thought: Applying Computer Science Theory to Economic Theory

     So I have been reading The Collected Works of F. A. Hayek Volume 1:  The Fatal Conceit - The Errors of Socialism.  Haven't quite finished the first chapter, even but it brought some interesting thoughts that I wanted to write down before I forgot them.

-- Hayek makes a reference back to Adam Smith's discussion of basic supply and demand, "the invisible hand" and all... I got to thinking, maybe one of the reasons our economy does so well at what it does (with pricing serving as an indicator that serves to automatically adjusts supply and demand to prevent overproduction and overconsumption) is essentially a form of information hiding and modularity.

I suppose I should explain those terms.  Information hiding is best explained in terms of functions and arguments.  For a programmer, when you're making use of another programmer's function, your usual concern is what the function returns and what arguments are required in what order.  If you should decide to tool around with this other programmer's code without understanding how and why he programmed it the way he did, you will almost certainly end up with a function that is less efficient - and worse, you may break the function altogether.  Thus, there is a need to prevent the first programmer from changing the second programmer's code.  I won't bore you with the variety of methods how you might go about this in an object-oriented context, but I think you get the concept.

Modularity fits along the same lines -- basically it's the concept of breaking up a program from one big "main" function into a bunch of smaller ones; each usually accomplishing a very simple, easy-to-define task.  Under these circumstances it is much easier to debug a malfunctioning program because you can usually narrow down the function that is problematic and fix it accordingly.

Now, how does this all fit in with economics?  Well in early times, and even today, the consumer rarely knows how a particular product arrived at a given store.  He usually doesn't know how it was manufactured, sometimes he doesn't even know all the contents!  My thought is this: what if this not knowing is part of why our market system works so well?  And if that is so, isn't it all the more reason command economies (such as Socialism/Fascism/Communism/Mercantilism/Absolutism/etc) rarely if ever produce positive results (nevermind trying to get results better than what the market system provides)?

Let me know in the comments what you think of the idea. -- I'll go back to reading.