You are currently browsing the monthly archive for August 2008.

Ahead of a cs class titled “Artificial Intelligence” that I will take in Winter, I’m learning Python. So, I thought, why not write Mines Ahoy in Python? It would require creating a GUI (I’m using the wxPython module for that) and using many of the language’s core features.  I’m going to give it a try. I can see that it will be substantially more complicated that writing Mines Ahoy as a javascript web application, mostly because I won’t be able to leverage the browser to draw the game and listen for events. Hopefully, wxPython will make that part not too much trouble. Perhaps I can implement some additional features as well, like a timer and high scores.

Updates after the break. Read the rest of this entry »

Depending on how experienced you are with minesweeper, this situation may not seem very difficult. It gave me a little pause, though. In the process of making this game, I have played it many times, but it’s interesting moments like this one that keep the game from being monotonous. Sudoku is ultimately a better pure logic game, in that it can provide a consistent level of difficulty. The random setup of a minesweeper-type game, by contrast, means that more interesting situations arise haphazardly (indeed, solvability is not assured), though adjusting the number of mines is a crude lever for changing the difficulty. The answer to whether or not there is a solution in this situation is after the break. Read the rest of this entry »

Mines Ahoy is now playable and pretty much done. It was a fun journey. Ironically, a month and a half ago, I chose this project because I thought it would be quick and easy. I was cloning an existing, relatively simple game, Minesweeper. Of course, I haven’t been working nonstop on this. More like three or so concentrated chunks of time. Some interesting problems came up, and there was plenty of the usual debugging frustration. Yet, somehow I am just completely sure that it was worth it. Which is sort of a different experience for me. Very enjoyable.

Updates related to ironing out bugs and other topics appear after the break. Read the rest of this entry »

I was reading xkcd last night (John has made me a fan). Then I found a youtube video of author of the comic, Randall Munroe, talking at Google (here). Donald Knuth was in the audience and asked a question. I had heard of Knuth before and knew he’s a big figure in computer science, so I went searching for a little more information about him. I noticed on his Wikipedia entry that he had a written a book related to surreal numbers, which I had never heard of. Intrigued, I discovered an introduction to the subject by a Danish IT consultant, Claus Tondering (here). Though he is not a mathematician, the document looks well written. There is also the wiki entry (here), of course, and this podcast featuring the inventor/discoverer of surreal numbers John Conway (here). In 1996, then high school student Jacob Lurie won an award for doing research on the subject (here).

I’ve only started reading Tondering’s introduction. The surreal numbers are an entirely different system from the reals we all know and love, built up from set theory. Their definition is very strange. A surreal number number consists of a pair of sets, a left set and a right set. These sets contain other surreal numbers. For a pair of sets to be well-formed and thus a surreal number, none of the surreal numbers in the right set can be less then or equal to any member of the left set. So what does “less than or equal to” mean for surreal numbers? To quote Tondering:  “A surreal number x is less than or equal to a surreal number y if and only if y is less than or equal to no member of x’s left set and no member of y’s right set is less than or equal to x.” So less or equal to is defined in terms of itself. How do we get anywhere with this? We need one surreal number to start off with, the surreal number with no elements in either its left or right set. After showing that the number is well-formed, call this zero and go from there.

Yikes, war has begun a mere two weeks before I was due on Georgian soil! Russia bombed military targets next to the airport I would have flown into outside of Tblisi. (Just search for “georgia” on Google News to find out more.) I was going there for a short study abroad program offered by UW (some info here and here). This is very unfortunate. I was looking forward to enjoying a supra (feast), meeting my host family, and seeing Georgia’s diverse landscapes and historical sites. Info on Georgian cuisine at Wikipedia and this ugly but informative site.

MR links to a Slate review of a cookbook on Chinese cooking of the non-Han variety, Beyond the Great Wall. On a related note, when I went to China two years ago for a study-abroad, I liked the Uighur food we had on several occasions more than the mainstream Chinese food. (It’s pronounced “wee-gur” as far as I know.) I remember dishes involving lamb, spices, yogurt, not drowning in oil… yum. Similar to Afghan food I’ve had here. Perhaps I didn’t have the best mainstream Chinese food (we spent most of our time in Beijing). I wonder where I could find Uighur food here in the US?

For a little context, here are the news results that came up for “Uighur” on google.

I try hard to be less biased against “weird” ideas (somewhat self serving since I have weird ideas), so I will bite a bullet and say that lawsuit gambling is a fabulous idea:

[L]et people risk their lawsuits, double or nothing. After that damaging party, you would write out a simple complaint, including who hurt you when and how, and then take this complaint to the official lawsuit randomizing office, who would then randomly declare it worthless (50% chance) or double it (50% chance). If your suit were doubled, and you took it to court and won, so that the court said your neighbor caused you $X in damages, they would really owe you twice $X. And if you gambled and lost your neighbor would get a record of this, to defend against your trying to sue again over the same complaint.

More generally, you could keep doubling your suit so that it is worth any power of two times $X, or nothing. So if you gambled your $50 party suit ten times, for a factor of 1024, then 1023 times out of 1024, you’d get nothing. But that last time you’d get a suit worth $51,200 if you won. Then it would be worth your while to actually go to court to win it. And since your neighbor would know this, they should want to settle rather than go to court. And since they know, before you gamble your suit, that this is a possibility, they should be willing to settle up front for near the $50.

The critical mechanism here is that litigants only pay the costs of conducting a lawsuit if their lawsuit is selected, and in this case their lawsuit is worth much more than it used to be.

I suspect that such lawsuits would probably need to have somewhat different rules than normal lawsuits, but I don’t know in what way. I will only add that I think lawsuit gambling would do a good job of replacing or augmenting lots of consumer and worker protection mechanisms such as class action lawsuits.

Before I talk about this, I should mention that I am not very knowledgeable about macroeconomics, and this idea may be old.

My friend Nick came up with, what seems to me, an extremely good stimulus mechanism for economic downturns. When economic downturns hit, instead of providing tax refunds, states temporarily cut their sales tax significantly.

The advantage that a sales tax holiday has over an income tax breaks is that sales taxes are consumption taxes, not income taxes. When people get a break in their income taxes, it is rational for them to save the extra income in order to spread the increased consumption out over a longer period. However, when people get a consumption tax holiday, it is rational for them to move future consumption into the present, as well as move the purchase of storable goods into the present. Thus a sales/consumption tax holiday would provide more concentrated stimulus than an income tax break.

A sales tax holiday would be broad based because it would apply to all transactions which are subject to sales tax. I don’t know much about stimulus economics, but this seems desirable as it is in tax economics.

Another advantage of a sales tax holiday is that it would be easy to make automatic, which is important for a stimulus mechanism, because special stimulus plans can take time to move through legislatures. I see two ways using a sales tax holiday as a stimulus mechanism could be automated:

  1. Tie the activation of the sales tax holiday directly to local macroeconomic conditions. For example, the sales tax holiday could be triggered if the unemployment rate falls below some critical threshhold (it could also be graduated).
  2. Tie the activation of the sales tax holiday to a Normative Prediction Market, that predicts what a specific council will, in the future, say should have happened right now (i.e. “There should have been a stimulus in August of 2008”). The committee would be a lot like the current committee that dates recessions, except that it would decide whether a stimulus was a good idea. You could alternatively simply use the committee for dating recessions; InTrade already has similar markets. The sales tax holiday would be whatever the market expectation value is for the recommendation, or when the probability of recession rises above some cutoff like 30%.

A number of states already have regular sales tax holidays, though these seem to me like a bad idea, since it is undoubtable distortionary. Some other people have also suggested using a sale tax holiday, notably the Missouri Lt. Governer called for such a simulus, and some states have extended their regular sales tax holidays.

Update: The Washington Post has noted that regular holidays have provided such a stimulus, though the holiday only applies to certain goods (link).

I recently discovered book price search engines, which retreive prices from a number of different online book retailers and list them for you in ascending order. This has saved me quite a bit of money on books.

There is a  variation in the prices returned, because not all search services search the same sites. I did a comparison between some of the many of book price search services and best best ones appeared to be BooksPrice and CampusI; sometimes BooksPrice was cheaper and sometimes CampusI was cheaper. It seems worthwhile to search both.

Price engines have the potential to commodify the market they operate in. Price search engines can reduce search costs considerably, making the market more competitive. The search engines are unlikely to capture the rents that book retailers reap because it will always be simple to go to the online retailer directly.

I think the reason that price search engines can work well here is because books have ID numbers (ISBN), which makes it easy to organize content from many different sites. Other markets, where products are not well identified probably cannot be commodified easily.

One negative impact of commodifying the online book retail market is that it would probably reduce the incentive for Amazon and similar sites to produce book reviews and other useful information about books.