Monday, November 10, 2008

Wow... (update on Zilch research)

I grossly underestimated the size of the game space. I was thinking it'd be in the billions. It turns out to be about 64 trillion states. Searching the space will require some memoization to speed up the time (because the expected value nodes are 55,987 branches wide) , but I can't memoize the entire space unless I had an exabyte of RAM available (need someone to get on that real quick :D). I'll use some strategies to reduce the size of the space, and maybe a caching strategy to only memoize the states that are needed at the moment. More updates as I progress tomorrow. I need my sleep.

Sunday, November 9, 2008

I officially dislike Blogger's formatting...

It is impossible to format code in Blogger without Blogger ripping it apart... is there a solution for this or do I need to move to WordPress?

Saturday, November 8, 2008

Study of the game Zilch part 1

You know you're a math nerd when you analyze a game to determine the best strategy. Be forewarned, the following post is really math intense; abandon all hope of avoiding nerdhood ye who enter here...

I have been introduced to a wonderful game called Zilch on Kongregate. If you want to lose hours of your life, go to Kongregate and check out all of their cool flash games, all of which you can play for free. :) The reason I wanted to talk about Zilch is that it is a great game that illustrates some of the interesting corner cases of game theory. I will be breaking up this analysis into several segments in order to discuss different aspects of the game, and the process one could go through in order to come up with a winning strategy for the game. This first segment will discuss the scoring and expected value of a hand, and will end with an analysis of an interesting situation in the game that has an unexpected strategy.

Let's start with a quick summation of the rules. Players play in turns, and attempt to score points by rolling dice for a hand. Once one player gets to 10,000 points, the other player has one more turn in order to attempt to beat the crosser's score. Scoring for a hand works as follows: you roll 6 dice, and every turn you have to score something and either bank or roll. You score based on the following scoring rules:
  • 1 one: 100 points
  • 1 five: 50 points
  • a set of three or more dice: 12.5*base*2^dice. The base is the die value in points or 10 points for a one. For example a set of 4 sixes, it scores 12.5*6*2^4=1200 points. 6 ones is the largest score in the game worth 8000 points.
  • a long straight 1-6: 1500 points
  • three pairs (not necessarily unique): 1500 points
  • nothing: if a roll of 6 dice results in no scorable dice, then it scores 500 points instead.
After each roll you take dice off and score them, keeping the points in a "bank". You may score any of your dice that you want, but you must score at least 1 die or get a Zilch for the round, scoring 0 points. After scoring dice, you get the option to either roll again with the remaining dice or taking your points from the bank and ending your turn. This is called "banking" and it requires that you have at least 300 points in your bank. If you are lucky enough to score all your dice then you get all of your dice back and it constitutes a free roll, which can be repeated as many times you can manage to pull it off. If you are unlucky enough to zilch three times in a row, then you score -500 points (this does not stack).

After the first few playthroughs, some interesting strategies seem to jump off. Firstly, if you have a single die remaining, and you can bank, it's usually a good idea to do so, for the probability to zilch in that position is 2/3. If you have two zilches against you, then you want to bank at your first opportunity in order to avoid the zilch penalty. When scoring, it's not always the best thing to score everything available to you, especially in the case of 3 twos. Your daring is really more of a function of what your opponent's score is in relation to your own.

So what does it mean to know the perfect strategy for a game? A perfect strategy is to know based upon any game position the proper play to make that maximizes some quality of the game state. This quality is usually to win the game, but in the case of the online game there are also strategies to obtain some of the achievement badges, such as winning a game without zilching, playing a game with the least number of turns, or scoring over a certain value for each non-zilched play. At first I will be analyzing the basic question of best play to win the game.

Therefore, we need to start by defining the game state. Since we at first do not care how many turns it takes, or whether or not the win is zilch free, or any other qualities of the game other than winning, a lot of historical values can be discarded. The remaining qualities of the game break down as follows:
  • Whose turn
  • Your score
  • Opponent's score
  • Your zilch run (number of consecutive zilches before this turn)
  • Opponent's zilch run
  • Current bank value
  • Dice state
My approach to determining the proper strategy is similar to how blackjack was analyzed. I start off by determining a "book strategy" which is the proper strategy in a turn based on the state of the game and the dice. From there I'll want to come up with some ground rules that aggregate that strategy into a set number of rules. This will boil down into something like "double down on 11, or 10 if dealer's not showing an Ace".

I could approach this from an elegant mathematical angle, using clever reasoning to determine each step in the process. Instead I decided to brute force the numbers, and get the elegance later when summing up the results. My tool in this quest is Java. Later on I will see how much faster this would have been in a language like Haskell, where this kind of search is better structured.

I represent my dice as an integer array. I then write a function that evaluates a set of dice for the score you'd get if you took everything (no banking instituted yet). After writing some tests to assert that I was good, I then wrote a clumsy for loop to evaluate across all dice:

int dice[]=new int[]{1,1,1,1,1,1};
int fullscore=0;
Map<Integer,Integer> scorecount=new TreeMap<Integer,Integer>();
int sc=calculateScore(dice);
scorecount.put(sc, scorecount.get(sc)+1);
}else scorecount.put(sc, 1);
double avgscore=(double)fullscore/46656.0;
System.out.println("Average score:"+avgscore);
boolean medflag=false;
int ssf=0;
for(int x:scorecount.keySet()){
+ "\t" + ssf
+ "\t" + (double)ssf/466.56);
if(!medflag && ssf>=23328){
System.out.println("<=== Median");
}else System.out.println("");

My goal here was to get the average and median scores from the first throw. This data would be useful later in understanding strategies and would allow me to develop the infrastructure needed to walk the state space of this game.

Results? You can execute the code yourself to get the score layouts. :) Here are the highlights. I get an average score from the first throw of 426.60. That's a lot of potential... what that tells me is that with average throws I should be able to score my 10,000 points in about 23 turns. The median of the first throw is 250 points, and your chances of having a bankable score at the start are 44.58%. If I only count bankable throws, and take worst case scenario of zilching otherwise, I get an average score of 341.78.

That told me a lot of info, but not everything I needed. I now wanted to evaluate based on the second and subsequent throws, meaning I'd have to evaluate with less dice. The idea of writing that horrendous for-loop structure was scary, so I decided to go a bit more functional. And man, Java didn't make it easy. :D

In order to evaluate across all dice of any number, I decided to stay with my int[] strategy. I started by writing a couple of generic interfaces:

public class ZilchCalculations {

public interface DiceCalculation<X>{
public X evaluate(int[] dice);

public interface TreeCollate<X,Y>{
public X collate(X values, X nv);
public X ret(Y st);

The first interface allowed me to make a calculation across dice. The second allowed me to collate that calculation across those dice combinations. Notice how I've abstracted the evaluation structure and the Collation structure. Essentially these interfaces will act as containers for function objects, much like a C# delegate structure. Next is to do the actual evaluation and collation:

public static <X,Y> X acrossAllDice(int numdice,DiceCalculation<Y> eval,TreeCollate<X,Y> coll){
int[] dice=new int[numdice];
return acrossDice(0,dice,eval,coll);

public static <X,Y> X acrossDice(int make,int[] dice,DiceCalculation<Y> eval, TreeCollate<X,Y> coll){
X res=null;
for(int d=1;d<=6;d++){
else res=coll.collate(res,acrossDice(make+1,dice,eval,coll));
return res;
}else return coll.ret(eval.evaluate(dice));

This allows me to evaluate across all dice combinations for an arbitrary number of dice. The acrossAllDice function creates a holder array for the dice states, and recursion causes the numbers in dice to be updated in order. When I am at the root of the tree, I call the evaluate function in the DiceEvaluator to get my evaluation object, and then the TreeCollate's ret function to put that into a singleton collation object. It then continues to collate as it goes up the tree. I can easily wrap my scoring function in an evaluator:

public static final DiceCalculation<Double> SCORE_CALC
=new DiceCalculation<Double>(){
public Double evaluate(int[] dice){return (double)calculateScore(dice);}

and then my collation function for now will just sum the results:

public static final TreeCollate<Double,Double> SUM_UP
=new TreeCollate<Double,Double>(){
public Double collate(Double values, Double nv){
return values+nv;
public Double ret(Double x){return x;}

Now to get the average score for 6 dice? acrossAllDice(6,SCORE_CALC,SUM_UP)/Math.pow(6.0, 6.0). For 5 dice it's just acrossAllDice(5,SCORE_CALC,SUM_UP)/Math.pow(6.0, 5). That seems like a lot of work just to be able to make a small change like that. Let's show the power of this approach. Say I want to collect all the scores into a list for stat evaluation:

public static final TreeCollate<List<Double>,Double> COLLECT
=new TreeCollate<List<Double>,Double>(){
public List<Double> collate(List<Double> values,List<Double> nv){
return values;
public List<Double> ret(Double x){
return Collections.singletonList(x);

and change SUM_UP to COLLECT above to reap the benefits. Say I wanted to calculate the chances of zilching on a throw?

public static final DiceCalculation<Double> ZILCH_CALC
=new DiceCalculation<Double>(){
public Double evaluate(int[] dice){return calculateScore(dice)>0?0.0:1.0;}

and substitute ZILCH_CALC for SCORE_CALC. To get a tabluar evaluation:

System.out.println("Number of dice\tAverage Score\tZilch Prob.");
for(int ndice=1;ndice<=6;ndice++){
+(acrossAllDice(ndice,SCORE_CALC,SUM_UP)/Math.pow(6.0, ndice))+"\t"
+(acrossAllDice(ndice,ZILCH_CALC,SUM_UP)/Math.pow(6.0, ndice))+"\t");

which gives me the wonderful table:

Number of dice Average Score Zilch Prob.
1 25.0 0.6666666666666666
2 50.0 0.4444444444444444
3 86.80555555555556 0.2777777777777778
4 143.5185185185185 0.1574074074074074
5 225.7908950617284 0.07716049382716049
6 426.60108024691357 0.0

This table explains a great generic rule that's originally counterintuitive. Say you're under two zilches and you rolled 2-2-2-5-3-4, a rather unpleasant roll. Do you score the 5, the 3 twos, or both? If you look at the table, it'll make sense that you score only the 5. Scoring the 5 gives you the possibility of scoring an average of 225.79 points over those last 5 dice, meaning your average score is 275.79 (still not that good) but your chances for zilching are only 7%. If you take the three 2s, you do have 200 points, and your average is slightly higher now (286.81) but you've now quadrupled your chances to zilch (at ~28%). If you take both, your average is at 300, but your chances to zilch are now 4 in 9, an unhealthy prospect. It makes sense to reroll as much of this crappy roll as you can.

However, this isn't a soundproof argument for maximizing your score, only a good hunch based on some statistical calculations. The soundproof argument will come from calculating across the entire space, and that will happen in the next installment.

Wednesday, October 15, 2008

Blog Action Day -- Absolute Poverty

It's been another three weeks and I felt like flexing my writing muscles again, so I saw the announcements about Blog Action Day and went to the website. Since it is an important topic that needs more focus than beauty pageants can give it, I decided to give it a try. The problem is that I am absolutely no expert on the topic. In fact, after thinking about it for a bit I had very little knowledge of what poverty really is. It has grown to become one of those big ideal words of bad things in my head like unemployment, genocide, starvation, illiteracy.

I have really been damned lucky in my life. I've always had a place to live, never had to go starving, almost always had a job, never been persecuted due to any protected classes, and I've always been able to read and been around people in my life that can do the same. When I grew up my parents never had a lot but they were never truly impoverished and I was pretty lucky to never really experience that.

At the same time all of this fortune also makes one not so observant of not having a job (well right now for me that's kind of an issue, but my prospects are better than most) or lacking the ability to read, or being homeless, or experiencing discrimination, or what true hunger really feels like.

It seemed that my ignorance was showing.

One good place to fix displays of stupidity is to research. I started at the base level with the Wikipedia article and scaled outward. The definition of poverty depends on the setting of a threshold that must be achieved in order to self-sustain, so the first thing that the article does is to differentiate between absolute and relative poverty by classifying these thresholds.2 An absolute poverty threshold is defined in terms that do not vary between human beings, whereas a relative poverty threshold takes into account the economic and cultural situation of the society that you live in.

I've decided to focus on absolute poverty, since relative poverty will bring into the conversation philosophical arguments that betray the actual crisis at hand. Where relative poverty varies from country to country and depends on being able to define a standard of living, absolute poverty is defined as the inability to provide for 2 of the following life necessities (according to a UN report by David Gordon):
  • Food: Body Mass Index must be above 16.
  • Safe drinking water: Water must not come from solely rivers and ponds, and must be available nearby (less than 15 minutes' walk each way).
  • Sanitation facilities: Toilets or latrines must be accessible in or near the home.
  • Health: Treatment must be received for serious illnesses and pregnancy.
  • Shelter: Homes must have fewer than four people living in each room. Floors must not be made of dirt, mud, or clay.
  • Education: Everyone must attend school or otherwise learn to read.
  • Information: Everyone must have access to newspapers, radios, televisions, computers, or telephones at home.
  • Access to services: This normally is used to indicate the complete panoply of education, health, legal, social, and financial (credit) services.
It seems to me that many of these basic necessities should be at least achievable no matter what society you ascribe to. However, some disturbing things came to light when I started looking into each requirement on the list.

A BMI of 16? That's practically anorexic. Recently there was a mandate by many fashion boards to prevent models from modeling if their BMI was under 18. Median BMI in the US is around 24. Keep that in mind when you look at David Gordon's charts at the end of that talk to see how critical the situation is. There's something wrong with culture where we can eat whatever we want when we want while models do hunger art to "entertain" us knowing full well they're getting paid well enough to recover afterwards when poor people out there are starving for real and don't even have the opportunity to get the job to earn the food to keep them well.

It gets worse. We as a society can drink water sold in bottles but outside of the US there's many places where 10% or more people don't meet this standard (some places like sub-Sarahan Africa are at 48%). It also looks like I'm preaching to the non-impoverished: 95% of the worlds computers are in 20% of the people, and this creates an information gap in science and education that is much more disturbing than the disappearance of the middle class that we seem to fret about in the US. The housing crisis is a big ticket item in the US, but the unspoken conclusion of the financial situation is the eventual increase in homelessness that it will produce; already 700,000 to 2 million people experience homelessness on any given day in the US (something many of us do see), but that's only 2% of the world total. Finally, in a country with a 98% literacy rate, we don't see many people who are illiterate, whereas the moment we step out of our borders the rate is at 82%. Some places in the world have 50% literacy.

Keep in mind that these issues are also within our borders, and I don't make light our our own poverty problems in the US. I'm looking at absolute poverty here, where there are no houses not made of mud or clay, no running water or water resource for miles, with a lack of food, employment, education, clothing, health care, and information. These are people who don't have a society from which to ask for assistance. Honestly, it's hard to picture such a dire situation in the United States. We have running water and electricity in this country. Libraries are open to whomever want to enter, and after filling out the right forms you can use their computers, which 98% of you are able to do because someone taught you to read. People here do provide food and shelter to those in need (although more need to take the call to arms).

I guess the point is that I'm not alone for not seeing many of these issues. I live in a country that comparatively has not seen absolute poverty (at least not yet, depending on the markets), and have lived my life never truly being at the point where I was deprived of any of the above. Therefore, I have no true focal point.

And neither does the world. Interestingly enough, people argue so much over the statistics that I couldn't find an absolute answer to how many people suffer from absolute poverty. I guess that it's a hard question, mainly because of those 8 conditions above no one seems to have drawn up the necessary Venn diagram and counted the intersections. One way to estimate the problem is the World Bank's threshold of extreme poverty, which is living on less than $1.25 a day (based on 2005 Purchasing Parity Power). No matter what part of the world in which you live, it seems difficult to be able to maintain 7 of the 8 conditions above on a salary of less than $37.50 a month. (Wow, I have $40 in my wallet currently. How much money do you have in your wallet? Could you live on only $40 over the course of a month? Anywhere?) From the World Bank:
Using improved price data from the latest (2005) round of the International Comparison Program, new poverty estimates released in August 2008 show that about 1.4 billion people in the developing world (one in four) were living on less than $1.25 a day in 2005, down from 1.9 billion (one in two) in 1981.
I guess we're doing better? It still seems pretty horrific that 25% of people in the developing world suffer from extreme poverty. I'd be willing to bet that at least the majority of those suffer from absolute poverty, per my arguments above. Do we see any of these people? How about in the US? In my research today, I couldn't find a US indicator of extreme poverty by the World Bank rules, because here we define it at less than $10,000 a year, which is more than 20 times the World Bank standard. Using that threshold we have 6% "extreme" poverty. Again, I don't want to lessen the horrible situation of the impoverished in America; rather, I simply want to convey how hard it is to find people who experience extreme poverty by World Bank standards and how incomprehensible of a problem it is.

In that same talk by David Gordon where we got the 8 requirements for human sustenance, there's a summation statement (oddly enough in the middle of the talk):
Fundamentally, poverty is a denial of choices and opportunities, a violation of human dignity. It means lack of basic capacity to participate effectively in society.
This is pretty profound. I couldn't even imagine how it feels not to be able to provide for my most basic needs, and there are so many people at this critical level. Not only that, the purpose of society is to assure their members that these choices and opportunities are being met, that it is possible to satisfy these 8 necessities. Anything less of that is inhumane and undignified. And to think how large this problem is.

Really, 1.4 billion? I can't imagine 1.4 billion dollars, let alone 1.4 billion suffering people that need that money on a daily basis. And I had to research how bad the problem is? It's no wonder that those in absolute poverty feel voiceless in society and why it's important for the relatively wealthy to speak up and act on their behalf and for the support of their welfare.

Monday, September 22, 2008

On speculation...

I have not posted in three weeks. I reckon that I will be fixin' this now.

I decided to start a book club for speculative fiction. The idea formed over coffee on a Sunday with a good friend of mine and her friend. We got together for Scrabble and conversation (I did tell you I was a nerd, right?) and had a long discussion about 3-letter words and science fiction.

It's real hard to convince a book club to discuss science fiction. This is due to a bad rap the genre has received. Some of it is deserved; good science fiction depends on not only a modest understanding of the science, but also a sharp understanding of fiction. This makes it at least twice as hard to write as other forms of fiction. Now a great sci-fi novel will also take in elements of sociology, history, anthropology, psychology, and common sense in realistic amounts just to rattle your bones. The best sci-fi will do this to make you really think and learn from it. It's so easy to fall short of this mark, thus no wonder that there's so much crap out there to sift through.

I decided upon starting not a science fiction group, but a speculative fiction group. There is a slight distinction; speculative fiction centers more upon the concept of speculation, or the forming of hypotheses. These are predictions, and are notoriously fickle. The key is that it doesn't need to be about technology, just a hypothesis with a fleshing out of the consequences of what that hypothesis entails. This includes books like 1984 and A Handmaid Tale which are more about utopian and dystopian futures than about science, books like the Difference Engine and The Man In The High Castle which are more about alternative history than science. The thread that connects all of these books is the idea of asking "What if?" and not the science, even if the act of forming hypotheses is at the root of science.

I call the group S3 and we're listed under meetup. I won't link directly due to google's nosiness and my persona firewall.

It is SO important to ask this question, especially in our times. I just listened to this wonderful Web 2.0 seminar about the information overload being more about the failure of filters than the sensory overload. He goes one step further in the talk to conclude that the shift in economics caused by the Internet (a post-Gutenberg economy) changes the responsibility of a filter on content that breaks many social systems that now need repair. Our technology is changing so fast that we need to think ahead of it to make sure we're ready for it when it gets here. And that's where speculation will save us. At the speed we're going, we can no longer afford to be blindsided.

I read 1984 when I was a teenager and it changed my life. I would never believe that people would fall into such a regime, or allow themselves to be so brainwashed. Then I read the book and was crestfallen at Winston's prediciment. Orwell really knew how to ask "What if?" and how to make you feel for the main character and understand his points on an emotional level. We use the term "Big Brother" now in honor of Orwell's work.

The only thing I felt that was missing from 1984 was a lesson. It wasn't meant to have one of course; "He loved Big Brother" says much more to force you to get your own conclusions. However, it doesn't give good instruction to fight the dystopia. Nowadays, we need it spelled out. Our society is facing the abyss of a Eurasian totalitarianism due to the very filter failure mentioned two paragraphs ago. It's just as serious as the impending crash in the markets, and will blindside us just as quickly, even though people have been talking about it for years before it happened.

Tonight I read a WONDERFUL speculative fiction novel written by Cory Doctorow called "Little Brother". I can link to the entire text because Doctorow in his wisdom released it under Creative Commons. This (advanced) juvenile novel tells of a totalitarian state caused by a second terrorist attack. It was one of the quickest reads I have ever encountered. The story parallels and evokes many 1984 themes; even the protagonist starts off with a handle "W1n5t0n". It grows wildly from this trope though, and extends into many subjects that touch on the state-of-the-art. It hits some very serious subjects in an intelligent manner. The biggest plus though is that it forces you to ask "What if?" and feel it on an emotional level. You really get to care about Marcus and his situation, and compare it to real life. Finally, Doctorow gives us some really good lessons, some of them highly subversive. This is one of the most patriotic novels I've ever read, and it really is a MUST read in our times. I'll be dedicating another post to just reviewing many of the topics of this book in the next couple of days.

These are the kinds of books that need to be discussed in book clubs. Fervently. With high amounts of disagreement. And lots of growth in knowledge, wisdom, and character. We will be discussing this kind of fiction in the S3 (maybe not as heavy, but just as playful).

Okay, now to get some sleep. The markets should prove to be interesting, as there was some aftermarket activity that makes me think tomorrow will be a really down day. Of course the real fun occurs when the short-selling rules are no longer in effect on October 2nd. That day will be filled with a completely different form of speculation, and it won't be good.

Saturday, August 30, 2008

And that reminds me...

It's raining like mad outside
and that reminds me that I need to write in my blog
and that reminds me that I walked home tonight
1 and a half miles
and that reminds me that I copied "and that reminds me" with ctrl-c
because I'll use it a lot
and that reminds me that I composed this poem while walking home
and that reminds me that I'm still creative
and that reminds me why I went out drinking tonight
and that reminds me that one of my great friends got fired today
and that reminds me that today is yesterday
and that reminds me that I recited the poem I'm typing in while I walked home
and that reminds me that I'm blogging after a night of debauchery
and that reminds me that I should be more cautious after I drink
because I am publishing this and I have responsibility
and that reminds me of this great XKCD comic
and that reminds me that CTRL-C allows me to repeat "and that reminds me"
and that reminds me that what happened to my friend was totally not fair
and that reminds me to polish my resume
because companies aren't fair, regardless of how cool they are
and that reminds me that someone could find this poem
and that reminds me that I don't care
and that reminds me that I was yelling this poem
soaking wet
while walking home
and that reminds me that I ran into two people while walking home
also soaking wet at the time
holding hands
and it was sweet
and that reminds me that people in this world are still honest and good
and that reminds me that I forgot half the poem
because I was drinking
and that reminds me that I don't care what I say
and that reminds me that I walk home which is the responsible thing to do when you drink
and that reminds me that my wet clothes are strewn across the apartment drying off
and all of that reminds me that I'm alone
and that reminds me that I shouldn't care
because I'm still known and cared for
and that reminds me that I remembered that people cared about me while I was walking home
soaking in the rain
and that reminds me that people are good in this world
and that reminds me that I have more to write in order to inspire others
and why does that reminds me that I've been drinking?
and that reminds me that I don't drink often, only during life events and social gatherings
and that reminds me how few of those events there are
and that reminds me of how honest I'm being
and that reminds me of how much I've lost
and that reminds me of how hard I'll have to work to gain it back
and that reminds me that I just walked 1.5 miles in the pouring rain to get home
and that reminds me of how sobering an experience that was
and that reminds me of how far I am from everyone that I love
and that reminds me of how fragile and short life really is
and that reminds me of how much harder I need to work
and that reminds me that my sister called me at 1 am to ask me what song that was
and that reminds me that my phone randomly dials people while I'm dancing
and that reminds me that I was dancing
to get my mind off of troubles, to get my mind back in focus
and that reminds me that I was also singing
and that reminds me that my voice will be sore tomorrow
and that reminds me of how many thoughts are wandering in my head right now
and that reminds me of how many thoughts were wandering in my head when I was walking home
soaking in the rain
and that reminds me that I work for a great company
and that reminds me that a great company can do shitty things
to good people
for bad reasons
and that reminds me that I really should keep my mouth shut
but I don't care
because I do care too much
and that reminds me that our lives are forever lived two-faced
to keep a dream alive, to tell the truth to a dream at the same time
in order to kill it
and that reminds me that i've been typing "and that reminds me" out after a while
because I want to feel it, because I want to feel life again
and that once again reminds me of how lonely it is to live alone
and that reminds me that I have a lot of friends that care about me
and that reminds me of my good friend who got fired today
who told me that the most powerful drug in the world
is Denial
and that reminds me that I need to figure out what my life is all about.

that's it. I'm going to bed. Talk to you tomorrow.

Wednesday, August 20, 2008

On walking...

Recently, BlogStamford had an interesting blurb on walking, and I decided to put in my two cents. As commented on his post, I live literally within 400 yards of everything I need to survive, and a lot of extra ammenities to boot. Even the library, mall, restaurants, and movie theatres are within walking distance. When I was working at my last job, I was within walking distance of that, and thus never needed to drive.
Therefore, when I first moved here a number of years ago, I decided on an experiment that started almost by chance and grew into an amazing experience. From June of 2006 to December 2007 I used my car as little as possible (there were 3 emergency times). I finally broke down after needing it for my new position (my commute went from a 30-minute walk to a 90-minute drive). But even though I'm driving a lot now (average $75 a week on gas), I still walk to most places, even if they're miles away. It definitely saves on gas and makes me feel better when I do so. Also, since I'm working from home 3 days out of the week, I'll use any excuse to be in a world filled with people every once in a while. While it doesn't bode well for the amount of money I spend for coffee, it does make it easier to socialize.
That being said, there is a huge issue afoot(sorry) regarding pedestrian safety in Stamford, and with my expertise I feel qualified and obligated to comment on it. I can recall several instances where I've almost been run over (once where the car stopped just fast enough to graze my shin) by cars. I arrived to the point where I actually disregard all signals and just look at the cars to see where they are going, due to safety concerns and in some cases insufficient walking signals. I've had cars actually honk at me when I'm in the crosswalk and I have the signal (more than once driving around me with colorful sign language). To cross the Bedford/Summer/High Ridge/Long Ridge intersection, you have no option but to jaywalk. To cross Broad St from Summer from the east side of Summer, you actually have to cross over to the west side of Summer before crossing Broad, because even though there's a walking signal there you'll never get the signal. Again you must jaywalk or go the long way around. And this doesn't get into the accidents that have happened in town in years back, the lack of lighting along Bedford, and the cars that love to dragrace down Summer (on a walk last night, I saw one said dragracer make some kids cry when startled by the racket from the engine).
I think the authorities are doing a lot already to help with pedestrian issues (the countdown signals are great even though they aren't plentiful enough, and there's a concerted effort to catch DUIs). However, I think that timing on some of the crosswalks would help issues (at least to make some of the streets crossable) and enforcement on the late-at-night dragsters that wake people up at all hours and scare the crap out of other pedestrians, jaywalking or no. Also, during the winter, it'd be nice if there was a bit more effort to make some of the sidewalks walkable instead of just plowing the snow over the sidewalks (I know that the traffic is more important but at least people should coordinate their efforts). Finally, it'd be great if there was some effort to educate the people who do drive in Stamford to be more respectful towards the walking set, as they do move a lot slower and are easier to dent.

In short, I do agree that Stamford is a great walking town. It'll just take a little more effort from the city to make it into a safe walking town.

Saturday, August 16, 2008

Making some periodic life changes to break periodic behavior...

It's not as contradictory as it sounds. :)

So about the middle of August every year, I start to do an upheaval of my life from the bottom up. I realized this when I though about the last time I tried to enact life changes and it was about the same time as last year. It's like a second resolution phase for me. I think the most common reason is that this is when I realize that more than half of the year is up and I have a lot to do to keep pace. Oddly enough my August resolution phase is much more effective than my January one. I think that's because in August I know where I need to be for the rest of the year and am more motivated to take steps (motivation for me is much lower in the winter months).

I had wondered if this is the same for everyone as it is for me. Well, one of the most important lessons of life I've ever learned is that if you wonder about something and the answer can be looked up, look it up. So I did so, by googling for "most common month for life changes". I got three responses: most common month for weddings, births, and suicide. Those are some dramatic and disparate life changes.

Realizing that a month for life change probably hasn't been established (honestly expected it to be decided and that it'd be January), I decided to search for "most common month". This is the list of MCM's that I have determined:
  • Birth - October (by average) Source: WebMD
  • Weddings - June Source: ARA via
  • Suicide - April (but only by anecdote so I won't provide source)
  • Homicide - torn between June and July (again not agreed)
  • Poultry Food poisoning - December
  • Loss of virginity for teenagers - June
  • Car crashes - December
  • Arrested for DUI - October
  • Tornadoes - April
  • Pruning Grapes - March
  • Taking the SAT - June
  • Catching a cold - December
  • Catching the flu - February
  • Plowing (Ploughing!) - September
  • Lightning strikes in Florida - July
  • Divorce - January
  • Mating of Adders - April
  • Arson - May
  • Finding "crop circles" - July
And as far as resolutions? There are no stats. I guess it's a new field. There are actually a lot of "significant life events" that do not have an established month, and I guess that's good. Better for some things to remain random.

As for my life changes, the most crucial a bit too personal and I won't share them here. But one of the main ones is to consume food more healthily. I've depended too much on packaged food and fast food, and it's time for me to cook as many meals as I can, saving those meals where I eat splurgingly (spellcheck won't give me that word but I'll take it anyway) to be the meals I eat with others. Another is to get to bed at a more reasonable hour when I can (with work sometimes that is impossible). A third is to get into more social sports, such as baseball, tennis, and possibly handball, if the group that I'm organizing with will start moving on it.

I guess the key lesson here is to know when you're in a rut and try to break it, which I have started to do. Maybe if the world tried to do the same there wouldn't be a most common month for anything. I think maybe that'd be better for everyone involved.

Monday, August 11, 2008

At the airport...

Flying out of Stamford is a bit of a hassle. :) I try to reduce the hassle as much as possible. For those new to the city, let me review for you the choices you may have when leaving this fine city for JFK or LGA. (I disregard White Plains, even if it is more convenient. You simply cannot trust it to always be able to fly you where you want to go.)

In any event that you leave for JFK or LGA, plan to leave at least 3 hours before departure. The reasons will be most evident in a moment:

1) You can use the public transportation route to get to JFK/LGA. This is the cheapest route but the most time consuming. Both routes involve taking the Metro North to Grand Central. From there you can take a direct bus to either airport or use the public bus system to LGA or the subway to Penn Station/AirTran to JFK if you're really a cheapskate. Either route will take 2 hours if you get the express, 2.5 if you get the local. If you have a morning flight (<9 am) forget it; you won't make it in time.

2) Driving there yourself. This is a bit more expensive, and due to more exhorbitant fees for parking and the higher cost of gas, may not be the most economical for a long trip. Google lies and says that the trip takes 41 minutes for LGA and 50 minutes for JFK; however, traffic will double the length of time, although in the morning this is easily the fastest method.

3) Getting someone else to drive you. This is by far my preferred method. :) If you are without friends who will help you out (take the googled number in 2 and multiply by 4 and think again about asking a friend to drive that) then there are services that will drive you there and pick you up. I used to use CTLimo but now I use Red Dot because it's more convenient. Yeah it costs 60$ one way, but if you company compensates you this is a no-brainer, and it may be cheaper if your trip is longer than 2 days.

There you have it. The only ways to get to the major nearby airports guarantee that you will be travelling for at least 2 hours before you start travelling, or end up paying for the priviledge. Except for one amazing exception, I've never had problems with my flights. Feel free to send me whatever horror stories you have about your airport experience (especially if it was local so we can learn about it here :D) If I get enough responses, I may regroup them and publish for everyone to see, and in the process include my sole exception.

Thursday, August 7, 2008

On connections...

There are connections all around us! It makes our small world even smaller and more interesting. I'll now present two interesting anecdotes of this concept:

1) I have a new neighbor. Her renter's son's ex-girlfriend lives in the same complex and I used to work with the renter's son's ex at my previous job. After talking with her the other day, she told me that her second cousin also worked for the company that I work for now. My cubicle was across from his for six months and I had no idea.

2) Today the EPA rejected the bid by Rick Perry (Gov. Texas) to cut the ethanol subsidy. Ethanol is a curious connection between gas and chicken prices. Allow me to elucidate: Ethanol is used in 10% of gas, causing a drop in gas. It also causes a price increase in corn (heavily used in ethanol production), meaning that chickens (using corn as a food source) cost more for upkeep, meaning a loss of profit and a drop in the value.

James Burke is the undisputed master of such connections, and he had a series of shows (eponymously named) that dealt with these connections (if you haven't seen this series you must find a copy of it or look for it on PBS, it's really fascinating). He believes that the modern world would not exist without all these interconnections. There's also another cultural icon that relates to the concept of connections: six degrees of Kevin Bacon. The essence of this game is that through a series of movies less than six, link a named actor with Kevin Bacon. According to Wikipedia the game was invented by three snowbound college students, but the mathematics world did the same thing with Paul Erdos in 1969 and called it an Erdos Number.

The connotation that a connection usually "shrinks" the size of our perceivable universe is a quaint notion. I'm not sure how to prove it mathematically, because I'm not necessarily convinced that it's true. First we must define the domain of the problem. The closest concept to the "size of our percievable universe" is a diameter of a graph. A graph (our stand in for the universe) is a mathematical term for a diagram with vertices (points on a piece of paper, in our case people, places and things) and edges (lines connecting these points, or connections between people, places, and things). The distance between any two vertices of a graph is the number of edges in the shortest path connecting the two points. The diameter would then be the maximum distance between any two connected vertices.

Here's the crux of the reason why this problem (figuring the probability that a new connection "shrinks" the universe) may be hard. If you define that the distance between any two disconnected vertices to be infinite, the proof is trivial (and closer to human intuition), but this is a flawed assumption in an unbounded set of verticies (IE people, places and things will always be born, found, and created respectively, and new connections made between them, so the set of vertices between these "noun" vertices must be unbounded). It is more accurate to not consider unconnected people/places/things (vertices), meaning a new connection (edge) between them could concievably decrease the diameter of the universe (if the two people/places/things are already connected) or increase it (if the new edge connects two already well-connected "cliques" of people/places/things, such as the first contact between two cultures).

So keep in mind the connections that you make with other people. You may be making the universe larger or smaller as a result of your interaction. Whether or not that's a good or bad thing all depends on your outlook on life. Does it make you happier that we seem to live in a small world?

Edit: fixed an antecedent error in the first paragraph and removed an identifying marker.

Thursday, July 31, 2008

Now that's one way to lose those Facebook blues...

Wow, this is amazing. Ze Frank, master of The Show, Color Wars, and several other great internet art projects, has taken on a really interesting project. He assumed the identity of someone else's Facebook account. I'm not kidding, read about it here and here. It's kinda trippy and I think it's a great statement about the idea of an internet identity, how much time we put into our online persona, and the lack of freedom that results from said representation.

Tuesday, July 15, 2008

No choice but to trust?

This is a somewhat heavy post. I put it here to get it out of my head.

I am by nature a healthily paranoid person. I doubt because I've been deceived in the past. This means that my world view actually factors in a bit of disbelief into its model. At times this is unhealthy; a distrust of everything eventually dissolves into total self-delusion. Therefore it is important that we do trust, but that we are very careful over what to trust.

I bring this up because of multiple recent events, of which I'll only bring up one. I usually work with a news station playing in the background (this is a good strategy for web workers to allay some feelings of loneliness that can occur from working alone at home during the day). So I was watching CNBC in the background, when a news alert came in, it was a report about a judgment in favor of Boeing. That wasn't significant, what was significant was the fact that it looped. The lady was speaking, and suddenly the "feed" started looping, repeating the same 4 words over and over. They had to cut away until they fixed "the feed". It seems obvious to me anyway that the remark was pre-taped; what bothered me about this incident was that the reporter in the pre-taping was pretending to be speaking in real-time, with a quick cut-away at the end.

This brought to mind the scene in the movie THX1138 when the lady is reading the daily news on one of the hovering televisions only to have it loop, and everyone shrug it off. For those who haven't seen the flick, TXH1138 is a dystopian (lol the spell checker doesn't like that word, dystopian) movie by George Lucas about an underground consumerist culture that prays to wealth ("work hard, increase production, prevent accidents, and, be happy" is repeated over and over in the film as some unholy mantra). The move is pretty good for eschatologists like myself, but is only so-so in popular opinion. My point is that it's really depressing to see something in a dystopian movie happen in real life, and if concentrated upon it removes trust.

Trust is an important faculty in the human psyche. Without it we dissolve into insanity. Without it we cannot enjoy and participate in society. Without it no constructive thought can flourish. Trust must be placed in one's thought, one self, and in one's environment. Therefore, when I see CNBC loop like this I simply shrug it off. Not because it makes me doubt their honesty, but because I must extend my trust in order to be healthy. Extend by corollary: the concept of KISS and the belief against conspiracies must also follow from this premise in trust. Trust allows us to progress unhindered by doubt, and when it is betrayed it causes us to pause and perform cognitive dissonance. Trust assures us that many people out there aren't colluding to betray you. It removes paranoia.

I know all of this is obvious. Keep in mind that I'm a mathematician, and as such am distrustful of jumps in logic. My point that I'm getting to is that in order to survive, we have no choice as human being but to trust others, or to risk insanity, ostrichization, and oblivion. For some reason I felt it absolutely important to prove to myself this seemingly obvious fact. And it wouldn't have happened if CNBC weren't dishonest. It's a curious world when dishonesty spawns honesty.

Friday, June 27, 2008

Mysterious apartments and treasure hunts

Stories like these never fail to enchant me. Thank goodness there are more people out there in the world wanting to make life more enchanting. I may just leave a couple clues to the people who live in this apartment after me, but nothing so elaborate.

There are some people who know me through my persona firewall and would know that I love these kinds of treasure hunts. I have created seven of them in my lifetime, even though I only ran five of them and only three of those were solved (one was too hard and one didn't generate enough interest). I even got my pseudonym through the design of my second treasure hunt (the one I made too hard). When I was younger, I ran a few of them, and learned a lot of unique life skills and lessons through them, such as how to build puzzles backwards, how to keep people motivated to solve problems, and how to generate excitement. I even learned how to age paper in a microwave :D .

If you don't know what a treasure hunt would entail, you could go to the crappy Wikipedia page on the subject which I refuse to link to, or you could read about some real treasure hunts. The first one I was introduced to was the book Masquerade by Kit Williams. In it, people had to find a golden hare buried in the countryside, using a series of intricate clues hidden in ornate drawings masquerading as a children's book. It created quite a stir, with treasure hunters scanning the countryside and digging in many plots, some of them private property. Other puzzle books such as The Egyptian Jukebox and stories about fictional treasure hunts such as The Westing Game or Poe's The Gold-Bug fostered a desire to create one of my own.

My hunts were usually in a more linear fashion and involved more diverse puzzle solving aspects, some concepts of which I have liberally borrowed from books (I started one hunt with a puzzle very reminiscent of The Westing Game, where players had to match words together to get the next clue). There is a great movie about hunts of this fashion called Midnight Madness about the Luskin hunts in San Francisco. There are still a lot of groups out there that do these competitions and they pass the organization of these hunts to the people who solved the last one.

Nowadays the fashion has hit the web with the Alternative Reality Game, or ARG for short. An ARG would involve finding usually steagographed clues in web pages that would lead you to another clue with a hint that would make you find another hidden clue in an otherwise innocous site. TV shows have been using these to great effect; the ARGs for Lost (, Find 815) used these to great effect in order to enhance the viewing experience.

Seriously, I forgot how much fun it was to run treasure hunts. It's a bit harder nowadays, with Google making it that much easier to look up trivia and puzzles easily mined by properly written algorithms. I could get involved in one of the more recent hunts and maybe use that to get my feet wet again. According to the Wikipedia site on Luskin's hunts, there are three that are hosted in the NYC area, and summer is the right season for these kind of adventures. I'll have to check it out.

(PS -- I just found out that the draft system posts in a way that dated by the creation of the post, not when the post is complete... so this post is actually a duplicate. What a dumb system!)

Thursday, June 26, 2008

I can ride my bike with no handlebars...

but I didn't think that I could split the atom of a molecule, since a molecule needs at least two atoms in it.

Or so I thought!

It seems that there's a disagreement on the internets over whether or not a molecule needs two atoms or just one. Some pages have dodged the issue by just saying that a molecule has as few atoms in it to guarantee the chemical properties of that unit. Even Wikipedia splits hairs, saying in one sentence that a molecule needs two atoms, but recognizes that some gases may be formed from atomic divisions of an element and that each division is a single atom classified as a molecule (such as the molecules in a noble gas such as Krypton or Argon).

However, I just think that the Flobots just didn't understand the chemistry or deliberately manipulated the truth to sound better. In any event, the verse sounds better as "and I can split the atoms of a molecule, of a molecule, of a molecule", regardless of whether or not the author was trying to foreshadow nuclear war as it is in the end stanza of the song. It doesn't matter; the song still rocks, and the rest of their album is also pretty good.

Sunday, June 15, 2008

Long time no post...

...and this is where I pretend that I haven't been slacking for the last seven months. :D

Actually I have started a new job at TopCoder and that has been keeping me extremely busy. At the time that I post this, I'll have a few posts ready, so I will be posting regularly. Here it goes to posting regularly again.

Tuesday, January 1, 2008

Music and muses...

I just saw this utterly beautiful video on the Fred and thought I'd pass it along. A little early for Valentine's Day, but for some reason this is the right song at the right time for me. The song was done by Amplifico, and they have more songs and an album release real soon, but to download the songs you have to register (might not be a bad idea, but I'm always cautious about such things). I will be writing a post soon about muses, because I saw this really great exhibit at the Met with my sister during the holiday where the muses and sirens in this piece were competing. I didn't know the siren myth at the time; it's interesting to note that while the sirens are cursed for they transgression in believing that they could compete with the muses, they were put up to it by Hera, so the whole thing is just another cruel joke the muses and the gods play. Short end of the story, our muses are not always on our side. It's a good thing to know, and I'll elaborate tomorrow.

Happy new year!

My resolutions this year are taking a new tack... I already blogged about this earlier in December, and I'm still deciding on which ones to do. I am limiting myself this year instead of going hogwild but I will still be maintaining my 43things account to keep in touch with the long term goals. My New Years celebration was wonderful yet ultimately tiring. I will write more about it tomorrow, but for now I need time to recover from the craziness that was this holiday season. :D