Update Diamonds.ipynb

This commit is contained in:
Peter Norvig 2023-05-16 09:25:05 -07:00 committed by GitHub
parent 05110f351f
commit 9d0abf8593
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -9,7 +9,7 @@
" \n",
"# Wei-Hwa's Diamond-Buying Game \n",
"\n",
"Wei-Hwa Huang writes: \"*You are playing a game where you are trying to buy diamonds with coins. You can buy a random bag of diamonds for 12 coins, look in the bag, and [immediately] decide whether to sell it back for 11 coins or keep it. You can also purchase a bag for 1 coin but you **must** sell it back for 1 coin (i.e., you can basically figure out the distribution [by peeking at multiple bags for free]). What is a general strategy for maximizing the number of diamonds you keep (that is, total number of diamonds in bags not sold back)? Include analysis of end cases (e.g., if you spend your last 12 coins, it is never a good idea to sell the bag back).*\n",
"Wei-Hwa Huang writes: \"*You are playing a game where you are trying to buy diamonds with coins. You can buy a random bag of diamonds for 12 coins, look in the bag, and [immediately] decide whether to sell it back for 11 coins or keep it. You can also purchase a bag for 1 coin but you __must__ sell it back for 1 coin (i.e., you can basically figure out the distribution [by peeking at multiple bags for free]). What is a general strategy for maximizing the number of diamonds you keep (that is, total number of diamonds in bags not sold back)? Include analysis of end cases (e.g., if you spend your last 12 coins, it is never a good idea to sell the bag back).*\n",
"\n",
"## Strategy\n",
"\n",