The basic reason for the complexity is of course "combinatorial explosion", the exponential increase in the number of prospective positions as more than one move into the future is considered. For example, assuming for simplicity 20 choices at each move, while the player "on move" has to decide between only 20, the player waiting has 400 different decisions to consider (until the first player moves), and the first player wishing to consider a mere two-move combination has to consider 8000 different move sequences. Of course "shortcuts" like rules of thumb and preemptive elimination of "obviously bad" moves are absolutely necessary for practical play, but shortcuts are just as obviously suscepible to error (exceptions). Even computers cannot deal completely effectively with the complexities.
Wednesday, July 12, 2023
e4, back to chess fundamentals
Chess is a bit of a philosophical paradox, simple in the basics (piece movements, rules) but intractably complex in gameplay. Every game, whether by rank amateur or grandmaster, is as unique as a snowflake (unless both players intentionally follow a previous published game or theory line all the way to the end). And yet at any given point during any game, the allowed moves are quite definite, of finite number (averaging something like 20 or 25 per move over the course of a game), and known to both players at all times.
Star Trek TOS Goodness, 23 A Taste of Armageddon
Eminiar VII, principal planet of star cluster NGC-321, is the destination. Immediately the conflict is set up: The Enterprise has been ordered to establish diplomatic relations, but Eminiar VII is sending Code 710, meaning under no circumstances should they approach the planet. Of course, we have a diplomatic ambassador on board, Fox, who orders Kirk to proceed anyway, risking interplanetary war. Oh well.
We get an exposition dump from Spock, learning that the last ship to visit this system, the U.S.S. Valiant, never returned and was considered lost in space. Leaving Scotty in command, Kirk beams down with Spock and a security team.
Escorted by Mea-3, they are led to the planetary council headed by Anon-7. Much exposition necessarily follows. They were warned away because of "the war" which has been going on "for five hundred years!". But ship's scanners show no evidence of any war. Long story short, they "fight" the war with neighboring planet Vendakar with computers only, without physical damage. But one to three million inhabitants per year voluntarily enter disintegration (death) machines if they are registered as casualties.And now the Enterprise, being in orbit, is also a "legitimate" war target, and wouldn't you know, just at this moment there happens to be an attack from Vendakar hitting both the city and the Enterprise. Oops. Everyone still aboard the Enterprise is registered as dead, and the landing party is taken hostage to ensure their cooperation in voluntary immolation of all other Enterprise personnel. Good luck with that!
Thus endeth the exposition.
The transition from exposition to development (complications) usually involves a scene of normalcy / pause / stasis / domesticity. This episode actually has two: 1) Kirk et al being confined as hostages, with some development as Mea-3 reveals that she has been declared a casualty, and 2) Scotty on the bridge, with some development as Anon-7 tries to fool him with a ventriloquism of Kirk's voice.
Chess Engine Paradox
There seems to be a paradox with regard to chess engine evaluations. Basically, 1) the deeper the depth of search, the better (more accurate) the engine evaluation, and 2) engine evaluations do not converge with depth -- going one ply deeper in search can completely overturn the previous evaluation. What does this mean?! Are evaluations completely meaningless ultimately, are evaluation only to be considered relative and not absolute at any fixed position, or are evaluations always a function of both depth and position? I suspect the latter, and thus that both of the others are also essentially true. Of what use are relative-only evaluations in comparing positions whose only common ancestor is horizon-effect distant?
Sunday, March 13, 2016
Star Trek TOS Goodness, 22 Space Seed
So wow, one of the best episodes of all. I place it #2 after City. One of only four episodes that had sequels made: Space Seed --> Wrath of Khan (film), The Cage --> The Menagerie, The Changeling --> The Motion Picture (film), The Trouble With Tribbles --> Trials and Tribble-Ations (Deep Space Nine).
This is a "wolf in sheep's clothing" episode, like Wolf in the Fold. Unlike Wolf, however, Space Seed has a beautifully slow reveal. Starting with the uncertainty over what they've even found. First, a derelict ship. Next, there are some life signs, but not human. Next, oxygen atmosphere automatically comes on. Next, per McGivers, it's a "sleeper ship" -- suspended animation -- very cool. Then, the leader's sleep unit automatically starts reviving him, starts to fatally fail, but his life is saved by Kirk's and McCoy's expertise, whew! Then, it takes a long time to even identify who Khan is. (No automatic facial recognition software in the future apparently.) Montalban's slow burn is also wonderful, culminating in "I intend to take this ship!" Yikes!
Also very well done is the emphasis on history, through the character of McGivers. The usual cheap shortcut is just to list off a series of historical items and tack on a fictional one or two at the end. In this case the fictional extrapolation is given to us in the flesh! And of course the intrigue is even richer when the fictional near-future has to do with Earth events -- a World War 3, eugenics.
And this ties right in to the great tug-of-war, again through McGivers, which is the central conflict of the story. First her bona fides as a professional and loyal crewmember are established when Kirk tries to reprimand her. But then the magnetism of Khan, and his cunning exploitation of her weakness for strong men, turn the tide so completely that she promises to do whatever he wants. By the way, a good, if extreme, depiction of the psychological dynamics of domestic violence. In the end, McGivers cannot tolerate the violence against others, and in particular against Uhura. Her loyalty re-emerges and she double-crosses Khan to save Kirk, asking only that Khan not be killed.
Per formula, Khan and Kirk have to have one final one-on-one hand-to-hand before Khan is finally subdued.
But then Kirk once again shows mercy, dropping all charges and planning to maroon Khan and all his people on an uninhabited planet, for them to tame. He even gives McGivers the choice to join them to avoid a court martial. She chooses to stay with her abuser I guess, gahh.
I noticed on this close viewing how rushed and sloppy the pacing got in the second part, the action part of the episode. There is even some tape or something visible on the floor of the sound stage, ahem, I mean hearing room.
Monday, August 17, 2015
Remiss
I have been remiss in blogging. I'd rather read other blogs than contribute my own I guess. Plus no one seems to be reading, so it's more like cloud storage of thoughts than communication. My subjects are pretty boring. Star Trek, Chess, math. If anyone does wish to correspond: youngjeffreyalan gmail com, and you know the punctuation...
Thursday, June 4, 2015
King's Gambit Theory with Stockfish
Following on from the earlier post on "fighting with Stockfish", I have some theory results in the King's Gambit.
Reminder of the project: a repertoire-for-black tree after 1.e4 e5 2.f4 exf4, up to three-deep for White based on Stockfish evaluations (top three, cutoff anything more than 0.5 worse than top result), one-deep for Black (my repertoire selection), moves 3 through 9.
That means 7 plies with up to 3 selections each, 3^7 = 2187 upper bound on number of potential lines (actually final positions) I need to look at. Big project, not done yet, but I do have some preliminary results.
The top line (main line, best for White) that I have evaluates at -0.25 and is 3.Nf3 d6 4.Bc4 h6 5.h4 Be7 6.d4 Nf6 7.Nc3 Nh5 8.Ne2 Nc6 9.Bxf4 Bg4.
The bottom line (worst for White) that I have, so far, is the very "rightmost" line in the tree as defined above, evaluating at -1.16, 3.Qf3 Nc6 4.Nc3 Nd4 5.Qd3 Qh4+ 6.Kd1 Ne6 7.Qf3 Bc5 8.Nge2 Nf6 9.d4 Nxd4 (10.Qxf4 Qxf4 11.Nxf4).
That's a lot of positions, in a narrower range of evaluations (under 1.0) than I would have expected. One metaphor I have for thinking about main lines (best play for both sides) is as walking the crest of a mountain ridge. Turns out that the top of the ridge is a lot flatter than I pictured -- there are a lot of lines theoretically drawn with best play.
Let's see how some theoretical lines stack up in this range. The seeming conventional-theory main line of the Fischer defense, 3.Nf3 d6 4.d4 g5 5.h4 g4 6.Ng1, comes in at -0.70, barely making the tree criteria (5.Qd3 and 5.h3 score better), with continuation 6...f5(!) 7.Bxf4 fxe4 8.Nc3 d5 9.Qd2 Ne7. (Fischer's own conclusion that 6...Bh6 gives White "no compensation" is maybe not so accurate in view of 6...Bh6 7.Nc3 Nc6 8.Qd3 with Nge2 coming, giving White control of f4 (and f5, f3, e4 and d5) and preparing O-O-O. Evaluation -0.27.)
How about the supposed recent recommendation (John Shaw's book; I don't have it) to play against the Fischer defense in "Quaade style"? This also doesn't make the tree criteria. Near as I can determine, the recommendation is 3.Nf3 d6 4.d4 g5 5.Nc3, to which Stockfish gives -0.70 with a nice counter 5...g4 6.Bxf4 gxf3 7.Qxf3 Nc6 8.O-O-O Qh4(!). In addition to Bg4, Black is also threatening Qxf4 and/or a Bh6 pin. And 8.Bb5 Qh4+ is only slightly better for White.
If Shaw meant 3.Nf3 d6 4.d4 g5 5.g3, that seems equally bad: 5...g4 6.Nh4 f3 7.Nc3 Bg7 8.Be3 Nc6 9.Qd2 Bd7, -0.70. Again, the "tree moves" after 3.Nf3 d6 4.d4 g5 are 5.Qd3, 5.h3, and 5.h4.
Caveat: none of these numerical evaluations is definitive. One discouraging result of this experiment so far is how fickle/unreliable the evaluations can be because of the horizon effect. My original main line preference after 3.Nf3 d6 4.Bc4 h6 was 5.d4 g5 6.h4 g4 7.Ng1 f3 8.gxf3 Be7 9.c3 Bxh4+ with only a -0.17 evaluation. It turns out that there is a Black error in this line that Stockfish didn't see. After 5.d4 g5 6.h4 Black should play 6...Bg7 instead. Stockfish thought that the liquidation 7.hxg5 hxg5 8.Rxh8 Bxh8 was good for White (-0.02) when it is actually better for Black, when examined at more depth: 9.Qd3 Nc6 (-1.07). The apparent king attack with 10.e5 is fully repelled via 10...Bg7 11.Qh7 Kf8 12.Qh5 Nh6, essentially tying up the queen with only two pieces.
So, in-depth theory still wins out over (shallow) computer evaluations. I still think this is a valuable experiment however.
On a practical note, I just had opportunity to use this experiment's data in an ICC tournament game when my opponent played the experiment's current main line, see above, only exiting the data at 8.Nd5 (data says 8.Ne2, 8.Qd3, 8.O-O). Unfortunately I did not find the winning plan after that -- Ng3 followed by c6 Nxe7 Qxe7. Still, very interesting.
Reminder of the project: a repertoire-for-black tree after 1.e4 e5 2.f4 exf4, up to three-deep for White based on Stockfish evaluations (top three, cutoff anything more than 0.5 worse than top result), one-deep for Black (my repertoire selection), moves 3 through 9.
That means 7 plies with up to 3 selections each, 3^7 = 2187 upper bound on number of potential lines (actually final positions) I need to look at. Big project, not done yet, but I do have some preliminary results.
The top line (main line, best for White) that I have evaluates at -0.25 and is 3.Nf3 d6 4.Bc4 h6 5.h4 Be7 6.d4 Nf6 7.Nc3 Nh5 8.Ne2 Nc6 9.Bxf4 Bg4.
The bottom line (worst for White) that I have, so far, is the very "rightmost" line in the tree as defined above, evaluating at -1.16, 3.Qf3 Nc6 4.Nc3 Nd4 5.Qd3 Qh4+ 6.Kd1 Ne6 7.Qf3 Bc5 8.Nge2 Nf6 9.d4 Nxd4 (10.Qxf4 Qxf4 11.Nxf4).
That's a lot of positions, in a narrower range of evaluations (under 1.0) than I would have expected. One metaphor I have for thinking about main lines (best play for both sides) is as walking the crest of a mountain ridge. Turns out that the top of the ridge is a lot flatter than I pictured -- there are a lot of lines theoretically drawn with best play.
Let's see how some theoretical lines stack up in this range. The seeming conventional-theory main line of the Fischer defense, 3.Nf3 d6 4.d4 g5 5.h4 g4 6.Ng1, comes in at -0.70, barely making the tree criteria (5.Qd3 and 5.h3 score better), with continuation 6...f5(!) 7.Bxf4 fxe4 8.Nc3 d5 9.Qd2 Ne7. (Fischer's own conclusion that 6...Bh6 gives White "no compensation" is maybe not so accurate in view of 6...Bh6 7.Nc3 Nc6 8.Qd3 with Nge2 coming, giving White control of f4 (and f5, f3, e4 and d5) and preparing O-O-O. Evaluation -0.27.)
How about the supposed recent recommendation (John Shaw's book; I don't have it) to play against the Fischer defense in "Quaade style"? This also doesn't make the tree criteria. Near as I can determine, the recommendation is 3.Nf3 d6 4.d4 g5 5.Nc3, to which Stockfish gives -0.70 with a nice counter 5...g4 6.Bxf4 gxf3 7.Qxf3 Nc6 8.O-O-O Qh4(!). In addition to Bg4, Black is also threatening Qxf4 and/or a Bh6 pin. And 8.Bb5 Qh4+ is only slightly better for White.
If Shaw meant 3.Nf3 d6 4.d4 g5 5.g3, that seems equally bad: 5...g4 6.Nh4 f3 7.Nc3 Bg7 8.Be3 Nc6 9.Qd2 Bd7, -0.70. Again, the "tree moves" after 3.Nf3 d6 4.d4 g5 are 5.Qd3, 5.h3, and 5.h4.
Caveat: none of these numerical evaluations is definitive. One discouraging result of this experiment so far is how fickle/unreliable the evaluations can be because of the horizon effect. My original main line preference after 3.Nf3 d6 4.Bc4 h6 was 5.d4 g5 6.h4 g4 7.Ng1 f3 8.gxf3 Be7 9.c3 Bxh4+ with only a -0.17 evaluation. It turns out that there is a Black error in this line that Stockfish didn't see. After 5.d4 g5 6.h4 Black should play 6...Bg7 instead. Stockfish thought that the liquidation 7.hxg5 hxg5 8.Rxh8 Bxh8 was good for White (-0.02) when it is actually better for Black, when examined at more depth: 9.Qd3 Nc6 (-1.07). The apparent king attack with 10.e5 is fully repelled via 10...Bg7 11.Qh7 Kf8 12.Qh5 Nh6, essentially tying up the queen with only two pieces.
So, in-depth theory still wins out over (shallow) computer evaluations. I still think this is a valuable experiment however.
On a practical note, I just had opportunity to use this experiment's data in an ICC tournament game when my opponent played the experiment's current main line, see above, only exiting the data at 8.Nd5 (data says 8.Ne2, 8.Qd3, 8.O-O). Unfortunately I did not find the winning plan after that -- Ng3 followed by c6 Nxe7 Qxe7. Still, very interesting.
Thursday, May 7, 2015
Star Trek TOS Patterns
As a long-time and repeat watcher of the Original Series episodes, I have noticed many a pattern of repeated ideas or themes. Let me see if I can enumerate some off the top of my head.
After watching the second (and series-winning) pilot, Where No Man Has Gone Before, the theme of Supermen and Gods just clobbered me over the head. Gary Mitchell (and Dr. Elizabeth Dehner) in that one of course. Then there is Khan Noonien Singh in Space Seed, Apollo in Who Mourns for Adonais, and Sargon's race in Tomorrow is Yesterday. I'm not talking about mere dictators nor special powers. Those are other themes. But Roddenberry obviously had a thing about men approaching godhood and/or the equivalent, gods being merely mortal. Notice that in each instance, the superman/god must be brought down by the end of the episode. Time to scan the episodes again and see if I missed any additional instances of this theme... I find no other direct instances. A weaker related theme does appear however: being (falsely) worshiped as a god. Apollo, in the past, is an instance of this. But there are several episodes depicting ongoing worship, the most representative episode being The Apple in which Vaal is worshipped. Of course in all instances the erroneous worship must be corrected somehow. The other instances I find are: The Paradise Syndrome in which Kirk is worshipped as the god Kirok, For the World is Hollow and I Have Touched the Sky in which The Oracle is worshipped, Bread and Circuses in which the slaves worship the sun/son (note: this is a special case), and And the Children Shall Lead in which Gorgan is worshipped by the children. The criterion "as a god" gets more tenuous however, which leads to a further list of episodes where there is a weaker version of the same dynamic, i.e. reverence rather than worship -- of Cochrane by The Companion in Metamorphosis, of the Holy Words in The Omega Glory, of The Book in A Piece of the Action, and maybe even of Gill in Patterns of Force, although I think we've crossed the line into "mere dictators" there. On an opposite tack, there are a couple of episodes where a feared entity is referenced as devilish -- the Horta in Devil in the Dark of course, but also the Doomsday Machine which Decker at one point describes as "straight out of Hell". And finally there are the mere references to the Bible or to gods which one might find in any series -- Whom Gods Destroy, The Way to Eden, Requiem for Methuselah, even the "delusions of godhood" reference in The Trouble With Tribbles and the "laws of God and men" in The Ultimate Computer.
Before moving on to dictators and special powers, I want to cover the even more dominant theme of Insanity. I don't know if Roddenberry had some special connection to or interest in mental health, or whether it was just a convenient route to increased drama. But there are a full two episodes set in mental asylums, and many additional characters depicted as literally insane. The episodes are of course Dagger of the Mind and Whom Gods Destroy. The individual characters are: Lenore Karidian in The Conscience of the King, Ben Finney in Court Martial, Lazarus in The Alternative Factor, Matt Decker in The Doomsday Machine, Richard Daystrom in The Ultimate Computer, Larry Marvick in Is There in Truth No Beauty?, Dr. Sevrin in The Way to Eden, and Janet Lester in Turnabout Intruder. There are several additional examples of temporary insanity: everyone in The Naked Time, McCoy in City, Spock in All Our Yesterdays. And if we relax to the milder mental abberations of obsession and the like: Kirk in Obsession and in A Private Little War.
Dictators
Special Powers
Subscribe to:
Posts (Atom)