Thursday, April 18, 2013

The post below is the title

The title above is the post

Sunday, February 10, 2013

Yet another Chinese Chess Match

I've no idea why, but I'm by far more likely to post a chinese chess match score on here than an international chess one. But I assure you this was completely trolling a weaker opponent.


START{
 1. C2.5 c8.5   2. C5+4 a6+5   3. H2+3 h8+7
 4. C5-2 r9.8   5. C8.5 h2+3   6. P7+1 h7+5
 7. H8+7 c5+3   8. P5+1 e7+5   9. P5+1 h5+7
10. P3+1 h7+5  11. H3+5 h5+7  12. H5+6 h7+5
13. E7+5 h3-2  14. R9.8 c2.4  15. P5+1 h2+1
16. H6+8 c4.2  17. H8-9 c2.4  18. H7+6 r8+4
19. R8+7 p1+1  20. H9-7 h1+2  21. P7+1 h2+3
22. P7+1 r8.4  23. H6-4 c4+7  24. R8-7 c4.6
25. K5.4 h3+4  26. K4.5 h4+2  27. E5-7 h2-3
28. E3+5 r4+5 }END

Saturday, February 9, 2013

Up Goer Five

I suffered at its hands, anything more to say?


'Singapore' is a small state city at an end of 'Asia', which is a really big piece of land. Actually, 'Asia' is the biggest land in this world.

Although 'Singapore' is so small, it is a very interesting place with many different things to do. One of these things to do is to eat many different kinds of food. Because of the many different kinds of people living in one small state, they usually change each other in small ways, and one of the changes is in the way we make our food. Because the set of people can't be exactly found in another place, the food that we make can't be exactly found in another place as well. People who live in 'Singapore' think that food is one of the things that make it a better place to live in.

Another thing good about 'Singapore' is the green all around us: leaves on trees, leaves coming straight from the ground. The green is all around, no matter where you go. All this is part of a plan to make it a "Clean and Green" place to live in.

However, all these are just about things that we can see and touch. There is more to the city state than all these; there are some things that you can't see, hear or touch, no matter how hard you try, like the state of being happy or sad. There is a sense that people living there are all the same in some areas, like having the same past. I think it goes past that, and most people who live there also have the same dream. As such, they work together to make the dream come true. This is shown by having a set of words people accept as true and so say it together, and it is called the 'Pledge'. What it says is something like:
We live in 'Singapore'. We will be one people, no matter our race, our tongue or our gods. We will build a 'Singapore' that gives all the people the same power to give power to other people who will have power and work for them. It will give everyone the same start, and it will be just, so as to make the people happy, well off, and be able to move on.

Needless to say, I scammed, not just with the '' syntax, I believe that's fine because I explained the terms within, but the true scam was with the different senses of the word. Eg. Leaves and Just.

Friday, January 11, 2013

Uncertainty

This blog post is just a poke at the uncertainty theory learnt in school, so...

Student A is a studious physics student, and thinks about physics even after school (shock!). In fact, the very moment he noticed that there was a newly installed solar panel installed at the side of the hill near his home, he decided that it would be great to calculate its power output, and put his knowledge of uncertainties to the test as well!

Via a protractor-bob improvisation, he manages to guess the slope of the solar panel via triangulation. However, as he is lazy to climb the hill, the way he derives the length of the solar panel is via subtracting the height of the lower edge of the panel from the height of the top (using a map to measure the distance from his house to the panel). As a result, the uncertainties are not exactly small, and he estimates the length of the (square) solar panel at 12 meters plus or minus 5 meters.

Using that value, he calculates the area of the solar panel.

Following that, he realises that the amount of sunlight received is somewhat unknown to him, due to poor geographic knowledge of his own surroundings. As such, he decides that the intensity of sunlight would nominally be pegged at 1000W/m^2, give or take 100W/m^2.

Lastly, he realises that he does not know the efficiency of the solar panel. Through internet research, he pegs it at 15% plus or minus 3% (i.e. 12% to 18%).

Finally, he computes his answer, and is feeling extremely satisfied with himself... until he calculates the uncertainty. He then concludes that he made a mistake somewhere in his calculations and goes back to clearing his usual piles of homework.

Friday, January 4, 2013

Valuations in Chess Speed (Where 'Speed Chess' barely does justice to the speed)

After a hiberation, a slumber, a hiatus, a timeless lullaby,
Bright sparks flew, entropy increased, and chaos streaked the sky;
This poem heralding the surreptitious reanimation of chess on this blog is brought to a rhymeless, rhythmless end upon the author realising how meaningless it might get if he tried to keep it up.

     Anyway... this blog post seeks to describe the valuation of pieces in bullet chess, described in the title as Chess Speed (no, Speed Chess doesn't do enough glory to the speed in it; it's like calling Chicken Chops Chops Chicken: just getting the order of importance wrong in the particular context).



     Firstly, let us talk about how computers evaluate a position. Rybka pseudo-famously evaluated position X as +1.47. What does this mean? It means that Rybka believes that objectively, there is an advantage due (by convention it is in general...) White worth the equivalent of 1.47 pawns randomly thrown onto the board in a generic otherwise equal position. Messy? Not quite. Unintuitive about the 0.47 pawns hanging in limbo? Perhaps. A third question necessary to complete the triad? (What was the word again??) Definitely not.

     And what might the significance of such a wispy number detailing non-integer, but nevertheless rational approximations of expected multiples of quantum superpositions of pawns on arbitrary expectations of generic boards be? (Note: expression might not make complete sense) Well, to me, the main significance, and the reason why we find joy and pride in the construction of a program able to derive the aforesaid wispy number from an arbitrarily set up board, is that it can be easily interpreted, with a simple function, the probability the said position is winning for White (or Black).

     If my memory serves, and as I remember it does, a +1 evaluation on Rybka means that on average, Rybka has a 95% chance of winning the position against perfect non-antagonistic play. So let's use half that yardstick, and declare a statistical +1 to be vaguely equal to that which gives me the same probability of winning as that closed integral up till 1 standard deviation after the mean of a normal distribution. Basically an arbitrarily, unnecessarily complicated definition of an imprecise yardstick, because. Ah well, this is an inexact science after all riiight?

     So to start of with a simpler to understand idea, I am playing at approximately a 1450 playing strength according to the chess.com bullet rating, which is rather inflated at lower levels I believe. As a yardstick, I believe that when playing opponents of slightly weaker strength (circa 1350), I tend to hang a piece for absolutely no reason about 1 in 3 matches, counting mostly those I notice after browsing through the match afterward.

     Hence, it may come as no surprise that I estimate that for me, a knight or a bishop can be evaluated, in the abovementioned badly designed scale, to be a +0.5. That means, if I am up a bishop or a knight for nothing, I am expected to get about 0.69 points from the match... against an opponent of my playing strength.

     Time to bring out the table of values... (justification later)

Knight -- 0.5
Bishop -- 0.6 early game, 0.4 if diagonal is blocked by pawns, 0.5 in general
Pawn -- 0.2 in early game, 0.15 in mid game 0.25 in endgame
Rook -- +0.7 if won, -0.4 if lost in early game and 0.7 otherwise
Queen -- 1.5 until mid game, 1.2 in endgame.
Doubled pawns -- -0.05
Passed pawn -- 0.2+0.4/(5-turns to promote) in early to mid game, and pretty much unfixed in endgame
Kingdrift -- Hard to evaluate. Quite a lot.
Pawn towards center -- 0.06 per square
(total value of your remaining) Time -- -30/(seconds remaining)

     Attack is important. Most chess instructional manuals will tell you that, but in bullet chess, it is important both objectively as well as psychologically. We all know that one failed step in attacking may lose you the game, but it probably isn't until about 15 moves later when being down a queen really starts to make its full impact felt. That could take 10 seconds, or 17% of the game time (rounded up in full bias). On the other hand, a blunder allowing a mate in 1 could end in well... 1 move. By contrast, blundering in a defensive position feels a lot worse. People tend to be tempted into trying harder not to blunder in such situations, and hence play more passively and more slowly. Big exploit there. Hence, in general do try to attack, and try to make the attack last. Seek not to sac unsoundly and expend all your material *just* to drain 30 seconds of your opponent's time. 30 seconds is a lot to kill with when you are up a queen, 2 rooks and 2 minor pieces.

     Knights are sneaky. However, they are relatively equally sneaky throughout the game, awarding them 0.5.

     Bishops make your opponents feel insecure if you point them at your opponent's king, preferably with 2, so it's harder to clog both colours with pawn chains. As a crucial part of my playing psychology, I fully recommend it. However, bishops aren't as sneaky in endgames, so they tend to lose a little bit of value in endgames.

     Being up a pawn is important in the opening, both to make sure your opponent thinks that objectively he might actually be losing, and to possibly control 2 squares (preferably in the center). This 2 randomly chosen squares, if properly centralised, can mess your opponent's favourite developing squares with happiness-inducing probabilities.

     Rooks. I don't like using them in the mid game (hard to get out sometimes), and when I lose them it tends to mean that my opponent has just moved a knight about 5 steps before sending it into a corner. On average, this means my pieces are sufficiently more active than his to ensure good counterplay... on the KINGside. Also, it is arguably the most straightforward piece in game, in a game where confusion plays a huge part. *pause* But in an endgame it helps greatly to have your rook still in existence. Ah well...

     Queens are awesome. They are the easiest way to bruteforce out a mate in early to mid game. Without a queen it tends to be a lot harder and opponents unafraid. So even if it in actuality is useless in your lines to get out a blundered mate, do consider keeping it safe and aggressive-looking. They are rather straightforward in the endgame as well, in the sense that they are harder to use in the probably 15 seconds left than to defend against (probabilistically).

     Doubled pawns. A small liability. In case you Do get into an endgame.

     Centralisation of pawns: see argument about accidentally controlling key squares in the center.

     Passed pawns: the kind of pawns that can sneakily move up the board VERY VERY fast (since it's a fast game) and hence catch your opponent rather unawares. Works a surprising portion of the time, and it functions as if your opponent has a second king. Many players treat a queening like an immediate lost, and will take very definitive actions to stop it. Use this to drain time severely and get a strong endgame advantage, even if it means losing the pawn eventually.

     Finally, time, the ultimate killer, has an evaluation that doesn't need explanation. With this, I end my blogpost and wish everybody enough sense not to believe what I just wrote.

P.S.: It isn't Cohm-pleet nonsense. Much of it works in low-level practical play! To the best of my knowledge anyway.

   

Wednesday, January 2, 2013

A few mysterious definitions

Ch: English dialect for I
Chop: A downward cutting blow or motion, typically with the hand
Ho: A derogatory term for a woman/ imitation or representation of the sound of a deep laugh
Hop: Jump on one foot
Hops: 3rd person singular present tense of hop
Op: Operation
Ops: Operations

This is of course, very definitely not a representation or foreshadowing of things to come.

Sunday, November 25, 2012

Question! (And answer)

Notation:

!=     ------------>     not equal to (a relic from C++)
iff     ------------->     if and only if
||     ------>     modulus; the absolute value of.
-1     ------------>     This was supposed to be in superscript, but I can't find the how to make them appear.  Also used for footnotes.


Question:

Does there exist a function f(x) mapping from rational numbers to positive integers such that:
(1) f(x)=f(y) iff x=y
(2) For any given real R, there exists a rational number x such that e>|R-x|*f(x) for any e>0.

Notes about question:
1) Criteria (1) for f is basically constructing an ordering of the rational numbers.
2) It is relatively simple to construct an ordering of the rational numbers such that (2) is heuristically "probably true", but this is vague to define and prove. This is because for any e, the "area", including overlaps, containing the set of reals between x-e*f(x) and x+ e*f(x) goes to infinity as long as we have solutions for f(x)=N for any positive integer N.
(See http://en.wikipedia.org/wiki/Harmonic_series_(mathematics) .)



Solution:

Lemma 1: The above question is equivalent to the following question:


     Does there exist a function f(x) mapping from rational numbers in [0,1) to positive integers such that:
     (1) f(x)=f(y) iff x=y
     (2') For any given real R in [0,1), there exists a rational number x such that e>|R-x|*f(x) for any e>0.

Let f1 be one such function that satisfies (1) and (2') and in particular has an inverse 1.
Let f2(x-1) = f1(x), f3(x+1) = f1(x),
      f4(x-2) = f1(x), f5(x+2) = f1(x),
      ...etc.

Now we construct a function g(x) that also maps from rational numbers to positive integers, where g(x) is defined as follows:


f1-1(x) = g-1(2x-1)
f2-1(x) = g-1(4x-2)
f3-1(x) = g-1(8x-4)
and in general:
fk-1(x) = g-1(2^k * x - 2^(k-1)) for all values of x and k.

We notice that g-1(x) is taken from f1-1 if x=1 (mod 2), f2-1 if x=2(mod 4), etc., so g-1(x) is uniquely defined for all x.

Then g(x) satisfies conditions (1) and (2). 2

Using lemma 1, all that's left to do is construct one such f1.
This can be done as follows:

Construct a function h that maps from positive integers to rational numbers, where h(1), h(2), h(3),... are
-42, 0,     0, 1/2,     0, 1/2, 2/8, 3/8,     8/16, 9/16, 10/16, 11/16, 12/16, 13/16, 14/16, 15/16,     ...


Specifically, h(1) = -42 3, h(2) = 0+0*(1-0),

h(3) = 0+0*(1/2-0), h(4) = 0+1*(1/2-0), h(x)= 1/2+(x-5)*(1-1/2) for 5<=x<=8,

h(x)= 0+ (x-9) * (1/4-0) for 9<=x<=16, h(x)= 1/4+ (x-17) * (2/4-1/4) for 17<=x<=32,

... for 65<=x<=128,

h(x)= 0+ (x-129)* (1/8-0) for 129<=x<=256, ... etc.


where the underlining separates the definition of functions into recognizable groups. Furthermore, within each group as partitioned by the underlining, it is possible to bound the maximum |R-x|*h-1(x) by half. 4

f1-1 can be generated by taking the next nonrepeated term in the sequence of h(1), h(2),... etc.



That this is a valid assumption (because it relaxes the conditions) is left as an exercise to the reader.
2 Again left to an exercise for the reader. It's quite evident, but horrid to type out.
3 A null element for the sake of a convenient proof.
4 This is left as an exercise to the reader as well... nah just kidding, will hopefully post a somewhat rigorously written (and readable) proof at a later date.

Edit: A final note... it was a lot more readable from the luxury of a wide page, so perhaps one should try pasting it onto notepad with wordwrap.