Entries from September 2008 ↓

Essay Time!

So, after a ghastly essay season in fall 2007 where I managed to get myself rejected from a bunch of colleges, I find myself in a similar situation again. This time, its Google/MS to whom I should be bragging without seeming like I’m bragging. Although these two have assumed that freshmen are losers, I plan to turn in an app because my chances will go from 0.005 to 0 if I don’t bother applying. 

Google wants me to babble about the toughest CS chanllenge I’ve faced. I am in this dilemma now:

So, making a decision shouldn’t be so hard. It is pretty stupid though, just 2 to choose from. 
I then have to spew crap about what I really like in CS. I actually know what I like, I just don’t know enough about it. I like Quantum computing, but only because I feel the Church-Turing thesis might be invalidated or we may be forced to get factoring to work in polynomial time. I just know that. I just know decoherence is a PITA. 
I might be aiming too high…. but I guess it is like me setting standards for myself… more like “I need to get there” thingy.

Awesome Problem

 

I had the opportunity to work on an interesting problem:

 

Find a decent approximation for the Zeta function (large values), given by:

So, to make any sort of headway, I decided that I would have to look at the graph. Hence, I whipped up a script in Python:

#!/usr/bin/env python
#Author: Shriphani Palakodety
#Mail: shriphani@shriphani.com
#Blog: http://shriphani.com/blog

#Generate the plot of the Zeta function.

from pylab import * #imports the matplotlib graphing library

def zetaValue(n):
    ‘Returns the value of the Zeta Function n’
    val = 0
    for i in range(1, n+1):
        zeta_term = float(1)/float(i**2)
        val += zeta_term
    return val

def makePlotRange():
    ‘Generates an array of form [domain_list, values_list] for 1<1000′
    num_list = [] #This contains the domains
    range_list = [] #Contains value returned by Zeta function for every element in domain
    for i in xrange(1,1000):
        num_list.append(i)
        range_list.append(zetaValue(i))
    return num_list, range_list

plot_range = makePlotRange() #gets the arrays

plot(plot_range[0], plot_range[1], ‘bs’)
savefig(‘zetaplot.png’)
show()

This looks a like:

 

plot of the zeta function

plot of the zeta function

Observe this plot. We can see that there is a horizontal asymptote at x = 1.65 . 

Hence,

This leads me to conclude one bloody thing:

And,

Now, it shouldn’t come a surprise to all math or CS majors that g(x) is a function whose denominator has a higher degree than the numerator. So for the sake of simplicity, I shall assume that;

Another reason prompting my eagerness to pick that particular function is because of the following observation:

 

  • 1/x is a rectangular hyperbola which looks like:
    Rectangular Hyperbola

    Rectangular Hyperbola

  • If you use -1/x , the graph is rotated about the X axis and it looks like:   

    Inverted Rectangular Hyperbola

    Inverted Rectangular Hyperbola

  • So, if you look at the positive X axis, we have already managed to replicate behavior of the Zeta function. All we need to do is move it up and ensure that the limit stays.
  • To move this graph up, just add 1.65 to f(x) and it will work:   

    Inverted Rectangular Hyperbola Moved Up by 1.65

    Inverted Rectangular Hyperbola Moved Up by 1.65

  • So, the limits match, the behavior matches and all we need to do is test:
I fired up Python again and wrote this code to perform the final test:
#!/usr/bin/env python
#Author: Shriphani Palakodety
#Mail: shriphani@shriphani.com
#Blog: http://shriphani.com/blog

from pylab import * #imports the matplotlib graphing library

def zetaValue(n):
    ‘Returns the value of the Zeta Function n’
    val = 0
    for i in range(1, n+1):
        zeta_term = float(1)/float(i**2)
        val += zeta_term
    return val

def makePlotRange():
    ‘Generates an array of form [domain_list, values_list] for 1<1000′
    num_list = [] #This contains the domains
    range_list = [] #Contains value returned by Zeta function for every element in domain
    for i in xrange(1,1001):
        num_list.append(i)
        range_list.append(zetaValue(i))
    return num_list, range_list

plot_range = makePlotRange() #gets the arrays

def hypoFunction():
    num_list = []
    range_list = []
    for i in xrange(1, 1001):
        num_list.append(i)
        range_list.append(float(-1)/float(i) + 1.65)
    return num_list, range_list

other_range = hypoFunction()

plot(plot_range[0], plot_range[1], ‘bs’, other_range[0], other_range[1], ‘ro’)

savefig(‘zetaplot.png’)

show()

And this looks like:

 

 

 

A Plot of Proposed Approximation and The Zeta Function

A Plot of Proposed Approximation and The Zeta Function

Hey, this thing seems to replicate the behavior of the Zeta function way below x=100. Assignment done !!!!

 

I had another question which is coming up in the next post. I am in love with Discrete math.

Anyway, I attended this job fair thingy and got free stuff from Google, MS and others (MS was giving us ping-pong balls…). Google’s pens are serving me well. Anyway, I am sure I won’t be accepted as an intern anywhere thanks to the fact that every company thinks that freshmen are losers and don’t deserve to be emloyed right in their first year.

Anyway, keep waiting for the second approximation I did.

Intro CS Blooper

I feel like an arsehole right now. I forgot to change the output to god-damned lowercase on an intro CS project and managed to score 90…..

Any way,

Dumb, Dumber and Dumbest, that is how my intellect is deteriorating. I feel like a n00b. Bloody spec was so long for such a short POS.

Anyway, I was trying to use matplotlib to do interesting stuff in my discrete math class (I actually made a blooper in homework 1 over there as well, awesome kick off, isn’t it?).

Anyway, with my awesome track record in carelessness, this was supposed to happen. Did any of you guys blow up intro CS classes as well?

Anyway, we have moved to proof theory in Discrete Math and I have seen the weirdest names in the world already- modus ponens ?

Exams approaching soon. This blog is really deteriorating in quality.

Deccan Chronicle Ads

Deccan chronicle is a leading newspaper in Southern India and its online version is marketed by a company - Pressmart. Deccan Chronicle’s blog carried the following ads this morning:

The Indian media….