Showing posts with label chess. Show all posts
Showing posts with label chess. Show all posts

Monday, October 4, 2010

transducer

i feel like on of the big new media memes is transduction.

For example convert stock market feeds into audio sounds, or convert twitter feeds into graphical visualization.

Data visualization and audio visualization are forms of transduction - translating from one form into another. The issue with transduction is how do we perform the translation. This is where the real art of data visualization or data sonification takes place. There are infinate numbers of ways to map the frequency of #brit on twitter to a visual cue. What signifies frequency (line size?), what signifies subject matter (color?), where do you place the visualization on the screen (existence in different social networks?). All of these are arbitrary and the criterion of success is how transparent the visualization is for understanding the data, or how aesthetically pleasing the result is.

I have been writing an application called doh rae tweet which lets you compose music via twitter. Here again the mappings are arbitrary. an 'A' is a note 'a', but a space is S (it could just be a space). The default time signature is 4/4 unless you start your tweet with something else like 8|8. and you adjust the beat of a note by + or - so A- (in 4/4) would be a half note. This is all arbitrary and it is not necessarily transduction but translation. Not transforming one type of thing into something else, but representing something (musical notation) in something else (140 characters on twitter) . In this way it is much more similar to writing a compiler than writing a data visualization.

However doh rae tweet can also can be used as a transduction engine. I can feed through random twitter feed and use the music compilation engine to hear what that tweet sounds like according to my 'compiler' Although it probably wont sound very nice. Most letters will not have an audio mapping. So for this sort of application I would want to replace my compiler or lexical engine with another. Ideally anyone could create their own mapping. I think it would be interesting to do this via a GUI and feedback loop so you could adjust your mappings visually as you hear the effects of your changes.

One final though - I also want to use this mapping for other notation schemes. One that seems a natural is chess. With the 8x8 chess board mapping to the diatonic scale. However, this too would need its own mapping. ( Also what do you play, to just play the chess piece that is moved - or all the chess pieces. ) I went online to see if anyone has attempted sonficiations of chess notation and found the following:

Halfbakery This has some links relating chess to music
Chess History A list of articles and historical documents connecting chess with music (not very informative but interesting from a historical standpoint).
Music and Chess A great website with all sort of information linking chess and music. I got this from that site: "The Oxford Companion to Chess is a comprehensive encyclopedia of chess. It contains articles on history, terminology, chess players, and the relationship between chess and other subjects such as music, art, theatre, literature and philosophy. Many of the terms listed in this book are also musical terms. For example, in chess, a person who creates puzzles and problems to be solved is called a composer, and two different sequences of moves that lead from one given position to another are said to be related by transposition. Some other terms that are used in chess and music are: play, piece, notation, score, tempo, theme, variation, development, minimal composition, round, major and minor, position, second, retrograde, mirror, attack, anticipation, phase and echo."

Wednesday, May 26, 2010

Gaming the System

I have a surefire way to beat the computer at chess - I make very convaluted moves that eats away at the computer's clock and then i win on time. (granted this strategy only works if you play timed games - I play with sigma chess.

This sort of win never feels satisfying. It feels like I cheated, like my win was not really a win. However, it is a win. I am using the computer's strength (reliance on search algorithms) against it. Were I playing a human, these moves would probably signal amaturish play and I would be swiftly beaten as my opponent changes gears and uses a different strategy (the strategy that defeats idiosyncratic chess players).

Winning is not a matter of degree it is a binary attribute. Either you win or you dont. You can have a better win. We may talk about perhaps a better win, a more elegant win, or a win with more points or something like that - but really these are just language games. You either win or you lose - everything else is superfluous to winning-ness. Winning is achieving something over another person according to certain rules.

So are there winners in life? In this I always think of Alan Watts - life is not a game where to goal is to get from a to b, but a dance or a symphony - and a dance or symphony really has no goal other to experience it. Winning only makes sense in a situation where there are rules - does life have rules? Life is just about existence.

I have been thinking about this idea of winningness in regards to one of the options strategies I trade. I have a few strategies that I use in different market conditions, but let me talk about one strategy where I trade various mean reverting stocks and try and anticipate pin action (pin action describes where the stock will end on options expriy day so that the most option holders to lose money). My algorithms are generally good at anticipating the pin, however they are bad at market timing (which means i have to deal with market to market loses sometimes until options expiry day which reduces my buying power)

In any case - I often feel like 'I win' when I successfully guess the pin and make money on my options (and dont have to deal with mark to market losses anymore) But is this really a win? For example, let me use aapl (which I dont use for my options strategy anymore but I used to) if I sell an aapl put (aapl is at 250) - 250 for $7 and my algorithm thinks the pin will be 250 than that $7 will go to $0 theoretically or probably $1.50. I will make $5.50. However in that time aapl may go down to 240 - that put will go up 10 bucks and I will carry a mark to market loss of $10. Now do I buy back the put as it goes down (for a loss) and then sell it again when it bottoms out (for more money)? Do I average in more puts when the cost goes up? Sometimes it pays to close out for a small loss and then get back in at a better price. Does this mean you lose?

Or for example - say if aapl 260 calls are $6. You can sell them and if aapl hangs out at 250 for a few days or even goes down, those may go down to $4. Should you buy them back then, as aapl will probably shoot back up above 250. and those calls may go to $7 (mark to market loses again). My pin algorithm says aapl will go to 250 so they will end up being probably 1.00, but you will have to deal with the mark to market losses

In any case - a win is not necessarily just picking the correct pin. The correct pin is like the perfect chess game. A noble ambition -but you dont need it to win, and it may end up hurting your game.

Monday, December 28, 2009

Opening of the Day

I am in the midst of going through old emails and returning to the git rapidsms hornet's nest - and decided to take a break and play some computer chess.


But Chess was depressing. Here I was thinking entering my middle game. Oooh I'm so clever pinning a bishop with my knights. Then out of left field - or B5 (to use funky chess notation) - the enemy queen swoops into my 2 rank (that is the rank with all the pawns).

I know I am a goner.

If the queen is in your pawn rank and you cannot take her out with a bishop or something then she will take all your pawns, and then your rook and then your soul (or just your king). I cant take the slaughter - and restart the game.

Ok this time I am black. I am going to mind-f@#$k the computer - even though the computer does not have a mind. I am going to mimic every move the computer makes until the endgame. The computer moves all the pawns to the 4th rank. The computer is a f#@$king idiot - I think. Perhaps my ELO (chess rating) has gone so low from forfeiting all my losing games - that the computer is on idiot level.

Now that I believe the computer believes that I suck at chess(which I do), I change my strategy. Ahh, I breath a sigh of relief. I dont have to go through all the permutations of every movie and can just play. Sadly again the queen swoops into my pawn row and takes what little pawns I have left - with my rook and has a very funky mating procedure with the knights.

I need to do something about sucking at chess. Perhaps I should play some people - maybe I can beat them. Sadly my online chess membership has lapsed. Instead I visit chessgames.com and look at the opening move of the day and the opening game of the day.

The opening of the day is something called the Caro Kann Defense Steinitz Variation. The salient feature seems to be - the knight in front of the king and opening black pawn at c6. Chessgames asks if I would like to play a game using this opening. Dont mind if I do - and I am swiftly knocked in the 2 rank by the queen - Sheesh. What the hell is the point of this opening - and after googling - I find some answers for the Caro Kann defense but not the steinitz variation. There is a little paper that promises to help me in my goal of maximum procrastination and increased knowledge of caro kann - " In Xanadu did caro kann...." It seems Caro-Kann helps black develop a good pawn structure without contesting the middle. It is an explanation that makes no sense outside the context of chess theory - which is a tangent to a footnote to a conversation between heraclitus and Parmenidies annoated by Whitehead. (and reminds me of all the Foucault and discourse I have been reading for a possible doc on the history of madness and the leather clad philosophers who write about it).

But really, why do I suck at chess? I am generally good at boardgames? I dont suck at chess, so much as I cannot crack it. I cannot game the chess game. In other games such as Settlers of Catan, hearts, or even backgammon - I feel that there are weaknesses that I can exploit.

What is this weakness? Chance. I can only play games with dice rolls, or handicaps- even if I am handicapped. I can only play games that involve luck or chance. And I think this is because I am able to work very well with incomplete information, and because chance invigorates rather than depresses me - even if chance deals me a bad hand. In chess, everything is manifest -there is no chance - and if you are playing the game because you hope your opponent messes up (chance) - you are playing incorrectly. I am constantly telling myself in games and in life "act dont react". In games of chance you are constantly reactingand perhaps I am a better reactor than an actor. (depresssing ?) I also think that once I make a strategy unless I am obviously disturbed by say the capture of a piece - I tend not to notice the other player's strategy and barrel through until the enemy's queen is bayonetting my little pawns.

The one thing I can do is beat computer chess on time - that is the computer uses up all its time trying to come up with moves. My strategy is to make good but convaluted moves that forces the computer to use many cpu cycles and search many nodes in its internal combinatorial chess graph to find the optimum next move. With this strategy - I believe I could become a grandmaster but only against a computer. This feels dishonest and cheating - it does not give you that chess pleasure of figuring out the right move - it does not make a you a clearer thinker. I can use this strategy against a computer, but not against a human. And lo the day when I am to be pitted against a human - his motherboard will not fry when confronted with a bizarro move - instead he will move his queen to my 2 rank and wonk my pawns on the head.

Maybe I should code some more - a strategy game where there is no opponent.