Tag Archives: games

Difficult chess puzzles and on-line games

While I was writing my essay on the chess ratings formula, I recalled enjoying the occasional chess game, and joined Chess.com, an intern chess site with many features. In one month I have played 12 games against humans and 5 or so against the computer. It’s fun, and Chess.com gives me a rating of 1323. It’s my first rating, and though it’s probably only accurate to ±150, I find it’s nice to have some sense of where you are in the chess world. But the most fun part, I find, are the chess puzzles; see some below. At first I found them impossible, but after playing for a bit, the ideas began to resolve, and I began to solve some. There’re not impossible, just difficult, and they only take a couple of minutes each. If you guess my name, you could win a match.

White to move and win. I see it now, but didn’t originally.
White to move and mate in 2. Magnus Vs Sergey, 2016 World Championship Tiebreaker. I see it!
This is from redditt. It took me forever to see through this.
White to move and win. I see it, I think.
white to move and win in two. I see it!
white to move and mate (in one?). I see a slower mate.
Mate in 3. White to move. I see it.

Robert Buxbaum, January 22, 2021

A series solution to the fussy suitor/ secretary problem

One way to look at dating and other life choices is to consider them as decision-time problems. Imagine, for example that have a number of candidates for a job, and all can be expected to say yes. You want a recipe that maximizes your chance to pick the best. This might apply to a fabulously wealthy individual picking a secretary or a husband (Mr Right) in a situation where there are 50 male choices. We’ll assume that you have the ability to recognize who is better than whom, but that your pool has enough ego that you can’t go back to anyone once you’ve rejected the person.

Under the above restrictions, I mentioned in this previous post that you maximize your chance of finding Mr Right by dating without intent to marry 36.8% of the fellows. After that, you marry the first fellow who is better than any of the previous. My previous post had a link to a solution using Riemann integrals, but I will now show how to do it with more prosaic math — a series. One reason for doing this by series is that it allows you to modify your strategy for a situation where you can not be guaranteed a yes, or where you’re OK with number 2, but you don’t like the high odds of the other method, 36.8%, that you’ll marry no one.

I present this, not only for the math interest, but because the above recipe is sometimes presented as good advice for real-life dating, e.g. in a recent Washington Post article. With the series solution, you’re in a position to modify the method for more realistic dating, and for another related situation, options cashing. Let’s assume you have stock options in a volatile stock company, if the options are good for 10 years, how do you pick when to cash in. This problem is similar to the fussy suitor, but the penalty for second best is small.

The solution to all of these problems is to pick a stopping point between the research phase and the decision phase. We will assume you can’t un-cash in an option, or continue dating after marriage. We will optimize for this fractional stopping point between phases, a point we will call x. This is the fraction of guys dated without intent of marriage, or the fraction of years you develop your formula before you look to cash in.

Let’s consider various ways you might find Mr Right given some fractional value X. One way this might work, perhaps the most likely way you’ll find Mr. Right, is if the #2 person is in the first, rejected group, and Mr. Right is in the group after the cut off, x. We’ll call chance of of finding Mr Right through this arrangement C1, where

C1 = x (1-x) = x – x2.

We could used derivatives to solve for the optimum value of x, but there are other ways of finding Mr Right. What if Guy #3 is in the first group and both Guys 1 and 2 are in the second group, and Guy #1 is earlier in the second line-up. You’d still marry Mr Right. We’ll call the chance of finding Mr Right this way C2. The odds of this are

C2 = x (1-x)2/2

= x/2 – x2 + x3/2

There is also a C3 and a C4 etc. Your C3 chance of Mr Right occurs when guy number 4 is in the first group, while #1, 2, and 3 are in the latter group, but guy number one is the first.

C3 = x (1-x)3/4 = x/4 – 3x2/4 + 3x3/4 – x4/4.

I could try to sum the series, but lets say I decide to truncate here. I’ll ignore C4, C5 etc, and I’ll further throw out any term bigger than x^2. Adding all smaller terms together, I get ∑C = C, where

C ~ 1.75 x – 2.75 x2.

To find the optimal x, take the derivative and set it to zero:

dC/dx = 0 ~ 1.75 -5.5 x

x ~ 1.75/5.5 = 31.8%.

That’s not an optimal answer, but it’s close. Based on this, C1 = 21.4%, C2 = 14.8%, C3 =10.2%, and C4= 7.0% C5= 4.8%Your chance of finding Mr Right using this stopping point is at least 33.4%. This may not be ideal, but you’re clearly going to very close to it.

The nice thing about this solution is that it makes it easy to modify your model. Let’s say you decide to add a negative value to not ever getting married. That’s easily done using the series method. Let’s say you choose to optimize your chance for either Mr 1 or 2 on the chance that both will be pretty similar and one of them may say no. You can modify your model for that too. You can also use series methods for the possibility that the house you seek is not at the last exit in Brooklyn. For the dating cases, you will find that it makes sense to stop your test-dating earlier, for the parking problem, you’l find that it’s Ok to wait til you’re less than 1 mile away before you settle on a spot. I’ll talk more about this latter, but wanted to note that the popular press seems overly impressed by math that they don’t understand, and that they have a willingness to accept assumptions that bear only the flimsiest relationship to relaity.

Robert Buxbaum, January 20, 2020

A mathematical approach to finding Mr (or Ms) Right.

A lot of folks want to marry their special soulmate, and there are many books to help get you there, but I thought I might discuss a mathematical approach that optimizes your chance of marrying the very best under some quite-odd assumptions. The set of assumptions is sometimes called “the fussy suitor problem” or the secretary problem. It’s sometimes presented as a practical dating guide, e.g. in a recent Washington Post article. My take, is that it’s not a great strategy for dealing with the real world, but neither is it total nonsense.

The basic problem was presented by Martin Gardner in Scientific American in 1960 or so. Assume you’re certain you can get whoever you like (who’s single); assume further that you have a good idea of the number of potential mates you will meet, and that you can quickly identify who is better than whom; you have a desire to marry none but the very best, but you don’t know who’s out there until you date, and you’ve an the inability to go back to someone you’ve rejected. This might be he case if you are a female engineering student studying in a program with 50 male engineers, all of whom have easily bruised egos. Assuming the above, it is possible to show, using Riemann Integrals (see solution here), that you maximize your chance of finding Mr/Ms Right by dating without intent to marry 36.8 % of the fellows (1/e), and then marrying the first fellow who’s better than any of the previous you’ve dated. I have a simpler, more flexible approach to getting the right answer, that involves infinite serieses; I’ll hope to show off some version of this at a later date.

Bluto, Popeye, or wait for someone better? In the cartoon as I recall, she rejects the first few people she meets, then meets Bluto and Popeye. What to do?

With this strategy, one can show that there is a 63.2% chance you will marry someone, and a 36.8% you’ll wed the best of the bunch. There is a decent chance you’ll end up with number 2. You end up with no-one if the best guy appears among the early rejects. That’s a 36.8% chance. If you are fussy enough, this is an OK outcome: it’s either the best or no-one. I don’t consider this a totally likely assumption, but it’s not that bad, and I find you can recalculate fairly easily for someone OK with number 2 or 3. The optimal strategy then, I think, is to date without intent at the start, as before, but to take a 2nd or 3rd choice if you find you’re unmarried after some secondary cut off. It’s solvable by series methods, or dynamic computing.

It’s unlikely that you have a fixed passel of passive suitors, of course, or that you know nothing of guys at the start. It also seems unlikely that you’re able to get anyone to say yes or that you are so fast evaluating fellows that there is no errors involved and no time-cost to the dating process. The Washington Post does not seem bothered by any of this, perhaps because the result is “mathematical” and reasonable looking. I’m bothered, though, in part because I don’t like the idea of dating under false pretense, it’s cruel. I also think it’s not a winning strategy in the real world, as I’ll explain below.

One true/useful lesson from the mathematical solution is that it’s important to learn from each date. Even a bad date, one with an unsuitable fellow, is not a waste of time so long as you leave with a better sense of what’s out there, and of what you like. A corollary of this, not in the mathematical analysis but from life, is that it’s important to choose your circle of daters. If your circle of friends are all geeky engineers, don’t expect to find Prince Charming among them. If you want Prince Charming, you’ll have to go to balls at the palace, and you’ll have to pass on the departmental wine and cheese.

If you want Prince Charming, you may have to associate with a different crowd from the one you grew up with. Whether that’s a good idea for a happy marriage is another matter.

The assumptions here that you know how many fellows there are is not a bad one, to my mind. Thus, if you start dating at 16 and hope to be married by 32, that’s 16 years of dating. You can use this time-frame as a stand in for total numbers. Thus if you decide to date-for-real after 37%, that’s about age 22, not an unreasonable age. It’s younger than most people marry, but you’re not likely to marry the fort person you meet after age 22. Besides, it’s not great dating into your thirties — trust me, I’ve done it.

The biggest problem with the original version of this model, to my mind, comes from the cost of non-marriage just because the mate isn’t the very best, or might not be. This cost gets worse when you realize that, even if you meet prince charming, he might say no; perhaps he’s gay, or would like someone royal, or richer. Then again, perhaps the Kennedy boy is just a cad who will drop you at some time (preferably not while crossing a bridge). I would therefor suggest, though I can’t show it’s optimal that you start out by collecting information on guys (or girls) by observing the people around you who you know: watch your parents, your brothers and sisters, your friends, uncles, aunts, and cousins. Listen to their conversation and you can get a pretty good idea of what’s available even before your first date. If you don’t like any of them, and find you’d like a completely different circle, it’s good to know early. Try to get a service job within ‘the better circle’. Working with people you think you might like to be with, long term, is a good idea even if you don’t decide to marry into the group in the end.

Once you’ve observed and interacted with the folks you think you might like, you can start dating for real from the start. If you’re super-organized, you can create a chart of the characteristics and ‘tells’ of characteristics you really want. Also, what is nice but not a deal-breaker. For these first dates, you can figure out the average and standard deviation, and aim for someone in the top 5%. A 5% target is someone whose two standard deviations above the average. This is simple Analysis of variation math (ANOVA), math that I discussed elsewhere. In general you’ll get to someone in the top 5% by dating ten people chosen with help from friends. Starting this way, you’ll avoid being unreasonably cruel to date #1, nor will you loose out on a great mate early on.

Some effort should be taken to look at the fellow’s family and his/her relationship with them. If their relationship is poor, or their behavior is, your kids may turn out similar.

After a while, you can say, I’ll marry the best I see, or the best that seems like he/she will say yes (a smaller sub-set). You should learn from each date, though, and don’t assume you can instantly size someone up. It’s also a good idea to meet the family since many things you would not expect seem to be inheritable. Meeting some friends too is a good idea. Even professionals can be fooled by a phony, and a phony will try to hide his/her family and friends. In the real world, dating should take time, and even if you discover that he/ she is not for you, you’ll learn something about what is out there: what the true average and standard deviation is. It’s not even clear that people fall on a normal distribution, by the way.

Don’t be too upset if you reject someone, and find you wish you had not. In the real world you can go back to one of the earlier fellows, to one of the rejects, if one does not wait too long. If you date with honesty from the start you can call up and say, ‘when I dated you I didn’t realize what a catch you were’ or words to that effect. That’s a lot better than saying ‘I rejected you based on a mathematical strategy that involved lying to all the first 36.8%.’

Robert Buxbaum, December 9, 2019. This started out as an essay on the mathematics of the fussy suitor problem. I see it morphed into a father’s dating advice to his marriage-age daughters. Here’s the advice I’d given to one of them at 16. I hope to do more with the math in a later post.

A probability paradox

Here is a classic math paradox for your amusement, and perhaps your edification: (edification is a fancy word for: beware, I’m trying to learn you something).

You are on a TV game show where you will be asked to choose between two, identical-looking envelopes. All you know about the envelopes is that one of them has twice as much money as the other. The envelopes are shuffled, and you pick one. You peak in and see that your envelope contains $400, and you feel pretty good. But then you are given a choice: you can switch your envelope with the other one; the one you didn’t take. You reason that the other envelope either has $800 or $200 with equal probability. That is, a switch will either net you a $400 gain, or loose you $200. Since $400 is bigger than $200, you switch. Did that decision make sense. It seems that, at this game, every contestant should switch envelopes. Hmm.

The solution follows: The problem with this analysis is an error common in children and politicians — the confusion between your lack of knowledge of a thing, and actual variability in the system. In this case, the contestant is confusing his (or her) lack of knowledge of whether he/she has the big envelope or the smaller, with the fixed fact that the total between the two envelopes has already been set. It is some known total, in this case it is either $600 or $1200. Lets call this unknown sum y. There is a 50% chance that you now are holding 2/3 y and a 50% chance you are holding only 1/3y. therefore, the value of your current envelope is 1/3 y + 1/6y = 1/2 y. Similarly, the other envelope has a value 1/2y; there is no advantage is switching once it is accepted that the total, y had already been set before you got to choose an envelope.

And here, unfortunately is the lesson:The same issue applies in reverse when it comes to government taxation. If you assume that the total amount of goods produced by the economy is always fixed to some amount, then there is no fundamental problem with high taxes. You can print money, or redistribute it to anyone you think is worthy — more worthy than the person who has it now – and you won’t affect the usable wealth of the society. Some will gain others will lose, and likely you’ll find you have more friends than before. On the other hand, if you assume that government redistribution will affect the total: that there is some relationship between reward and the amount produced, then to the extent that you diminish the relation between work and income, or savings and wealth, you diminish the total output and wealth of your society. While some balance is needed, a redistribution that aims at identical outcomes will result in total poverty.

This is a variant of the “two-envelopes problem,” originally posed in 1912 by German, Jewish mathematician, Edmund Landau. It is described, with related problems, by Prakash Gorroochurn, Classic Problems of Probability. Wiley, 314pp. ISBN: 978-1-118-06325-5. Wikipedia article: Two Envelopes Problem.

Robert Buxbaum, February 27, 2019

The hard scrabble dictionary

The rules or Scrabble are unchanging and always changing. The general rule is that Scrabble allows the use of every common word in the English language. In practice, there are two or more dictionaries of words. One of these has virtually no abbreviations, only a few foreign-derived words, and only a select few offensive terms. It is this one, “The Official Scrabble Players Dictionary,” that determines play. You’ll need the other dictionary to look up swear words or secondary meanings, or find common abbreviations.

Words get removed from the scrabble dictionary when someone -- anyone might find them offensive.

Words get removed from the scrabble dictionary when someone — anyone might find them offensive.

Both of these dictionaries change on a regular basis, by the way. And this is as it should be, and both exist in both English and American versions. The common dictionary adds words slowly, as they come into use and drops them slowly as they fall out. The Scrabble dictionary changes fast and for no obvious reason, adding and removing words for political and social aspect and for improved playability (whatever that is). Thus there is little rhyme or reason to the additions or deletions. Four years ago some ten 4000 words were added, mostly unusual words, and many insult words were removed. When the dictionary was changed again in September of this year, players are not told of some changes, but for the most part, there no obvious way to guess. Several words that were offensive in the last version, now are not. Other words that were OK then are now removed as offensive. You’ll play a word you’ve used for years and be told that it is no longer valid. Or someone will use a word you’ve never seen, and never will see otherwise, and you’ll find it is valid. Words added this year include: OK (previously an abbreviation), zen (previously a foreign word), and sheeple (previously a portmanteau, non-word). Also, I’m happy to say, fuck (a welcome addition). I looked up a bunch of previously removed insult words, and find that goy and spic are back, but i find that negro is not.  There is no list in print that tells you what’s been added, and that’s not right. Some articles have a few examples of new words, and some claim to have a list, but clearly it’s only a small fraction of the real list. There is nothing like a full addition list that I could find.

I’ve a bigger gripe though against removed words, especially when they are common words made to disappear for political effect. The previous dictionary, 2014, removed spic, goy, goyim, and negro; that was not right. The current dictionary added back all but negro (check for yourself, here). The word is still in use, both verbally and in literature, and not particularly offensive, less offensive than spic, IMHO. The American Negro College Fund doesn’t seem to mind the word negro. Malcolm X didn’t either. No one tells you these words are gone; they just disappear in the night.

My opinion, such as it is. I’m asking Mattel, Hasbro, Colliers, and/or Merriam-Webster: allow in all normal words, despite the fact that several have implied insults, or real ones. AND PUBLISH A COMPLETE CORRECTIONS PAGE, you [non recognized word]. Thank you.

Robert Buxbaum, December 27, 2018.