Tuesday, May 15, 2007

A Cool Fact about Uniform Distributions

A Cool Fact about Uniform Distributions

On Monday I received the problem of the week from Doubleclick Technical Group guru, Andrew. The problem was as follows:

If I have a hat with all the numbers from 0 to 1 in it, and I start randomly choosing numbers from it...how many times will the number I draw be the maximum value for the numbers I've already drawn when I draw a total of n numbers from the hat? It should be noted that the question is asking: on average how many times will the maximum value change.

I know the answer is obvious to most people, but I had to do a little bit of work to get it. In the end I discovered a cool fact...that Uniform distributions and Beta distributions are related!

First what we really have here is a process that selects a random variable (r.v) from a Uniform(0,1) distribution. A uniform(0,1) distribution has mean .5 and variance .25. Uniform distributions can be used in many cool ways, the least of which is simulating a coin flip.

A depiction of the probability density of a Uniform distribution

Secondly, when we talk about the maximum of a set of r.v, max{X1, X2,....,Xn}, we can also refer to the last element in the sorted, or ordered, set {X(1), X(2), .... , X(n)<----this would be the maximum}. In this case the sort goes in ascending order.

Here is where it gets interesting! (ok interesting if your into this sort of thing, and I am...so....) When we sort the random variables produced from a Uniform distribution, the ordered set takes on the appearance of a Beta distribution! Furthermore, each element in the set has it's own specific Beta distribution....i.e. the k-th element in the set {X(1), ... , X(k), ... , X(n)} has the distribution Beta(k, k+1-n)! Wow!

These are various depictions of Beta probability density functions...neat-o!

Now, we know that the Beta(k, k+1-n) distribution has a mean value of k/(k+k+1-n). This is quite useful, because in our problem above we are asking the question: how many times does the maximum change, or rather, what is the sum of the probabilities for each draw to be a maximum. We can conclude, with some thinking, that on average after n draws the maximum of a set of uniformly drawn r.v.'s is 1 - the mean value of the n-th Uniform r.v. from the ordered set. Thus the Probability that our nth draw is the new maximum is Pr(Xn = max) = 1 - mean(Beta(n, n+1-n)) = 1 - n/(n+1)! It should be noted that I am interchanging the actual value of the n-th draw with it's probability because for the r.v. to be a max it only has to fall within the previous max's value and 1....making the probability of the draw being the max and the mean value of the Beta(n, n+n+1-n) the same thing.

So... if X0, X1, ... , Xn-1 are our draws...we have the following:

Pr(X0 = max) = 1 -0 (first draw must be the maximum)

Pr(X1 = max) = 1- 1/2 (1/(1+1))

Pr(X2 = max) = 1- 2/3 = 1/3

Pr(X3 = max) = 1- 3/4 = 1/4

.

.

.

Pr(Xn-1 = max) = 1-n-1/(n)

And by summing up these probabilities, we get the expected or average amount of times that the number drawn is the maximum...

sum(1-j/(j+1)) [for j=0 to n-1] !

So for n=10,000,000 we expect to obtain about 14 new maximums along the way!

And you thought Math was useless :-) Next week if you're lucky I will discuss how most natural processes can be described by a Normal distribution...including the stock market!

Thursday, May 10, 2007

My First Trip to NewYork

My First Trip to NewYork

These past few days here in New York have been my first exposure to the Big Apple. While I was a bit nervous about spending time in a large fruit it turns out that the big city is very interesting and an experience that all who count themselves cultured should have.

Sunday afternoon I caught a flight out of Denver International Airport. If you've ever been to DIA, then you know that it is a gigantic and very nice airport. You even have to take a train from the entrance to 1 of 3 terminals in order to fly out! Thus it came as a great surprise to me when the plane finally touched down at LaGuardia Airport in New York. I had thoughts of being greeted by fanciness and class. Alas Laguardia was, well, like a well worn shoe :-)

Nevertheless I obtained my bags and walked out to stand in a 20 minute long line for a cab where I struck up a conversation with a very nice man from 'Queens'. He broke my stereotype of New Yorkers as gruff and uncaring people (and as I would later discuss with my new Manager Garrett....New York is all about diversity and breaking stereotypes!).

After checking in to my hotel I decided to take a walk and get something to eat. I was a little afraid of getting robbed (stereotype #2) so I was walking with an alert eye and ready to defend myself at any moment. I kept remembering all the horror stories from my old Jiu-Jitsu instructors from New York. I was ready to perform an Asha Garuma (leg wheel throw) followed by an arm or wrist lock to any potential villains along the way. Eventually my mind was settled that New York City was acceptably safe after all.

I eventually found a pizza shop on Times Square. But the pizza wasn't great. I was disappointed that stereotype #3 about New York wasn't as true :-/ (Later I gave another pizza shop a shot and their pizza was great...stereotype #3 = true!)

The next two days of my trip involved meeting with Warner Bros and making sure that the creative shops knew how to use Motif AdKit to its fullest capacity. Though I wont go over all the details of the meetings, WB and the creative shops we met with are now further on board with Motif.

Aside from the meetings, however, Monday night we took Warner Bros out to dinner at a restaurant called Japonais (http://www.japonaischicago.com/ this is the Chicago version...the NY one is similar).

IT WAS SOOOOOOOOOOOOOOOOOO GOOD!!!!!!!!! First we had about 10 rounds of Sushi and Sashimi. Nothing beats a master sushi chef with fresh out-of-the-water-fish.

But the highlight of Japonais was the Kobe Wagyu style Sirloin steak. I nearly died of happiness when I took the first bite. Being from Texas and all, I really thought that I knew what good steak was. Well, those red meat eating Texans could learn a thing or two from the Japanese that's for sure!

Oh and I also saw a small fraction of Central Park that afternoon. We also made a whirlwind tour through MoMA (the museum of modern art).

Waking up a bit tired on Tuesday I proceeded to some more meetings with WB and their creative shops. Again we presented our material, the creative shops listened and the meetings adjourned without any wrestling matches.

After the meetings I had the pleasure of meeting Fan Zhang and Garrett Cronin in person for the first time! Fan was kind enough to take me around the office and introduce me to all the Adapt folks there. I even learned that in fact there are two Theo's that work at DoubleClick! Luckily I work in Colorado and the other Theo is New York.

Another dinner with WB and another 15 block walk back to the hotel. I decided that I would take as few cab rides as possible in order to prevent all those appetizers and desserts from going straight to my 'Buddha' (my own slang for my ever more rounding belly).

As I headed for the DoubleClick office Wednesday morning I stopped for a bagel and put a check mark next to another New York stereotype: awesome Bagels!

Lunch found Garrett, Fan and I eating fish products and banana pudding at a little restaurant in Greenwich Village called Mary's Fish House. It was very delicious! Our conversation turned to marking out the differences between Colorado and New York. And the difference is....diversity (well that and mountains, way less people, clean air, real estate that you can afford and not be the size of a shoebox...etc)! New York's vast range of ethnicities, cultures and languages is really cool. I think I heard at least 5 different languages as I walked along the streets.

Finally it was time to go. I got my bags, walked out to the street put up my hand and was soon picked up by a Taxi who then drove me at 1000 mph to LaGuardia Airport. It was like being in an F-16 fighter jet! So now here I am back in the Rocky Mountains, with fresh air, clean streets and not a honking horn or siren to be heard. Home sweet home!

Tuesday, May 1, 2007

Entrepreneurship Or What do I Know About Anything Anyways

Entrepreneurship

To become a successful entrepreneur it is imperative that one adhere to the following rules....

Okay, I'm just joking about that. If there were a set of rules to follow to become a successful entrepreneur than every body would be one. Who wouldn't want to be the guy in charge?

So what does it take to run a successful business? In the end, I really couldn't say. I've never run a "successful" business. However, in my own defense, I have run some nearly successful businesses which I believe were limited only by my own lack of stick-to-it-iveness. In the end I think that this may be the real key to any successful business: sticking to it, and always remaining optimistic.

A Short History of My Entrepreneurial Career

My very first business ever was a lawn mowing business named, "The Lawn Boys". My friend down the street had a riding lawn mower. My father had the desire to get me out of the house for the summer (and for me to become financially independent at 13). And last I had the desire make a little money to buy a sweet new guitar! At our peek we pulled in 50 dollars a week! Alas in the end, neither my buddy nor I could get psyched about lawn mowing....and we eventually threw in the towel.

My second business was a band aptly named Theology. Being a rock and roll musician required much dedication to practicing, getting gigs, and songwriting. My good friend Will and I were dedicated to all three. But unfortunately it became increasingly hard to find a solid and reliable bass player and 2nd guitarist. Soon rock and roll lost out to college study. We did however produce a very solid and nice sounding album on an old computer and a super cheap sound card.

Near the end of college I started another business with my good friend Will. This time we used our brains instead of our ears to make money. We started a small IT business to build websites and construct networks for small businesses. Things were going well, but unfortunately I moved to Colorado to learn about very advanced topics in Mathematics.

My last business was about to get off the ground and rolling, when my good friend and business partner Ray moved back to China. It's still possible for us to do some business, especially as the developed countries turn to the underdeveloped countries for outsourcing. We still exchange emails and ideas every now and then. It may take a while, but I think Ray and I will eventually be able to pull off a transcontinental business.

Currently, like a crouched tiger, I am waiting for the next opportunity to present itself. There are many possibilities, but few real opportunities. And so I'm waiting, thinking, and of course....blogging!

Though there is much to be said about starting a successful business, I have more questions than answers. But that is one of the main reasons I have decided to blog. Perhaps writing my ideas and questions out will bring constructive criticism and also clarify and sharpen my vision. Who knows? Perhaps the next business I start will be less of a warm-up/practice run and more of a multinational conglomerate! :-)