From d873ed007eaf20b90ae5cee9a28c0567ea578083 Mon Sep 17 00:00:00 2001 From: Peter Norvig Date: Sat, 29 Oct 2022 13:12:24 -0700 Subject: [PATCH] Add files via upload --- ipynb/AlphaCode.ipynb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ipynb/AlphaCode.ipynb b/ipynb/AlphaCode.ipynb index 785de31..c08b7ee 100644 --- a/ipynb/AlphaCode.ipynb +++ b/ipynb/AlphaCode.ipynb @@ -164,7 +164,7 @@ "cell_type": "markdown", "metadata": {}, "source": [ - "Finally, here's a third version. It has a very straightforward approach: generate all possible output strings for the source, and then check if the target its one of the possible outputs. To generate output strings, scan left-to-right, and for every character consider both the possibility of typing the character and of replacing it by backspace, maintaining a set of all possible outputs at each step.\n", + "Finally, below is a third version. It has a very straightforward approach: generate all possible output strings for the source, and then check if the target its one of the possible outputs. To generate output strings, scan left-to-right, and for every character consider both the possibility of typing the character and of replacing it by backspace, maintaining a set of all possible outputs at each step.\n", "\n", "If this version of the program gives the same results as a more complicated version, that gives us added confidence that all the assumptions made by the complicated version are valid, because this version does not make those assumptions." ] @@ -182,7 +182,7 @@ " return target in possible_outputs(source)\n", "\n", "def possible_outputs(source: str) -> set:\n", - " \"\"\"All outputs that can be generated by \"\"\"\n", + " \"\"\"All outputs that can be generated by replacing characters in `source` with `backspace`.\"\"\"\n", " outputs = {''}\n", " for c in source:\n", " outputs = union({out + c, out[:-1]} for out in outputs)\n",