From: Neil Smith Date: Thu, 29 Jun 2017 20:22:42 +0000 (+0100) Subject: Minor changes X-Git-Url: https://git.njae.me.uk/?a=commitdiff_plain;h=130c870164e49bc33d63a887ecbaee95e4fa9997;p=ou-summer-of-code-2017.git Minor changes --- diff --git a/09-resolving-the-bill/interleaving.ipynb b/09-resolving-the-bill/interleaving.ipynb index e115998..26ebb46 100644 --- a/09-resolving-the-bill/interleaving.ipynb +++ b/09-resolving-the-bill/interleaving.ipynb @@ -19,7 +19,7 @@ }, { "cell_type": "code", - "execution_count": 6, + "execution_count": 1, "metadata": { "collapsed": true }, @@ -31,7 +31,7 @@ }, { "cell_type": "code", - "execution_count": 139, + "execution_count": 2, "metadata": { "collapsed": true }, @@ -46,7 +46,7 @@ }, { "cell_type": "code", - "execution_count": 8, + "execution_count": 3, "metadata": {}, "outputs": [ { @@ -55,7 +55,7 @@ "[(0, ''), (1, 'a'), (2, 'aa'), (3, 'aab'), (4, 'aabc'), (5, 'aabcc')]" ] }, - "execution_count": 8, + "execution_count": 3, "metadata": {}, "output_type": "execute_result" } @@ -73,7 +73,7 @@ }, { "cell_type": "code", - "execution_count": 9, + "execution_count": 4, "metadata": {}, "outputs": [ { @@ -87,7 +87,7 @@ " [False, False, False, False, False, False]]" ] }, - "execution_count": 9, + "execution_count": 4, "metadata": {}, "output_type": "execute_result" } @@ -100,7 +100,7 @@ }, { "cell_type": "code", - "execution_count": 10, + "execution_count": 5, "metadata": { "scrolled": true }, @@ -146,7 +146,7 @@ " (5, 5): False}" ] }, - "execution_count": 10, + "execution_count": 5, "metadata": {}, "output_type": "execute_result" } @@ -160,7 +160,7 @@ }, { "cell_type": "code", - "execution_count": 135, + "execution_count": 6, "metadata": { "collapsed": true }, @@ -174,7 +174,7 @@ }, { "cell_type": "code", - "execution_count": 136, + "execution_count": 7, "metadata": { "collapsed": true }, @@ -188,17 +188,17 @@ }, { "cell_type": "code", - "execution_count": 137, + "execution_count": 8, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ - "T . . . . .\n", - "T . . . . .\n", - "T T T T . .\n", - ". T T T . .\n", + ". . . . . .\n", + ". . . . . .\n", + ". . . . . .\n", + ". . . . . .\n", ". . . . . .\n", ". . . . . .\n" ] @@ -210,7 +210,7 @@ }, { "cell_type": "code", - "execution_count": 140, + "execution_count": 9, "metadata": {}, "outputs": [ { @@ -277,7 +277,7 @@ " (3, 3): (2, 3, 'b', 's1')}" ] }, - "execution_count": 140, + "execution_count": 9, "metadata": {}, "output_type": "execute_result" } @@ -330,8 +330,10 @@ }, { "cell_type": "code", - "execution_count": 83, - "metadata": {}, + "execution_count": 10, + "metadata": { + "collapsed": true + }, "outputs": [], "source": [ "def is_interleave(seq1, seq2, seq3, return_backpointers=False, return_table=False, debug=False):\n", @@ -404,7 +406,7 @@ }, { "cell_type": "code", - "execution_count": 67, + "execution_count": 11, "metadata": {}, "outputs": [ { @@ -413,7 +415,7 @@ "True" ] }, - "execution_count": 67, + "execution_count": 11, "metadata": {}, "output_type": "execute_result" } @@ -424,7 +426,7 @@ }, { "cell_type": "code", - "execution_count": 71, + "execution_count": 12, "metadata": {}, "outputs": [ { @@ -448,7 +450,7 @@ " (5, 5): (4, 5, 'c', 'seq1')})" ] }, - "execution_count": 71, + "execution_count": 12, "metadata": {}, "output_type": "execute_result" } @@ -459,7 +461,7 @@ }, { "cell_type": "code", - "execution_count": 72, + "execution_count": 13, "metadata": { "scrolled": true }, @@ -521,7 +523,7 @@ " (5, 5): True})" ] }, - "execution_count": 72, + "execution_count": 13, "metadata": {}, "output_type": "execute_result" } @@ -532,7 +534,7 @@ }, { "cell_type": "code", - "execution_count": 17, + "execution_count": 14, "metadata": {}, "outputs": [ { @@ -541,7 +543,7 @@ "False" ] }, - "execution_count": 17, + "execution_count": 14, "metadata": {}, "output_type": "execute_result" } @@ -552,7 +554,7 @@ }, { "cell_type": "code", - "execution_count": 18, + "execution_count": 15, "metadata": {}, "outputs": [ { @@ -594,7 +596,7 @@ " (4, 3): (4, 2, 'b', 'seq2')})" ] }, - "execution_count": 18, + "execution_count": 15, "metadata": {}, "output_type": "execute_result" } @@ -605,8 +607,10 @@ }, { "cell_type": "code", - "execution_count": 109, - "metadata": {}, + "execution_count": 16, + "metadata": { + "collapsed": true + }, "outputs": [], "source": [ "def show_backtrace(bps):\n", @@ -627,7 +631,7 @@ }, { "cell_type": "code", - "execution_count": 20, + "execution_count": 17, "metadata": { "collapsed": true }, @@ -641,16 +645,16 @@ }, { "cell_type": "code", - "execution_count": 24, + "execution_count": 18, "metadata": {}, "outputs": [ { "data": { "text/plain": [ - "'abgdfggfabffcagcagdhaedeeecedcdbaeaahdfgegacbhbdba'" + "'gbbdffedehgebaaeghbggcfeegfaccdhaaaachhdhhchfcfdfb'" ] }, - "execution_count": 24, + "execution_count": 18, "metadata": {}, "output_type": "execute_result" } @@ -661,7 +665,7 @@ }, { "cell_type": "code", - "execution_count": 94, + "execution_count": 19, "metadata": { "collapsed": true }, @@ -702,64 +706,62 @@ }, { "cell_type": "code", - "execution_count": 142, + "execution_count": 20, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ - "0 0 0 adding d\n", - "1 0 1 adding v\n", - "1 1 0 adding v\n", - "1 2 -1 adding f\n", - "2 2 0 adding v\n", - "2 3 -1 adding w\n", - "2 4 -2 adding g\n", - "3 4 -1 adding y\n", - "3 5 -2 adding a\n", - "4 5 -1 adding w\n", - "4 6 -2 adding w\n", - "4 7 -3 adding w\n", - "4 8 -4 adding g\n", - "5 8 -3 adding h\n", - "6 8 -2 adding u\n", - "6 9 -3 adding v\n", - "6 10 -4 adding w\n", - "6 11 -5 adding f\n", - "7 11 -4 adding z\n", - "7 12 -5 adding f\n", - "8 12 -4 adding d\n", - "9 12 -3 adding x\n", - "9 13 -4 adding y\n", - "9 14 -5 adding g\n", - "10 14 -4 adding h\n", - "11 14 -3 adding u\n", - "11 15 -4 adding g\n", - "12 15 -3 adding b\n", - "13 15 -2 adding u\n", - "13 16 -3 adding z\n", - "13 17 -4 adding a\n", - "14 17 -3 adding u\n", - "14 18 -4 adding x\n", - "14 19 -5 adding a\n", - "15 19 -4 adding d\n", - "16 19 -3 adding g\n", - "17 19 -2 adding c\n", - "18 19 -1 adding x\n", - "18 20 -2 remaining s1 cg\n" + "0 0 0 adding u\n", + "0 1 -1 adding a\n", + "1 1 0 adding c\n", + "2 1 1 adding v\n", + "2 2 0 adding h\n", + "3 2 1 adding e\n", + "4 2 2 adding v\n", + "4 3 1 adding e\n", + "5 3 2 adding u\n", + "5 4 1 adding f\n", + "6 4 2 adding u\n", + "6 5 1 adding v\n", + "6 6 0 adding u\n", + "6 7 -1 adding x\n", + "6 8 -2 adding z\n", + "6 9 -3 adding u\n", + "6 10 -4 adding a\n", + "7 10 -3 adding e\n", + "8 10 -2 adding d\n", + "9 10 -1 adding h\n", + "10 10 0 adding v\n", + "10 11 -1 adding u\n", + "10 12 -2 adding h\n", + "11 12 -1 adding g\n", + "12 12 0 adding x\n", + "12 13 -1 adding e\n", + "13 13 0 adding f\n", + "14 13 1 adding w\n", + "14 14 0 adding y\n", + "14 15 -1 adding u\n", + "14 16 -2 adding d\n", + "15 16 -1 adding g\n", + "16 16 0 adding h\n", + "17 16 1 adding g\n", + "18 16 2 adding g\n", + "19 16 3 adding g\n", + "20 16 4 remaining s2 yyuz\n" ] }, { "data": { "text/plain": [ - "('dfgaghffdghgbaadgccg',\n", - " 'vvvwywwwuvwzxyuuzuxx',\n", - " 'dvvfvwgyawwwghuvwfzfdxyghugbuzauxadgcxcg',\n", + "('acheefaedhhgefdghggg',\n", + " 'uvvuuvuxzuvuxwyuyyuz',\n", + " 'uacvheveufuvuxzuaedhvuhgxefwyudghgggyyuz',\n", " 40)" ] }, - "execution_count": 142, + "execution_count": 20, "metadata": {}, "output_type": "execute_result" } @@ -773,7 +775,7 @@ }, { "cell_type": "code", - "execution_count": 143, + "execution_count": 21, "metadata": {}, "outputs": [ { @@ -781,473 +783,467 @@ "output_type": "stream", "text": [ "xxxx 0 0 ! ! ! True\n", - "seq2 0 1 ! d d True\n", - "seq2 0 2 ! f v False\n", - "seq2 0 3 ! g v False\n", - "seq2 0 4 ! a f False\n", - "seq2 0 5 ! g v False\n", - "seq2 0 6 ! h w False\n", - "seq2 0 7 ! f g False\n", - "seq2 0 8 ! f y False\n", - "seq2 0 9 ! d a False\n", - "seq2 0 10 ! g w False\n", - "seq2 0 11 ! h w False\n", - "seq2 0 12 ! g w False\n", - "seq2 0 13 ! b g False\n", - "seq2 0 14 ! a h False\n", - "seq2 0 15 ! a u False\n", - "seq2 0 16 ! d v False\n", - "seq2 0 17 ! g w False\n", - "seq2 0 18 ! c f False\n", - "seq2 0 19 ! c z False\n", - "seq2 0 20 ! g f False\n", - "seq1 1 0 v ! d False\n", - "seq1 1 1 v d v True\n", - "xxxx 1 2 v f v False\n", - "xxxx 1 3 v g f False\n", - "xxxx 1 4 v a v False\n", - "xxxx 1 5 v g w False\n", - "xxxx 1 6 v h g False\n", - "xxxx 1 7 v f y False\n", - "xxxx 1 8 v f a False\n", - "xxxx 1 9 v d w False\n", - "xxxx 1 10 v g w False\n", - "xxxx 1 11 v h w False\n", - "xxxx 1 12 v g g False\n", - "xxxx 1 13 v b h False\n", - "xxxx 1 14 v a u False\n", - "xxxx 1 15 v a v False\n", - "xxxx 1 16 v d w False\n", - "xxxx 1 17 v g f False\n", - "xxxx 1 18 v c z False\n", - "xxxx 1 19 v c f False\n", - "xxxx 1 20 v g d False\n", - "seq1 2 0 v ! v False\n", - "seq1 2 1 v d v True\n", - "seq2 2 2 v f f True\n", - "xxxx 2 3 v g v False\n", - "xxxx 2 4 v a w False\n", - "xxxx 2 5 v g g False\n", - "xxxx 2 6 v h y False\n", - "xxxx 2 7 v f a False\n", - "xxxx 2 8 v f w False\n", - "xxxx 2 9 v d w False\n", - "xxxx 2 10 v g w False\n", - "xxxx 2 11 v h g False\n", - "xxxx 2 12 v g h False\n", - "xxxx 2 13 v b u False\n", - "xxxx 2 14 v a v False\n", - "xxxx 2 15 v a w False\n", - "xxxx 2 16 v d f False\n", - "xxxx 2 17 v g z False\n", - "xxxx 2 18 v c f False\n", - "xxxx 2 19 v c d False\n", - "xxxx 2 20 v g x False\n", - "seq1 3 0 v ! v False\n", - "xxxx 3 1 v d f False\n", - "seq1 3 2 v f v True\n", - "xxxx 3 3 v g w False\n", - "xxxx 3 4 v a g False\n", - "xxxx 3 5 v g y False\n", - "xxxx 3 6 v h a False\n", - "xxxx 3 7 v f w False\n", - "xxxx 3 8 v f w False\n", - "xxxx 3 9 v d w False\n", - "xxxx 3 10 v g g False\n", - "xxxx 3 11 v h h False\n", - "xxxx 3 12 v g u False\n", - "xxxx 3 13 v b v False\n", - "xxxx 3 14 v a w False\n", - "xxxx 3 15 v a f False\n", - "xxxx 3 16 v d z False\n", - "xxxx 3 17 v g f False\n", - "xxxx 3 18 v c d False\n", - "xxxx 3 19 v c x False\n", - "xxxx 3 20 v g y False\n", - "seq1 4 0 w ! f False\n", - "xxxx 4 1 w d v False\n", - "seq1 4 2 w f w True\n", - "seq2 4 3 w g g True\n", - "xxxx 4 4 w a y False\n", - "xxxx 4 5 w g a False\n", - "xxxx 4 6 w h w False\n", - "xxxx 4 7 w f w False\n", - "xxxx 4 8 w f w False\n", - "xxxx 4 9 w d g False\n", - "xxxx 4 10 w g h False\n", - "xxxx 4 11 w h u False\n", - "xxxx 4 12 w g v False\n", - "xxxx 4 13 w b w False\n", - "xxxx 4 14 w a f False\n", - "xxxx 4 15 w a z False\n", - "xxxx 4 16 w d f False\n", - "xxxx 4 17 w g d False\n", - "xxxx 4 18 w c x False\n", - "xxxx 4 19 w c y False\n", - "xxxx 4 20 w g g False\n", - "seq1 5 0 y ! v False\n", - "xxxx 5 1 y d w False\n", - "xxxx 5 2 y f g False\n", - "seq1 5 3 y g y True\n", - "seq2 5 4 y a a True\n", - "xxxx 5 5 y g w False\n", - "xxxx 5 6 y h w False\n", - "xxxx 5 7 y f w False\n", - "xxxx 5 8 y f g False\n", - "xxxx 5 9 y d h False\n", - "xxxx 5 10 y g u False\n", - "xxxx 5 11 y h v False\n", - "xxxx 5 12 y g w False\n", - "xxxx 5 13 y b f False\n", - "xxxx 5 14 y a z False\n", - "xxxx 5 15 y a f False\n", - "xxxx 5 16 y d d False\n", - "xxxx 5 17 y g x False\n", - "xxxx 5 18 y c y False\n", - "xxxx 5 19 y c g False\n", - "xxxx 5 20 y g h False\n", - "seq1 6 0 w ! w False\n", - "xxxx 6 1 w d g False\n", - "xxxx 6 2 w f y False\n", - "xxxx 6 3 w g a False\n", - "seq1 6 4 w a w True\n", - "xxxx 6 5 w g w False\n", - "xxxx 6 6 w h w False\n", - "xxxx 6 7 w f g False\n", - "xxxx 6 8 w f h False\n", - "xxxx 6 9 w d u False\n", - "xxxx 6 10 w g v False\n", - "xxxx 6 11 w h w False\n", - "xxxx 6 12 w g f False\n", - "xxxx 6 13 w b z False\n", - "xxxx 6 14 w a f False\n", - "xxxx 6 15 w a d False\n", - "xxxx 6 16 w d x False\n", - "xxxx 6 17 w g y False\n", - "xxxx 6 18 w c g False\n", - "xxxx 6 19 w c h False\n", - "xxxx 6 20 w g u False\n", - "seq1 7 0 w ! g False\n", - "xxxx 7 1 w d y False\n", - "xxxx 7 2 w f a False\n", - "xxxx 7 3 w g w False\n", - "seq1 7 4 w a w True\n", - "xxxx 7 5 w g w False\n", - "xxxx 7 6 w h g False\n", - "xxxx 7 7 w f h False\n", - "xxxx 7 8 w f u False\n", - "xxxx 7 9 w d v False\n", - "xxxx 7 10 w g w False\n", - "xxxx 7 11 w h f False\n", - "xxxx 7 12 w g z False\n", - "xxxx 7 13 w b f False\n", - "xxxx 7 14 w a d False\n", - "xxxx 7 15 w a x False\n", - "xxxx 7 16 w d y False\n", - "xxxx 7 17 w g g False\n", - "xxxx 7 18 w c h False\n", - "xxxx 7 19 w c u False\n", - "xxxx 7 20 w g g False\n", - "seq1 8 0 w ! y False\n", - "xxxx 8 1 w d a False\n", - "xxxx 8 2 w f w False\n", - "xxxx 8 3 w g w False\n", - "seq1 8 4 w a w True\n", - "seq2 8 5 w g g True\n", - "seq2 8 6 w h h True\n", - "xxxx 8 7 w f u False\n", - "xxxx 8 8 w f v False\n", - "xxxx 8 9 w d w False\n", - "xxxx 8 10 w g f False\n", - "xxxx 8 11 w h z False\n", - "xxxx 8 12 w g f False\n", - "xxxx 8 13 w b d False\n", - "xxxx 8 14 w a x False\n", - "xxxx 8 15 w a y False\n", - "xxxx 8 16 w d g False\n", - "xxxx 8 17 w g h False\n", - "xxxx 8 18 w c u False\n", - "xxxx 8 19 w c g False\n", - "xxxx 8 20 w g b False\n", - "seq1 9 0 u ! a False\n", - "xxxx 9 1 u d w False\n", - "xxxx 9 2 u f w False\n", - "xxxx 9 3 u g w False\n", - "xxxx 9 4 u a g False\n", - "xxxx 9 5 u g h False\n", - "seq1 9 6 u h u True\n", - "xxxx 9 7 u f v False\n", - "xxxx 9 8 u f w False\n", - "xxxx 9 9 u d f False\n", - "xxxx 9 10 u g z False\n", - "xxxx 9 11 u h f False\n", - "xxxx 9 12 u g d False\n", - "xxxx 9 13 u b x False\n", - "xxxx 9 14 u a y False\n", - "xxxx 9 15 u a g False\n", - "xxxx 9 16 u d h False\n", - "xxxx 9 17 u g u False\n", - "xxxx 9 18 u c g False\n", - "xxxx 9 19 u c b False\n", - "xxxx 9 20 u g u False\n", - "seq1 10 0 v ! w False\n", - "xxxx 10 1 v d w False\n", - "xxxx 10 2 v f w False\n", - "xxxx 10 3 v g g False\n", - "xxxx 10 4 v a h False\n", - "xxxx 10 5 v g u False\n", - "seq1 10 6 v h v True\n", - "xxxx 10 7 v f w False\n", - "xxxx 10 8 v f f False\n", - "xxxx 10 9 v d z False\n", - "xxxx 10 10 v g f False\n", - "xxxx 10 11 v h d False\n", - "xxxx 10 12 v g x False\n", - "xxxx 10 13 v b y False\n", - "xxxx 10 14 v a g False\n", - "xxxx 10 15 v a h False\n", - "xxxx 10 16 v d u False\n", - "xxxx 10 17 v g g False\n", - "xxxx 10 18 v c b False\n", - "xxxx 10 19 v c u False\n", - "xxxx 10 20 v g z False\n", - "seq1 11 0 w ! w False\n", - "xxxx 11 1 w d w False\n", - "xxxx 11 2 w f g False\n", - "xxxx 11 3 w g h False\n", - "xxxx 11 4 w a u False\n", - "xxxx 11 5 w g v False\n", - "seq1 11 6 w h w True\n", - "seq2 11 7 w f f True\n", - "xxxx 11 8 w f z False\n", - "xxxx 11 9 w d f False\n", - "xxxx 11 10 w g d False\n", - "xxxx 11 11 w h x False\n", - "xxxx 11 12 w g y False\n", - "xxxx 11 13 w b g False\n", - "xxxx 11 14 w a h False\n", - "xxxx 11 15 w a u False\n", - "xxxx 11 16 w d g False\n", - "xxxx 11 17 w g b False\n", - "xxxx 11 18 w c u False\n", - "xxxx 11 19 w c z False\n", - "xxxx 11 20 w g a False\n", - "seq1 12 0 z ! w False\n", - "xxxx 12 1 z d g False\n", - "xxxx 12 2 z f h False\n", - "xxxx 12 3 z g u False\n", - "xxxx 12 4 z a v False\n", - "xxxx 12 5 z g w False\n", - "xxxx 12 6 z h f False\n", - "seq1 12 7 z f z True\n", - "seq2 12 8 z f f True\n", - "seq2 12 9 z d d True\n", - "xxxx 12 10 z g x False\n", - "xxxx 12 11 z h y False\n", - "xxxx 12 12 z g g False\n", - "xxxx 12 13 z b h False\n", - "xxxx 12 14 z a u False\n", - "xxxx 12 15 z a g False\n", - "xxxx 12 16 z d b False\n", - "xxxx 12 17 z g u False\n", - "xxxx 12 18 z c z False\n", - "xxxx 12 19 z c a False\n", - "xxxx 12 20 z g u False\n", - "seq1 13 0 x ! g False\n", - "xxxx 13 1 x d h False\n", - "xxxx 13 2 x f u False\n", - "xxxx 13 3 x g v False\n", - "xxxx 13 4 x a w False\n", - "xxxx 13 5 x g f False\n", - "xxxx 13 6 x h z False\n", - "xxxx 13 7 x f f False\n", - "xxxx 13 8 x f d False\n", - "seq1 13 9 x d x True\n", - "xxxx 13 10 x g y False\n", + "seq2 0 1 ! a u False\n", + "seq2 0 2 ! c a False\n", + "seq2 0 3 ! h c False\n", + "seq2 0 4 ! e v False\n", + "seq2 0 5 ! e h False\n", + "seq2 0 6 ! f e False\n", + "seq2 0 7 ! a v False\n", + "seq2 0 8 ! e e False\n", + "seq2 0 9 ! d u False\n", + "seq2 0 10 ! h f False\n", + "seq2 0 11 ! h u False\n", + "seq2 0 12 ! g v False\n", + "seq2 0 13 ! e u False\n", + "seq2 0 14 ! f x False\n", + "seq2 0 15 ! d z False\n", + "seq2 0 16 ! g u False\n", + "seq2 0 17 ! h a False\n", + "seq2 0 18 ! g e False\n", + "seq2 0 19 ! g d False\n", + "seq2 0 20 ! g h False\n", + "seq1 1 0 u ! u True\n", + "seq2 1 1 u a a True\n", + "seq2 1 2 u c c True\n", + "xxxx 1 3 u h v False\n", + "xxxx 1 4 u e h False\n", + "xxxx 1 5 u e e False\n", + "xxxx 1 6 u f v False\n", + "xxxx 1 7 u a e False\n", + "xxxx 1 8 u e u False\n", + "xxxx 1 9 u d f False\n", + "xxxx 1 10 u h u False\n", + "xxxx 1 11 u h v False\n", + "xxxx 1 12 u g u False\n", + "xxxx 1 13 u e x False\n", + "xxxx 1 14 u f z False\n", + "xxxx 1 15 u d u False\n", + "xxxx 1 16 u g a False\n", + "xxxx 1 17 u h e False\n", + "xxxx 1 18 u g d False\n", + "xxxx 1 19 u g h False\n", + "xxxx 1 20 u g v False\n", + "seq1 2 0 v ! a False\n", + "xxxx 2 1 v a c False\n", + "seq1 2 2 v c v True\n", + "seq2 2 3 v h h True\n", + "seq2 2 4 v e e True\n", + "xxxx 2 5 v e v False\n", + "xxxx 2 6 v f e False\n", + "xxxx 2 7 v a u False\n", + "xxxx 2 8 v e f False\n", + "xxxx 2 9 v d u False\n", + "xxxx 2 10 v h v False\n", + "xxxx 2 11 v h u False\n", + "xxxx 2 12 v g x False\n", + "xxxx 2 13 v e z False\n", + "xxxx 2 14 v f u False\n", + "xxxx 2 15 v d a False\n", + "xxxx 2 16 v g e False\n", + "xxxx 2 17 v h d False\n", + "xxxx 2 18 v g h False\n", + "xxxx 2 19 v g v False\n", + "xxxx 2 20 v g u False\n", + "seq1 3 0 v ! c False\n", + "xxxx 3 1 v a v False\n", + "xxxx 3 2 v c h False\n", + "xxxx 3 3 v h e False\n", + "seq1 3 4 v e v True\n", + "seq2 3 5 v e e True\n", + "xxxx 3 6 v f u False\n", + "xxxx 3 7 v a f False\n", + "xxxx 3 8 v e u False\n", + "xxxx 3 9 v d v False\n", + "xxxx 3 10 v h u False\n", + "xxxx 3 11 v h x False\n", + "xxxx 3 12 v g z False\n", + "xxxx 3 13 v e u False\n", + "xxxx 3 14 v f a False\n", + "xxxx 3 15 v d e False\n", + "xxxx 3 16 v g d False\n", + "xxxx 3 17 v h h False\n", + "xxxx 3 18 v g v False\n", + "xxxx 3 19 v g u False\n", + "xxxx 3 20 v g h False\n", + "seq1 4 0 u ! v False\n", + "xxxx 4 1 u a h False\n", + "xxxx 4 2 u c e False\n", + "xxxx 4 3 u h v False\n", + "xxxx 4 4 u e e False\n", + "seq1 4 5 u e u True\n", + "seq2 4 6 u f f True\n", + "xxxx 4 7 u a u False\n", + "xxxx 4 8 u e v False\n", + "xxxx 4 9 u d u False\n", + "xxxx 4 10 u h x False\n", + "xxxx 4 11 u h z False\n", + "xxxx 4 12 u g u False\n", + "xxxx 4 13 u e a False\n", + "xxxx 4 14 u f e False\n", + "xxxx 4 15 u d d False\n", + "xxxx 4 16 u g h False\n", + "xxxx 4 17 u h v False\n", + "xxxx 4 18 u g u False\n", + "xxxx 4 19 u g h False\n", + "xxxx 4 20 u g g False\n", + "seq1 5 0 u ! h False\n", + "xxxx 5 1 u a e False\n", + "xxxx 5 2 u c v False\n", + "xxxx 5 3 u h e False\n", + "xxxx 5 4 u e u False\n", + "xxxx 5 5 u e f False\n", + "seq1 5 6 u f u True\n", + "xxxx 5 7 u a v False\n", + "xxxx 5 8 u e u False\n", + "xxxx 5 9 u d x False\n", + "xxxx 5 10 u h z False\n", + "xxxx 5 11 u h u False\n", + "xxxx 5 12 u g a False\n", + "xxxx 5 13 u e e False\n", + "xxxx 5 14 u f d False\n", + "xxxx 5 15 u d h False\n", + "xxxx 5 16 u g v False\n", + "xxxx 5 17 u h u False\n", + "xxxx 5 18 u g h False\n", + "xxxx 5 19 u g g False\n", + "xxxx 5 20 u g x False\n", + "seq1 6 0 v ! e False\n", + "xxxx 6 1 v a v False\n", + "xxxx 6 2 v c e False\n", + "xxxx 6 3 v h u False\n", + "xxxx 6 4 v e f False\n", + "xxxx 6 5 v e u False\n", + "seq1 6 6 v f v True\n", + "xxxx 6 7 v a u False\n", + "xxxx 6 8 v e x False\n", + "xxxx 6 9 v d z False\n", + "xxxx 6 10 v h u False\n", + "xxxx 6 11 v h a False\n", + "xxxx 6 12 v g e False\n", + "xxxx 6 13 v e d False\n", + "xxxx 6 14 v f h False\n", + "xxxx 6 15 v d v False\n", + "xxxx 6 16 v g u False\n", + "xxxx 6 17 v h h False\n", + "xxxx 6 18 v g g False\n", + "xxxx 6 19 v g x False\n", + "xxxx 6 20 v g e False\n", + "seq1 7 0 u ! v False\n", + "xxxx 7 1 u a e False\n", + "xxxx 7 2 u c u False\n", + "xxxx 7 3 u h f False\n", + "xxxx 7 4 u e u False\n", + "xxxx 7 5 u e v False\n", + "seq1 7 6 u f u True\n", + "xxxx 7 7 u a x False\n", + "xxxx 7 8 u e z False\n", + "xxxx 7 9 u d u False\n", + "xxxx 7 10 u h a False\n", + "xxxx 7 11 u h e False\n", + "xxxx 7 12 u g d False\n", + "xxxx 7 13 u e h False\n", + "xxxx 7 14 u f v False\n", + "xxxx 7 15 u d u False\n", + "xxxx 7 16 u g h False\n", + "xxxx 7 17 u h g False\n", + "xxxx 7 18 u g x False\n", + "xxxx 7 19 u g e False\n", + "xxxx 7 20 u g f False\n", + "seq1 8 0 x ! e False\n", + "xxxx 8 1 x a u False\n", + "xxxx 8 2 x c f False\n", + "xxxx 8 3 x h u False\n", + "xxxx 8 4 x e v False\n", + "xxxx 8 5 x e u False\n", + "seq1 8 6 x f x True\n", + "xxxx 8 7 x a z False\n", + "xxxx 8 8 x e u False\n", + "xxxx 8 9 x d a False\n", + "xxxx 8 10 x h e False\n", + "xxxx 8 11 x h d False\n", + "xxxx 8 12 x g h False\n", + "xxxx 8 13 x e v False\n", + "xxxx 8 14 x f u False\n", + "xxxx 8 15 x d h False\n", + "xxxx 8 16 x g g False\n", + "xxxx 8 17 x h x False\n", + "xxxx 8 18 x g e False\n", + "xxxx 8 19 x g f False\n", + "xxxx 8 20 x g w False\n", + "seq1 9 0 z ! u False\n", + "xxxx 9 1 z a f False\n", + "xxxx 9 2 z c u False\n", + "xxxx 9 3 z h v False\n", + "xxxx 9 4 z e u False\n", + "xxxx 9 5 z e x False\n", + "seq1 9 6 z f z True\n", + "xxxx 9 7 z a u False\n", + "xxxx 9 8 z e a False\n", + "xxxx 9 9 z d e False\n", + "xxxx 9 10 z h d False\n", + "xxxx 9 11 z h h False\n", + "xxxx 9 12 z g v False\n", + "xxxx 9 13 z e u False\n", + "xxxx 9 14 z f h False\n", + "xxxx 9 15 z d g False\n", + "xxxx 9 16 z g x False\n", + "xxxx 9 17 z h e False\n", + "xxxx 9 18 z g f False\n", + "xxxx 9 19 z g w False\n", + "xxxx 9 20 z g y False\n", + "seq1 10 0 u ! f False\n", + "xxxx 10 1 u a u False\n", + "xxxx 10 2 u c v False\n", + "xxxx 10 3 u h u False\n", + "xxxx 10 4 u e x False\n", + "xxxx 10 5 u e z False\n", + "seq1 10 6 u f u True\n", + "seq2 10 7 u a a True\n", + "seq2 10 8 u e e True\n", + "seq2 10 9 u d d True\n", + "seq2 10 10 u h h True\n", + "xxxx 10 11 u h v False\n", + "xxxx 10 12 u g u False\n", + "xxxx 10 13 u e h False\n", + "xxxx 10 14 u f g False\n", + "xxxx 10 15 u d x False\n", + "xxxx 10 16 u g e False\n", + "xxxx 10 17 u h f False\n", + "xxxx 10 18 u g w False\n", + "xxxx 10 19 u g y False\n", + "xxxx 10 20 u g u False\n", + "seq1 11 0 v ! u False\n", + "xxxx 11 1 v a v False\n", + "xxxx 11 2 v c u False\n", + "xxxx 11 3 v h x False\n", + "xxxx 11 4 v e z False\n", + "xxxx 11 5 v e u False\n", + "xxxx 11 6 v f a False\n", + "xxxx 11 7 v a e False\n", + "xxxx 11 8 v e d False\n", + "xxxx 11 9 v d h False\n", + "seq1 11 10 v h v True\n", + "xxxx 11 11 v h u False\n", + "xxxx 11 12 v g h False\n", + "xxxx 11 13 v e g False\n", + "xxxx 11 14 v f x False\n", + "xxxx 11 15 v d e False\n", + "xxxx 11 16 v g f False\n", + "xxxx 11 17 v h w False\n", + "xxxx 11 18 v g y False\n", + "xxxx 11 19 v g u False\n", + "xxxx 11 20 v g d False\n", + "seq1 12 0 u ! v False\n", + "xxxx 12 1 u a u False\n", + "xxxx 12 2 u c x False\n", + "xxxx 12 3 u h z False\n", + "xxxx 12 4 u e u False\n", + "xxxx 12 5 u e a False\n", + "xxxx 12 6 u f e False\n", + "xxxx 12 7 u a d False\n", + "xxxx 12 8 u e h False\n", + "xxxx 12 9 u d v False\n", + "seq1 12 10 u h u True\n", + "seq2 12 11 u h h True\n", + "seq2 12 12 u g g True\n", + "xxxx 12 13 u e x False\n", + "xxxx 12 14 u f e False\n", + "xxxx 12 15 u d f False\n", + "xxxx 12 16 u g w False\n", + "xxxx 12 17 u h y False\n", + "xxxx 12 18 u g u False\n", + "xxxx 12 19 u g d False\n", + "xxxx 12 20 u g g False\n", + "seq1 13 0 x ! u False\n", + "xxxx 13 1 x a x False\n", + "xxxx 13 2 x c z False\n", + "xxxx 13 3 x h u False\n", + "xxxx 13 4 x e a False\n", + "xxxx 13 5 x e e False\n", + "xxxx 13 6 x f d False\n", + "xxxx 13 7 x a h False\n", + "xxxx 13 8 x e v False\n", + "xxxx 13 9 x d u False\n", + "xxxx 13 10 x h h False\n", "xxxx 13 11 x h g False\n", - "xxxx 13 12 x g h False\n", - "xxxx 13 13 x b u False\n", - "xxxx 13 14 x a g False\n", - "xxxx 13 15 x a b False\n", - "xxxx 13 16 x d u False\n", - "xxxx 13 17 x g z False\n", - "xxxx 13 18 x c a False\n", - "xxxx 13 19 x c u False\n", - "xxxx 13 20 x g x False\n", - "seq1 14 0 y ! h False\n", - "xxxx 14 1 y d u False\n", - "xxxx 14 2 y f v False\n", - "xxxx 14 3 y g w False\n", - "xxxx 14 4 y a f False\n", - "xxxx 14 5 y g z False\n", - "xxxx 14 6 y h f False\n", - "xxxx 14 7 y f d False\n", - "xxxx 14 8 y f x False\n", - "seq1 14 9 y d y True\n", - "seq2 14 10 y g g True\n", - "seq2 14 11 y h h True\n", - "xxxx 14 12 y g u False\n", - "xxxx 14 13 y b g False\n", - "xxxx 14 14 y a b False\n", - "xxxx 14 15 y a u False\n", - "xxxx 14 16 y d z False\n", - "xxxx 14 17 y g a False\n", - "xxxx 14 18 y c u False\n", - "xxxx 14 19 y c x False\n", - "xxxx 14 20 y g a False\n", - "seq1 15 0 u ! u False\n", - "xxxx 15 1 u d v False\n", - "xxxx 15 2 u f w False\n", - "xxxx 15 3 u g f False\n", - "xxxx 15 4 u a z False\n", - "xxxx 15 5 u g f False\n", - "xxxx 15 6 u h d False\n", - "xxxx 15 7 u f x False\n", - "xxxx 15 8 u f y False\n", - "xxxx 15 9 u d g False\n", - "xxxx 15 10 u g h False\n", - "seq1 15 11 u h u True\n", - "seq2 15 12 u g g True\n", - "seq2 15 13 u b b True\n", - "xxxx 15 14 u a u False\n", - "xxxx 15 15 u a z False\n", - "xxxx 15 16 u d a False\n", - "xxxx 15 17 u g u False\n", - "xxxx 15 18 u c x False\n", - "xxxx 15 19 u c a False\n", - "xxxx 15 20 u g d False\n", - "seq1 16 0 u ! v False\n", - "xxxx 16 1 u d w False\n", - "xxxx 16 2 u f f False\n", - "xxxx 16 3 u g z False\n", - "xxxx 16 4 u a f False\n", - "xxxx 16 5 u g d False\n", - "xxxx 16 6 u h x False\n", - "xxxx 16 7 u f y False\n", - "xxxx 16 8 u f g False\n", - "xxxx 16 9 u d h False\n", - "xxxx 16 10 u g u False\n", - "xxxx 16 11 u h g False\n", - "xxxx 16 12 u g b False\n", - "seq1 16 13 u b u True\n", - "xxxx 16 14 u a z False\n", - "xxxx 16 15 u a a False\n", - "xxxx 16 16 u d u False\n", - "xxxx 16 17 u g x False\n", - "xxxx 16 18 u c a False\n", - "xxxx 16 19 u c d False\n", - "xxxx 16 20 u g g False\n", - "seq1 17 0 z ! w False\n", - "xxxx 17 1 z d f False\n", - "xxxx 17 2 z f z False\n", - "xxxx 17 3 z g f False\n", - "xxxx 17 4 z a d False\n", - "xxxx 17 5 z g x False\n", - "xxxx 17 6 z h y False\n", - "xxxx 17 7 z f g False\n", - "xxxx 17 8 z f h False\n", - "xxxx 17 9 z d u False\n", - "xxxx 17 10 z g g False\n", - "xxxx 17 11 z h b False\n", - "xxxx 17 12 z g u False\n", - "seq1 17 13 z b z True\n", - "seq2 17 14 z a a True\n", - "xxxx 17 15 z a u False\n", - "xxxx 17 16 z d x False\n", - "xxxx 17 17 z g a False\n", - "xxxx 17 18 z c d False\n", - "xxxx 17 19 z c g False\n", - "xxxx 17 20 z g c False\n", - "seq1 18 0 u ! f False\n", - "xxxx 18 1 u d z False\n", - "xxxx 18 2 u f f False\n", - "xxxx 18 3 u g d False\n", - "xxxx 18 4 u a x False\n", - "xxxx 18 5 u g y False\n", - "xxxx 18 6 u h g False\n", - "xxxx 18 7 u f h False\n", - "xxxx 18 8 u f u False\n", - "xxxx 18 9 u d g False\n", - "xxxx 18 10 u g b False\n", - "xxxx 18 11 u h u False\n", - "xxxx 18 12 u g z False\n", - "xxxx 18 13 u b a False\n", - "seq1 18 14 u a u True\n", - "xxxx 18 15 u a x False\n", - "xxxx 18 16 u d a False\n", - "xxxx 18 17 u g d False\n", - "xxxx 18 18 u c g False\n", - "xxxx 18 19 u c c False\n", - "xxxx 18 20 u g x False\n", - "seq1 19 0 x ! z False\n", - "xxxx 19 1 x d f False\n", - "xxxx 19 2 x f d False\n" - ] - }, - { - "name": "stdout", - "output_type": "stream", - "text": [ - "xxxx 19 3 x g x False\n", - "xxxx 19 4 x a y False\n", - "xxxx 19 5 x g g False\n", - "xxxx 19 6 x h h False\n", - "xxxx 19 7 x f u False\n", - "xxxx 19 8 x f g False\n", - "xxxx 19 9 x d b False\n", - "xxxx 19 10 x g u False\n", - "xxxx 19 11 x h z False\n", - "xxxx 19 12 x g a False\n", - "xxxx 19 13 x b u False\n", - "seq1 19 14 x a x True\n", - "seq2 19 15 x a a True\n", - "seq2 19 16 x d d True\n", - "seq2 19 17 x g g True\n", - "seq2 19 18 x c c True\n", - "xxxx 19 19 x c x False\n", - "xxxx 19 20 x g c False\n", - "seq1 20 0 x ! f False\n", - "xxxx 20 1 x d d False\n", - "xxxx 20 2 x f x False\n", - "xxxx 20 3 x g y False\n", - "xxxx 20 4 x a g False\n", - "xxxx 20 5 x g h False\n", - "xxxx 20 6 x h u False\n", - "xxxx 20 7 x f g False\n", - "xxxx 20 8 x f b False\n", - "xxxx 20 9 x d u False\n", - "xxxx 20 10 x g z False\n", - "xxxx 20 11 x h a False\n", - "xxxx 20 12 x g u False\n", - "xxxx 20 13 x b x False\n", - "xxxx 20 14 x a a False\n", - "xxxx 20 15 x a d False\n", - "xxxx 20 16 x d g False\n", - "xxxx 20 17 x g c False\n", - "seq1 20 18 x c x True\n", - "seq2 20 19 x c c True\n", - "seq2 20 20 x g g True\n", - "T T . . . . . . . . . . . . . . . . . . .\n", - ". T . . . . . . . . . . . . . . . . . . .\n", - ". T T . . . . . . . . . . . . . . . . . .\n", - ". . T . . . . . . . . . . . . . . . . . .\n", - ". . T T . . . . . . . . . . . . . . . . .\n", - ". . . T T . . . . . . . . . . . . . . . .\n", - ". . . . T . . . . . . . . . . . . . . . .\n", - ". . . . T . . . . . . . . . . . . . . . .\n", - ". . . . T T T . . . . . . . . . . . . . .\n", + "seq1 13 12 x g x True\n", + "seq2 13 13 x e e True\n", + "seq2 13 14 x f f True\n", + "xxxx 13 15 x d w False\n", + "xxxx 13 16 x g y False\n", + "xxxx 13 17 x h u False\n", + "xxxx 13 18 x g d False\n", + "xxxx 13 19 x g g False\n", + "xxxx 13 20 x g h False\n", + "seq1 14 0 w ! x False\n", + "xxxx 14 1 w a z False\n", + "xxxx 14 2 w c u False\n", + "xxxx 14 3 w h a False\n", + "xxxx 14 4 w e e False\n", + "xxxx 14 5 w e d False\n", + "xxxx 14 6 w f h False\n", + "xxxx 14 7 w a v False\n", + "xxxx 14 8 w e u False\n", + "xxxx 14 9 w d h False\n", + "xxxx 14 10 w h g False\n", + "xxxx 14 11 w h x False\n", + "xxxx 14 12 w g e False\n", + "xxxx 14 13 w e f False\n", + "seq1 14 14 w f w True\n", + "xxxx 14 15 w d y False\n", + "xxxx 14 16 w g u False\n", + "xxxx 14 17 w h d False\n", + "xxxx 14 18 w g g False\n", + "xxxx 14 19 w g h False\n", + "xxxx 14 20 w g g False\n", + "seq1 15 0 y ! z False\n", + "xxxx 15 1 y a u False\n", + "xxxx 15 2 y c a False\n", + "xxxx 15 3 y h e False\n", + "xxxx 15 4 y e d False\n", + "xxxx 15 5 y e h False\n", + "xxxx 15 6 y f v False\n", + "xxxx 15 7 y a u False\n", + "xxxx 15 8 y e h False\n", + "xxxx 15 9 y d g False\n", + "xxxx 15 10 y h x False\n", + "xxxx 15 11 y h e False\n", + "xxxx 15 12 y g f False\n", + "xxxx 15 13 y e w False\n", + "seq1 15 14 y f y True\n", + "xxxx 15 15 y d u False\n", + "xxxx 15 16 y g d False\n", + "xxxx 15 17 y h g False\n", + "xxxx 15 18 y g h False\n", + "xxxx 15 19 y g g False\n", + "xxxx 15 20 y g g False\n", + "seq1 16 0 u ! u False\n", + "xxxx 16 1 u a a False\n", + "xxxx 16 2 u c e False\n", + "xxxx 16 3 u h d False\n", + "xxxx 16 4 u e h False\n", + "xxxx 16 5 u e v False\n", + "xxxx 16 6 u f u False\n", + "xxxx 16 7 u a h False\n", + "xxxx 16 8 u e g False\n", + "xxxx 16 9 u d x False\n", + "xxxx 16 10 u h e False\n", + "xxxx 16 11 u h f False\n", + "xxxx 16 12 u g w False\n", + "xxxx 16 13 u e y False\n", + "seq1 16 14 u f u True\n", + "seq2 16 15 u d d True\n", + "seq2 16 16 u g g True\n", + "seq2 16 17 u h h True\n", + "seq2 16 18 u g g True\n", + "seq2 16 19 u g g True\n", + "seq2 16 20 u g g True\n", + "seq1 17 0 y ! a False\n", + "xxxx 17 1 y a e False\n", + "xxxx 17 2 y c d False\n", + "xxxx 17 3 y h h False\n", + "xxxx 17 4 y e v False\n", + "xxxx 17 5 y e u False\n", + "xxxx 17 6 y f h False\n", + "xxxx 17 7 y a g False\n", + "xxxx 17 8 y e x False\n", + "xxxx 17 9 y d e False\n", + "xxxx 17 10 y h f False\n", + "xxxx 17 11 y h w False\n", + "xxxx 17 12 y g y False\n", + "xxxx 17 13 y e u False\n", + "xxxx 17 14 y f d False\n", + "xxxx 17 15 y d g False\n", + "xxxx 17 16 y g h False\n", + "xxxx 17 17 y h g False\n", + "xxxx 17 18 y g g False\n", + "xxxx 17 19 y g g False\n", + "seq1 17 20 y g y True\n", + "seq1 18 0 y ! e False\n", + "xxxx 18 1 y a d False\n", + "xxxx 18 2 y c h False\n", + "xxxx 18 3 y h v False\n", + "xxxx 18 4 y e u False\n", + "xxxx 18 5 y e h False\n", + "xxxx 18 6 y f g False\n", + "xxxx 18 7 y a x False\n", + "xxxx 18 8 y e e False\n", + "xxxx 18 9 y d f False\n", + "xxxx 18 10 y h w False\n", + "xxxx 18 11 y h y False\n", + "xxxx 18 12 y g u False\n", + "xxxx 18 13 y e d False\n", + "xxxx 18 14 y f g False\n", + "xxxx 18 15 y d h False\n", + "xxxx 18 16 y g g False\n", + "xxxx 18 17 y h g False\n", + "xxxx 18 18 y g g False\n", + "xxxx 18 19 y g y False\n", + "seq1 18 20 y g y True\n", + "seq1 19 0 u ! d False\n", + "xxxx 19 1 u a h False\n", + "xxxx 19 2 u c v False\n", + "xxxx 19 3 u h u False\n", + "xxxx 19 4 u e h False\n", + "xxxx 19 5 u e g False\n", + "xxxx 19 6 u f x False\n", + "xxxx 19 7 u a e False\n", + "xxxx 19 8 u e f False\n", + "xxxx 19 9 u d w False\n", + "xxxx 19 10 u h y False\n", + "xxxx 19 11 u h u False\n", + "xxxx 19 12 u g d False\n", + "xxxx 19 13 u e g False\n", + "xxxx 19 14 u f h False\n", + "xxxx 19 15 u d g False\n", + "xxxx 19 16 u g g False\n", + "xxxx 19 17 u h g False\n", + "xxxx 19 18 u g y False\n", + "xxxx 19 19 u g y False\n", + "seq1 19 20 u g u True\n", + "seq1 20 0 z ! h False\n", + "xxxx 20 1 z a v False\n", + "xxxx 20 2 z c u False\n", + "xxxx 20 3 z h h False\n", + "xxxx 20 4 z e g False\n", + "xxxx 20 5 z e x False\n", + "xxxx 20 6 z f e False\n", + "xxxx 20 7 z a f False\n", + "xxxx 20 8 z e w False\n", + "xxxx 20 9 z d y False\n", + "xxxx 20 10 z h u False\n", + "xxxx 20 11 z h d False\n", + "xxxx 20 12 z g g False\n", + "xxxx 20 13 z e h False\n", + "xxxx 20 14 z f g False\n", + "xxxx 20 15 z d g False\n", + "xxxx 20 16 z g g False\n", + "xxxx 20 17 z h y False\n", + "xxxx 20 18 z g y False\n", + "xxxx 20 19 z g u False\n", + "seq1 20 20 z g z True\n", + "T . . . . . . . . . . . . . . . . . . . .\n", + "T T T . . . . . . . . . . . . . . . . . .\n", + ". . T T T . . . . . . . . . . . . . . . .\n", + ". . . . T T . . . . . . . . . . . . . . .\n", + ". . . . . T T . . . . . . . . . . . . . .\n", + ". . . . . . T . . . . . . . . . . . . . .\n", ". . . . . . T . . . . . . . . . . . . . .\n", ". . . . . . T . . . . . . . . . . . . . .\n", - ". . . . . . T T . . . . . . . . . . . . .\n", - ". . . . . . . T T T . . . . . . . . . . .\n", - ". . . . . . . . . T . . . . . . . . . . .\n", - ". . . . . . . . . T T T . . . . . . . . .\n", - ". . . . . . . . . . . T T T . . . . . . .\n", - ". . . . . . . . . . . . . T . . . . . . .\n", - ". . . . . . . . . . . . . T T . . . . . .\n", + ". . . . . . T . . . . . . . . . . . . . .\n", + ". . . . . . T . . . . . . . . . . . . . .\n", + ". . . . . . T T T T T . . . . . . . . . .\n", + ". . . . . . . . . . T . . . . . . . . . .\n", + ". . . . . . . . . . T T T . . . . . . . .\n", + ". . . . . . . . . . . . T T T . . . . . .\n", + ". . . . . . . . . . . . . . T . . . . . .\n", ". . . . . . . . . . . . . . T . . . . . .\n", - ". . . . . . . . . . . . . . T T T T T . .\n", - ". . . . . . . . . . . . . . . . . . T T T\n" + ". . . . . . . . . . . . . . T T T T T T T\n", + ". . . . . . . . . . . . . . . . . . . . T\n", + ". . . . . . . . . . . . . . . . . . . . T\n", + ". . . . . . . . . . . . . . . . . . . . T\n", + ". . . . . . . . . . . . . . . . . . . . T\n" ] } ], @@ -1258,16 +1254,16 @@ }, { "cell_type": "code", - "execution_count": 144, + "execution_count": 22, "metadata": {}, "outputs": [ { "data": { "text/plain": [ - "'dVVfVWgYaWWWghUVWfZfdXYghUgbUZaUXadgcXcg'" + "'UacVheVeUfUVUXZUaedhVUhgXefWYUdghgggYYUZ'" ] }, - "execution_count": 144, + "execution_count": 22, "metadata": {}, "output_type": "execute_result" } @@ -1278,35 +1274,35 @@ }, { "cell_type": "code", - "execution_count": 145, + "execution_count": 23, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ - "T T . . . . . . . . . . . . . . . . . . .\n", - ". T . . . . . . . . . . . . . . . . . . .\n", - ". T T . . . . . . . . . . . . . . . . . .\n", - ". . T . . . . . . . . . . . . . . . . . .\n", - ". . T T . . . . . . . . . . . . . . . . .\n", - ". . . T T . . . . . . . . . . . . . . . .\n", - ". . . . T . . . . . . . . . . . . . . . .\n", - ". . . . T . . . . . . . . . . . . . . . .\n", - ". . . . T T T . . . . . . . . . . . . . .\n", + "T . . . . . . . . . . . . . . . . . . . .\n", + "T T T . . . . . . . . . . . . . . . . . .\n", + ". . T T T . . . . . . . . . . . . . . . .\n", + ". . . . T T . . . . . . . . . . . . . . .\n", + ". . . . . T T . . . . . . . . . . . . . .\n", + ". . . . . . T . . . . . . . . . . . . . .\n", + ". . . . . . T . . . . . . . . . . . . . .\n", + ". . . . . . T . . . . . . . . . . . . . .\n", ". . . . . . T . . . . . . . . . . . . . .\n", ". . . . . . T . . . . . . . . . . . . . .\n", - ". . . . . . T T . . . . . . . . . . . . .\n", - ". . . . . . . T T T . . . . . . . . . . .\n", - ". . . . . . . . . T . . . . . . . . . . .\n", - ". . . . . . . . . T T T . . . . . . . . .\n", - ". . . . . . . . . . . T T T . . . . . . .\n", - ". . . . . . . . . . . . . T . . . . . . .\n", - ". . . . . . . . . . . . . T T . . . . . .\n", + ". . . . . . T T T T T . . . . . . . . . .\n", + ". . . . . . . . . . T . . . . . . . . . .\n", + ". . . . . . . . . . T T T . . . . . . . .\n", + ". . . . . . . . . . . . T T T . . . . . .\n", ". . . . . . . . . . . . . . T . . . . . .\n", - ". . . . . . . . . . . . . . T T T T T . .\n", - ". . . . . . . . . . . . . . . . . . T T T\n", - "dVVfVWgYaWWWghUVWfZfdXYghUgbUZaUXadgcXcg\n" + ". . . . . . . . . . . . . . T . . . . . .\n", + ". . . . . . . . . . . . . . T T T T T T T\n", + ". . . . . . . . . . . . . . . . . . . . T\n", + ". . . . . . . . . . . . . . . . . . . . T\n", + ". . . . . . . . . . . . . . . . . . . . T\n", + ". . . . . . . . . . . . . . . . . . . . T\n", + "UacVheVeUfUVUXZUaedhVUhgXefWYUdghgggYYUZ\n" ] }, { @@ -1315,7 +1311,7 @@ "True" ] }, - "execution_count": 145, + "execution_count": 23, "metadata": {}, "output_type": "execute_result" } @@ -1329,19 +1325,19 @@ }, { "cell_type": "code", - "execution_count": 151, + "execution_count": 24, "metadata": {}, "outputs": [ { "data": { "text/plain": [ - "('cfhgbbfabcehcbfdfcafdfecefaecfagbdfeecfdbhebgbfhee',\n", - " 'begacfabcgegaegefgcgaabeefahahgfhbdbhhdabbaaahhdcb',\n", - " 'bcfehggacfbbabcgegfaeabgceefhcbgcgaabfdfcaefedfefacehahgffhbdbahechfagdabbbdaafeahechdfdcbbhebgbfhee',\n", + "('gfccbgegegaccfcgeehbgcafchgbfdfbggbcachfdfaccfbffb',\n", + " 'accfcfbdaabcabbbegdfffhcgcefbddegghgfdgcgdcffcfdcd',\n", + " 'acgcfcffbdcacbabcagbbbegegegadcfcffcgfeehbgchacfchggcbefbfddfbdggbegcgachhfgfdfdgcgdacccfbffcffbfdcd',\n", " 100)" ] }, - "execution_count": 151, + "execution_count": 24, "metadata": {}, "output_type": "execute_result" } @@ -1355,7 +1351,7 @@ }, { "cell_type": "code", - "execution_count": 152, + "execution_count": 25, "metadata": {}, "outputs": [ { @@ -1363,57 +1359,57 @@ "output_type": "stream", "text": [ "T . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .\n", - "T T T . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .\n", - ". . T T T . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .\n", - ". . . T T . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .\n", - ". . . . T . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .\n", - ". . . . T . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .\n", - ". . . . T T T . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .\n", - ". . . . . . T . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .\n", - ". . . . . . T . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .\n", - ". . . . . . T . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .\n", + "T . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .\n", + "T T . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .\n", + ". T T T . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .\n", + ". T . T . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .\n", + ". T T . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .\n", + ". T T . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .\n", + ". . T . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .\n", + ". . T T . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .\n", + ". . . T T T . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .\n", + ". . . . . T . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .\n", + ". . . . . T . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .\n", + ". . . . . T . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .\n", + ". . . . . T T . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .\n", ". . . . . . T . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .\n", ". . . . . . T . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .\n", - ". . . . . . T T T . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .\n", - ". . . . . . . T . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .\n", - ". . . . . . . T T T . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .\n", - ". . . . . . . . . T T T . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .\n", - ". . . . . . . . . . T T . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .\n", - ". . . . . . . . . . . T T T T . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .\n", - ". . . . . . . . . . . . . . T . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .\n", - ". . . . . . . . . . . . . . T . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .\n", - ". . . . . . . . . . . . . . T . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .\n", - ". . . . . . . . . . . . . . T . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .\n", - ". . . . . . . . . . . . . . T . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .\n", - ". . . . . . . . . . . . . . T T T T T T . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .\n", - ". . . . . . . . . . . . . . . . . . . T T . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .\n", - ". . . . . . . . . . . . . . . . . . . . T T T T . . . . . . . . . . . . . . . . . . . . . . . . . . .\n", - ". . . . . . . . . . . . . . . . . . . . . T . T . . . . . . . . . . . . . . . . . . . . . . . . . . .\n", - ". . . . . . . . . . . . . . . . . . . . . . . T T T . . . . . . . . . . . . . . . . . . . . . . . . .\n", - ". . . . . . . . . . . . . . . . . . . . . . . . . T . . . . . . . . . . . . . . . . . . . . . . . . .\n", - ". . . . . . . . . . . . . . . . . . . . . . . . . T . . . . . . . . . . . . . . . . . . . . . . . . .\n", - ". . . . . . . . . . . . . . . . . . . . . . . . . T . . . . . . . . . . . . . . . . . . . . . . . . .\n", - ". . . . . . . . . . . . . . . . . . . . . . . . . T T . . . . . . . . . . . . . . . . . . . . . . . .\n", - ". . . . . . . . . . . . . . . . . . . . . . . . . T T . . . . . . . . . . . . . . . . . . . . . . . .\n", - ". . . . . . . . . . . . . . . . . . . . . . . . . . T . . . . . . . . . . . . . . . . . . . . . . . .\n", - ". . . . . . . . . . . . . . . . . . . . . . . . . . T . . . . . . . . . . . . . . . . . . . . . . . .\n", - ". . . . . . . . . . . . . . . . . . . . . . . . . . T . . . . . . . . . . . . . . . . . . . . . . . .\n", + ". . . . . . T T T T T . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .\n", + ". . . . . . T . T . T . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .\n", + ". . . . . . T T T T T T . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .\n", + ". . . . . . . . . . . T T . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .\n", + ". . . . . . . . . . . . T T T . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .\n", + ". . . . . . . . . . . . . T T T T . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .\n", + ". . . . . . . . . . . . . T . . T T T T T T T . . . . . . . . . . . . . . . . . . . . . . . . . . . .\n", + ". . . . . . . . . . . . . . . . . . T . . . T T . . . . . . . . . . . . . . . . . . . . . . . . . . .\n", + ". . . . . . . . . . . . . . . . . . . . . . . T T T T T . . . . . . . . . . . . . . . . . . . . . . .\n", ". . . . . . . . . . . . . . . . . . . . . . . . . . T T . . . . . . . . . . . . . . . . . . . . . . .\n", - ". . . . . . . . . . . . . . . . . . . . . . . . . . . T T T . . . . . . . . . . . . . . . . . . . . .\n", + ". . . . . . . . . . . . . . . . . . . . . . . . . . . T T . . . . . . . . . . . . . . . . . . . . . .\n", + ". . . . . . . . . . . . . . . . . . . . . . . . . . . . T T . . . . . . . . . . . . . . . . . . . . .\n", + ". . . . . . . . . . . . . . . . . . . . . . . . . . . . T . . . . . . . . . . . . . . . . . . . . . .\n", + ". . . . . . . . . . . . . . . . . . . . . . . . . . . . T T T . . . . . . . . . . . . . . . . . . . .\n", ". . . . . . . . . . . . . . . . . . . . . . . . . . . . . T T T T . . . . . . . . . . . . . . . . . .\n", - ". . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . T . . . . . . . . . . . . . . . . . .\n", - ". . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . T T . . . . . . . . . . . . . . . . .\n", - ". . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . T T . . . . . . . . . . . . . . . . .\n", - ". . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . T T T . . . . . . . . . . . . . . . .\n", - ". . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . T . . . . . . . . . . . . . . . .\n", - ". . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . T T T . . . . . . . . . . . . . .\n", - ". . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . T . . . . . . . . . . . . . .\n", - ". . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . T T T . . . . . . . . . . . .\n", - ". . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . T . . . . . . . . . . . .\n", + ". . . . . . . . . . . . . . . . . . . . . . . . . . . . . T . . T T T T . . . . . . . . . . . . . . .\n", + ". . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . T . . . . . . . . . . . . . . .\n", + ". . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . T T . . . . . . . . . . . . . .\n", + ". . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . T T T T . . . . . . . . . . .\n", ". . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . T T T . . . . . . . . . .\n", - ". . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . T T . . . . . . . . .\n", - ". . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . T T T T T T T T T T T\n", - "BcfEhgGACFbbABCGEGfAEabGceEFhcbGCGAABfdfcaEfEdfeFAceHAHGfFHBDBaHecHfagDAbBBdAAfeAHecHDfdCbBhebgbfhee\n" + ". . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . T . . . . . . . . . .\n", + ". . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . T T T . . . . . . . .\n", + ". . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . T . T . . . . . . . .\n", + ". . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . T . . . . . . . .\n", + ". . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . T . . . . . . . .\n", + ". . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . T . . . . . . . .\n", + ". . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . T T T T . . . . .\n", + ". . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . T T T T T T T .\n", + ". . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . T . T T . .\n", + ". . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . T . . .\n", + ". . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . T T T T\n", + ". . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . T T . T\n", + ". . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . T\n", + ". . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . T\n", + ". . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . T\n", + "ACgCFCfFBDcAcbABCAgBBBegegEGaDcFcfFcgFeehbgcHaCfchgGCbEFBfdDfbDggbEGcGachHfGFdfDGCGDaccCfbFFCffbFDCD\n" ] }, { @@ -1422,7 +1418,7 @@ "True" ] }, - "execution_count": 152, + "execution_count": 25, "metadata": {}, "output_type": "execute_result" } @@ -1436,14 +1432,14 @@ }, { "cell_type": "code", - "execution_count": 157, + "execution_count": 26, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ - "1000 loops, best of 3: 1.24 ms per loop\n" + "1000 loops, best of 3: 1.25 ms per loop\n" ] } ], @@ -1454,65 +1450,65 @@ }, { "cell_type": "code", - "execution_count": 148, + "execution_count": 27, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ - "T . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .\n", - "T . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .\n", "T T T . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .\n", - "T . T T . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .\n", - ". . T T . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .\n", - ". . . T T T T T . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .\n", - ". . . . T . . T T . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .\n", - ". . . . T . . . T . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .\n", - ". . . . . . . . T . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .\n", - ". . . . . . . . T T . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .\n", - ". . . . . . . . . T T T T . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .\n", - ". . . . . . . . . . . T T . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .\n", - ". . . . . . . . . . . . T . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .\n", - ". . . . . . . . . . . . T . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .\n", - ". . . . . . . . . . . . T . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .\n", - ". . . . . . . . . . . . T T T T . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .\n", - ". . . . . . . . . . . . . . T T T . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .\n", - ". . . . . . . . . . . . . . . T . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .\n", - ". . . . . . . . . . . . . . . T T T T T T T T T T T T T T . . . . . . . . . . . . . . . . . . . . . .\n", - ". . . . . . . . . . . . . . . T . . . . . . . . . T . . T T T . . . . . . . . . . . . . . . . . . . .\n", - ". . . . . . . . . . . . . . . . . . . . . . . . . . . . . T . . . . . . . . . . . . . . . . . . . . .\n", - ". . . . . . . . . . . . . . . . . . . . . . . . . . . . . T T T T . . . . . . . . . . . . . . . . . .\n", - ". . . . . . . . . . . . . . . . . . . . . . . . . . . . . . T T T T . . . . . . . . . . . . . . . . .\n", - ". . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . T . . . . . . . . . . . . . . . . . .\n", - ". . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . T T . . . . . . . . . . . . . . . . .\n", - ". . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . T T T . . . . . . . . . . . . . . . .\n", - ". . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . T . . . . . . . . . . . . . . . .\n", + ". . T T T T T . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .\n", + ". . . T . T T T T . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .\n", + ". . . T T . . . T T . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .\n", + ". . . . . . . . . T . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .\n", + ". . . . . . . . . T T T T T . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .\n", + ". . . . . . . . . . . . . T T T T T T . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .\n", + ". . . . . . . . . . . . . . . . T . T . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .\n", + ". . . . . . . . . . . . . . . . T T T . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .\n", + ". . . . . . . . . . . . . . . . T . T . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .\n", + ". . . . . . . . . . . . . . . . T T T . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .\n", + ". . . . . . . . . . . . . . . . . . T T . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .\n", + ". . . . . . . . . . . . . . . . . . . T T . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .\n", + ". . . . . . . . . . . . . . . . . . . . T T T . . . . . . . . . . . . . . . . . . . . . . . . . . . .\n", + ". . . . . . . . . . . . . . . . . . . . T T . . . . . . . . . . . . . . . . . . . . . . . . . . . . .\n", + ". . . . . . . . . . . . . . . . . . . . . T . . . . . . . . . . . . . . . . . . . . . . . . . . . . .\n", + ". . . . . . . . . . . . . . . . . . . . . T T . . . . . . . . . . . . . . . . . . . . . . . . . . . .\n", + ". . . . . . . . . . . . . . . . . . . . . . T . . . . . . . . . . . . . . . . . . . . . . . . . . . .\n", + ". . . . . . . . . . . . . . . . . . . . . . T T . . . . . . . . . . . . . . . . . . . . . . . . . . .\n", + ". . . . . . . . . . . . . . . . . . . . . . T . . . . . . . . . . . . . . . . . . . . . . . . . . . .\n", + ". . . . . . . . . . . . . . . . . . . . . . T . . . . . . . . . . . . . . . . . . . . . . . . . . . .\n", + ". . . . . . . . . . . . . . . . . . . . . . T . . . . . . . . . . . . . . . . . . . . . . . . . . . .\n", + ". . . . . . . . . . . . . . . . . . . . . . T T . . . . . . . . . . . . . . . . . . . . . . . . . . .\n", + ". . . . . . . . . . . . . . . . . . . . . . . T T . . . . . . . . . . . . . . . . . . . . . . . . . .\n", + ". . . . . . . . . . . . . . . . . . . . . . . . T . . . . . . . . . . . . . . . . . . . . . . . . . .\n", + ". . . . . . . . . . . . . . . . . . . . . . . . T . . . . . . . . . . . . . . . . . . . . . . . . . .\n", + ". . . . . . . . . . . . . . . . . . . . . . . . T T . . . . . . . . . . . . . . . . . . . . . . . . .\n", + ". . . . . . . . . . . . . . . . . . . . . . . . T T T . . . . . . . . . . . . . . . . . . . . . . . .\n", + ". . . . . . . . . . . . . . . . . . . . . . . . . . T T T T . . . . . . . . . . . . . . . . . . . . .\n", + ". . . . . . . . . . . . . . . . . . . . . . . . . . . T . T T T . . . . . . . . . . . . . . . . . . .\n", + ". . . . . . . . . . . . . . . . . . . . . . . . . . . . . T T . . . . . . . . . . . . . . . . . . . .\n", + ". . . . . . . . . . . . . . . . . . . . . . . . . . . . . . T . . . . . . . . . . . . . . . . . . . .\n", + ". . . . . . . . . . . . . . . . . . . . . . . . . . . . . . T T . . . . . . . . . . . . . . . . . . .\n", + ". . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . T . . . . . . . . . . . . . . . . . . .\n", + ". . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . T . . . . . . . . . . . . . . . . . . .\n", + ". . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . T T T . . . . . . . . . . . . . . . . .\n", + ". . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . T T . . . . . . . . . . . . . . . .\n", ". . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . T . . . . . . . . . . . . . . . .\n", ". . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . T T . . . . . . . . . . . . . . .\n", - ". . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . T T . . . . . . . . . . . . . .\n", - ". . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . T T . . . . . . . . . . . . . .\n", - ". . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . T . . . . . . . . . . . . . .\n", - ". . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . T . . . . . . . . . . . . . .\n", - ". . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . T T . . . . . . . . . . . . .\n", - ". . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . T T T . . . . . . . . . . .\n", - ". . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . T . T T . . . . . . . . . .\n", - ". . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . T T T T . . . . . . .\n", - ". . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . T T T T . . . .\n", - ". . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . T . . . . . .\n", - ". . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . T . . . . . .\n", - ". . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . T T . . . . .\n", - ". . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . T T . . . .\n", - ". . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . T T T . .\n", - ". . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . T T T\n", - ". . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . T\n", - ". . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . T\n", - ". . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . T\n", - ". . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . T\n", - ". . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . T\n", - ". . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . T\n", - ". . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . T\n", - "FCgcGdDEgebbEhBCCgEcehHDAFBebgGECehcgdfdadbeggEgFCfggGAGaAhEEHfAgGAGHeFdaDfEcbfGcBDEbHdEaaFdfBBCABHC\n" + ". . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . T T . . . . . . . . . . . . . . .\n", + ". . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . T T T T . . . . . . . . . . . .\n", + ". . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . T . . . . . . . . . . . . .\n", + ". . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . T T T T T T . . . . . . . .\n", + ". . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . T T . . . . . . .\n", + ". . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . T T . . . . . . .\n", + ". . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . T T T . . . . . .\n", + ". . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . T . . . . . . .\n", + ". . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . T T T T T . . .\n", + ". . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . T T . T T . . .\n", + ". . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . T . . T . . . .\n", + ". . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . T T T T T\n", + "acGcfcfFbdCaCBabcaGbbbegEGEGAdCfCfFCGfEEHBGChAcFCHgGcBefbFdDFBdGGBegCgAChHFgfDFdgcgdAcCCFBffcFFBfdcd\n" ] }, { @@ -1521,7 +1517,7 @@ "True" ] }, - "execution_count": 148, + "execution_count": 27, "metadata": {}, "output_type": "execute_result" } @@ -1535,7 +1531,7 @@ }, { "cell_type": "code", - "execution_count": 115, + "execution_count": 28, "metadata": {}, "outputs": [ { @@ -1544,7 +1540,7 @@ "True" ] }, - "execution_count": 115, + "execution_count": 28, "metadata": {}, "output_type": "execute_result" } @@ -1555,16 +1551,16 @@ }, { "cell_type": "code", - "execution_count": 149, + "execution_count": 29, "metadata": {}, "outputs": [ { "data": { "text/plain": [ - "('hchdchbfgbfhfcadcdehgebefhebedbdadfbbcdadfgbefebeb', False, False)" + "('adadhfgacgbahfchffghdfffcfcdccchedahggdffhgbacghbe', False, False)" ] }, - "execution_count": 149, + "execution_count": 29, "metadata": {}, "output_type": "execute_result" } @@ -1576,17 +1572,14 @@ }, { "cell_type": "code", - "execution_count": 150, + "execution_count": 30, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ - "T . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .\n", - "T . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .\n", - "T . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .\n", - "T . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .\n", + "T T . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .\n", ". . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .\n", ". . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .\n", ". . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .\n", @@ -1634,7 +1627,10 @@ ". . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .\n", ". . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .\n", ". . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .\n", - "FCG\n" + ". . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .\n", + ". . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .\n", + ". . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .\n", + "a\n" ] }, { @@ -1643,7 +1639,7 @@ "False" ] }, - "execution_count": 150, + "execution_count": 30, "metadata": {}, "output_type": "execute_result" } @@ -1664,7 +1660,7 @@ }, { "cell_type": "code", - "execution_count": 174, + "execution_count": 31, "metadata": { "collapsed": true }, @@ -1677,7 +1673,7 @@ }, { "cell_type": "code", - "execution_count": 195, + "execution_count": 32, "metadata": { "collapsed": true }, @@ -1703,16 +1699,16 @@ }, { "cell_type": "code", - "execution_count": 203, + "execution_count": 33, "metadata": {}, "outputs": [ { "data": { "text/plain": [ - "('ddcbcaabac', 'abcaddcbcc', 'abddcbccaaadbadccbcc', 20)" + "('badbbdcadc', 'bdaadcadab', 'bdabaadbdcbadcaddacb', 20)" ] }, - "execution_count": 203, + "execution_count": 33, "metadata": {}, "output_type": "execute_result" } @@ -1727,27 +1723,27 @@ }, { "cell_type": "code", - "execution_count": 204, + "execution_count": 34, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ - "* a b . . . . . . . .\n", - ". . d . . . . . . . .\n", - ". . d c . . . . . . .\n", - ". . c . . . . . . . .\n", - ". . b c . . . . . . .\n", - ". . c c a . . . . . .\n", - ". . . a a . . . . . .\n", + "* b d a . . . . . . .\n", + "b . . b a . . . . . .\n", ". . . a a d . . . . .\n", - ". . . . . b . . . . .\n", - ". . . . . a d c . . .\n", - ". . . . . . c c b c c\n", - "abDDCBcCaAAdBAdcCbcc\n", - "abddcbccaaadbadccbcc\n", - " **** * ** ** * \n" + ". . . . d . . . . . .\n", + ". . . . b d c . . . .\n", + ". . . . . . b a d . .\n", + ". . . . . . . d . . .\n", + ". . . . . . . c . . .\n", + ". . . . . . . a d . .\n", + ". . . . . . . d d a .\n", + ". . . . . . . . . c b\n", + "bdaBaADBdcBaDCAdDaCb\n", + "bdabaadbdcbadcaddacb\n", + " * *** * *** * * \n" ] }, { @@ -1756,7 +1752,7 @@ "True" ] }, - "execution_count": 204, + "execution_count": 34, "metadata": {}, "output_type": "execute_result" } @@ -1771,7 +1767,7 @@ }, { "cell_type": "code", - "execution_count": 198, + "execution_count": 35, "metadata": {}, "outputs": [ { @@ -1779,19 +1775,19 @@ "output_type": "stream", "text": [ "* b . . . . . . . . .\n", - "b b c a . . . . . . .\n", - ". c . c . . . . . . .\n", - ". a c . . . . . . . .\n", - ". . b . . . . . . . .\n", - ". . d a a . . . . . .\n", - ". . a a . . . . . . .\n", - ". . . d a . . . . . .\n", - ". . . . b a d a . . .\n", - ". . . . . . . c . . .\n", - ". . . . . . . c b b b\n", - "bBCAcBDaADaBadaCCbbb\n", - "bbcacbdaadabadaccbbb\n", - " *** ** ** * ** \n" + "b . . . . . . . . . .\n", + "d . . . . . . . . . .\n", + "a b a . . . . . . . .\n", + ". a a d b . . . . . .\n", + ". . d . d . . . . . .\n", + ". . . . c b . . . . .\n", + ". . . . . a d c a d .\n", + ". . . . . d . . d d .\n", + ". . . . . . . . . a c\n", + ". . . . . . . . . . b\n", + "BDAbaAdbDCbAdcadDAcB\n", + "bdabaadbdcbadcaddacb\n", + "*** * ** * ** *\n" ] }, { @@ -1800,7 +1796,7 @@ "True" ] }, - "execution_count": 198, + "execution_count": 35, "metadata": {}, "output_type": "execute_result" } @@ -1815,17 +1811,15 @@ }, { "cell_type": "code", - "execution_count": 199, + "execution_count": 36, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ - "* b . . . . . . . . .\n", - "b b c . . . . . . . .\n", - ". c . . . . . . . . .\n", - ". a c . . . . . . . .\n", + "* . . . . . . . . . .\n", + "b . . . . . . . . . .\n", ". . . . . . . . . . .\n", ". . . . . . . . . . .\n", ". . . . . . . . . . .\n", @@ -1833,9 +1827,11 @@ ". . . . . . . . . . .\n", ". . . . . . . . . . .\n", ". . . . . . . . . . .\n", - "bBCAc\n", - "bbcac\n", - " *** \n" + ". . . . . . . . . . .\n", + ". . . . . . . . . . .\n", + "B\n", + "b\n", + "*\n" ] }, { @@ -1844,7 +1840,7 @@ "False" ] }, - "execution_count": 199, + "execution_count": 36, "metadata": {}, "output_type": "execute_result" } @@ -1859,27 +1855,26 @@ }, { "cell_type": "code", - "execution_count": 200, + "execution_count": 37, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ - "* b . . . . . . . . .\n", - "b b c . . . . . . . .\n", - ". c . . . . . . . . .\n", - ". a c . . . . . . . .\n", - ". . b . . . . . . . .\n", - ". . d . . . . . . . .\n", - ". . a . . . . . . . .\n", + "* . . . . . . . . . .\n", + "b . . . . . . . . . .\n", + "d a . . . . . . . . .\n", + "a . . . . . . . . . .\n", + ". . . . . . . . . . .\n", + ". . . . . . . . . . .\n", + ". . . . . . . . . . .\n", ". . . . . . . . . . .\n", ". . . . . . . . . . .\n", ". . . . . . . . . . .\n", ". . . . . . . . . . .\n", - "bBCAcBDA\n", - "bbcacbda\n", - " *** ***\n" + "\n", + "\n" ] }, { @@ -1888,7 +1883,7 @@ "False" ] }, - "execution_count": 200, + "execution_count": 37, "metadata": {}, "output_type": "execute_result" } diff --git a/09-resolving-the-bill/subsequence.ipynb b/09-resolving-the-bill/subsequence.ipynb index c945df8..4484bfb 100644 --- a/09-resolving-the-bill/subsequence.ipynb +++ b/09-resolving-the-bill/subsequence.ipynb @@ -19,7 +19,7 @@ }, { "cell_type": "code", - "execution_count": 54, + "execution_count": 1, "metadata": { "collapsed": true }, @@ -41,7 +41,7 @@ }, { "cell_type": "code", - "execution_count": 4, + "execution_count": 2, "metadata": { "scrolled": true }, @@ -117,7 +117,7 @@ " (5, 10): False}" ] }, - "execution_count": 4, + "execution_count": 2, "metadata": {}, "output_type": "execute_result" } @@ -131,7 +131,7 @@ }, { "cell_type": "code", - "execution_count": 5, + "execution_count": 3, "metadata": { "collapsed": true }, @@ -145,7 +145,7 @@ }, { "cell_type": "code", - "execution_count": 6, + "execution_count": 4, "metadata": {}, "outputs": [ { @@ -167,7 +167,7 @@ }, { "cell_type": "code", - "execution_count": 47, + "execution_count": 5, "metadata": {}, "outputs": [ { @@ -244,7 +244,7 @@ " (4, 7): (4, 6, 'b', 's2')}" ] }, - "execution_count": 47, + "execution_count": 5, "metadata": {}, "output_type": "execute_result" } @@ -288,7 +288,7 @@ }, { "cell_type": "code", - "execution_count": 59, + "execution_count": 13, "metadata": { "collapsed": true }, @@ -299,7 +299,7 @@ " j = max([0] + [k[1] for k in bps])\n", " chars = ''\n", " if (i, j) in bps:\n", - " while i != 0 or j != 0:\n", + " while i != 0 and j != 0:\n", " if bps[i, j][3] == 's1':\n", " chars += bps[i, j][2].upper()\n", " else:\n", @@ -312,7 +312,7 @@ }, { "cell_type": "code", - "execution_count": 60, + "execution_count": 7, "metadata": {}, "outputs": [ { @@ -321,7 +321,7 @@ "'AAAbAbb'" ] }, - "execution_count": 60, + "execution_count": 7, "metadata": {}, "output_type": "execute_result" } @@ -332,11 +332,90 @@ }, { "cell_type": "code", - "execution_count": 49, + "execution_count": 28, "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "aa 0 0 ! ! True\n", + "aa 0 1 ! ! True\n", + "aa 0 2 ! ! True\n", + "aa 0 3 ! ! True\n", + "aa 0 4 ! ! True\n", + "aa 0 5 ! ! True\n", + "aa 0 6 ! ! True\n", + "aa 0 7 ! ! True\n", + "aa 0 8 ! ! True\n", + "aa 0 9 ! ! True\n", + "aa 0 10 ! ! True\n", + "xx 1 1 a d False\n", + "s1 1 2 a a True\n", + "s2 1 3 a b True\n", + "s2 1 4 a a True\n", + "s1 1 4 a a True\n", + "s2 1 5 a a True\n", + "s1 1 5 a a True\n", + "s2 1 6 a b True\n", + "s2 1 7 a c True\n", + "s2 1 8 a a True\n", + "s1 1 8 a a True\n", + "s2 1 9 a c True\n", + "s2 1 10 a b True\n", + "xx 2 2 a a False\n", + "xx 2 3 a b False\n", + "s1 2 4 a a True\n", + "s2 2 5 a a True\n", + "s1 2 5 a a True\n", + "s2 2 6 a b True\n", + "s2 2 7 a c True\n", + "s2 2 8 a a True\n", + "s1 2 8 a a True\n", + "s2 2 9 a c True\n", + "s2 2 10 a b True\n", + "xx 3 3 a b False\n", + "xx 3 4 a a False\n", + "s1 3 5 a a True\n", + "s2 3 6 a b True\n", + "s2 3 7 a c True\n", + "s2 3 8 a a True\n", + "s1 3 8 a a True\n", + "s2 3 9 a c True\n", + "s2 3 10 a b True\n", + "xx 4 4 a a False\n", + "xx 4 5 a a False\n", + "xx 4 6 a b False\n", + "xx 4 7 a c False\n", + "s1 4 8 a a True\n", + "s2 4 9 a c True\n", + "s2 4 10 a b True\n" + ] + }, + { + "data": { + "text/plain": [ + "True" + ] + }, + "execution_count": 28, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "is_subseq(s1, s2t, debug=True)" + ] + }, + { + "cell_type": "code", + "execution_count": 27, + "metadata": { + "collapsed": true + }, "outputs": [], "source": [ - "def is_subseq(seq1, seq2, return_backpointers=False, debug=False):\n", + "def is_subseq(seq1, seq2, return_backpointers=False, return_table=False, debug=False):\n", " \"\"\"Return true if seq1 is a subsequence of seq2.\n", " If return_backpointers, also return the set of backpointers to\n", " reconstruct the subsequence\"\"\"\n", @@ -369,15 +448,38 @@ " if not dp_table[i, j]:\n", " if debug: print('xx', i, j, seq1[i-1], seq2[j-1], dp_table[i, j]) \n", " \n", - " if return_backpointers:\n", - " return dp_table[len(seq1), len(seq2)], backpointers\n", + "# if return_backpointers:\n", + "# return dp_table[len(seq1), len(seq2)], backpointers\n", + "# else:\n", + "# return dp_table[len(seq1), len(seq2)]\n", + " \n", + " if return_backpointers or return_table:\n", + " retval = [dp_table[len(seq1), len(seq2)]]\n", + " if return_backpointers:\n", + " retval += [backpointers]\n", + " if return_table:\n", + " retval += [dp_table]\n", + " return tuple(retval)\n", " else:\n", " return dp_table[len(seq1), len(seq2)]" ] }, { "cell_type": "code", - "execution_count": 39, + "execution_count": 37, + "metadata": { + "collapsed": true + }, + "outputs": [], + "source": [ + "def show_annotated_table(table, bps):\n", + " return '\\n'.join(' '.join('.' if (i, j) not in bps else bps[i, j][2] if table[i, j] else '.' for j in sorted(set([k[1] for k in table])))\n", + " for i in sorted(set([k[0] for k in table])))" + ] + }, + { + "cell_type": "code", + "execution_count": 29, "metadata": {}, "outputs": [ { @@ -386,155 +488,176 @@ "True" ] }, - "execution_count": 39, + "execution_count": 29, "metadata": {}, "output_type": "execute_result" } ], "source": [ - "is_subseq(s1, s2t)" + "tf, bps, tb = is_subseq(s1, s2t, return_backpointers=True, return_table=True)\n", + "tf" ] }, { "cell_type": "code", - "execution_count": 55, + "execution_count": 20, "metadata": {}, "outputs": [ { "data": { "text/plain": [ - "True" + "'AbAAbcAcb'" ] }, - "execution_count": 55, + "execution_count": 20, "metadata": {}, "output_type": "execute_result" } ], "source": [ - "tf, bps = is_subseq(s1, s2t, return_backpointers=True)\n", - "tf" + "show_backtrace(bps)" + ] + }, + { + "cell_type": "code", + "execution_count": 32, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "T T T T T T T T T T T\n", + "F F T T T T T T T T T\n", + "F F F F T T T T T T T\n", + "F F F F F T T T T T T\n", + "F F F F F F F F T T T\n" + ] + } + ], + "source": [ + "print(show_table(tb))" + ] + }, + { + "cell_type": "code", + "execution_count": 38, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + ". . . . . . . . . . .\n", + ". . a b a a b c a c b\n", + ". . . . a a b c a c b\n", + ". . . . . a b c a c b\n", + ". . . . . . . . a c b\n" + ] + } + ], + "source": [ + "print(show_annotated_table(tb, bps))" ] }, { "cell_type": "code", - "execution_count": 56, + "execution_count": 21, "metadata": {}, "outputs": [ { "data": { "text/plain": [ - "'AABCaCb'" + "False" ] }, - "execution_count": 56, + "execution_count": 21, "metadata": {}, "output_type": "execute_result" } ], "source": [ - "show_backtrace(bps)" + "len(show_backtrace(bps)) == len(s2t)" ] }, { "cell_type": "code", - "execution_count": 42, + "execution_count": 24, "metadata": {}, "outputs": [ { "data": { "text/plain": [ - "False" + "('aaaa', 'dabaabcacb')" ] }, - "execution_count": 42, + "execution_count": 24, "metadata": {}, "output_type": "execute_result" } ], "source": [ - "is_subseq(s1, s2f)" + "s1, s2t" ] }, { "cell_type": "code", - "execution_count": 43, + "execution_count": 23, "metadata": {}, "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "aa 0 0 ! ! True\n", - "aa 0 1 ! ! True\n", - "aa 0 2 ! ! True\n", - "aa 0 3 ! ! True\n", - "aa 0 4 ! ! True\n", - "aa 0 5 ! ! True\n", - "aa 0 6 ! ! True\n", - "aa 0 7 ! ! True\n", - "s1 1 1 a a True\n", - "s2 1 2 a a True\n", - "s1 1 2 a a True\n", - "s2 1 3 a a True\n", - "s1 1 3 a a True\n", - "s2 1 4 a b True\n", - "s2 1 5 a a True\n", - "s1 1 5 a a True\n", - "s2 1 6 a b True\n", - "s2 1 7 a b True\n", - "s1 2 2 a a True\n", - "s2 2 3 a a True\n", - "s1 2 3 a a True\n", - "s2 2 4 a b True\n", - "s2 2 5 a a True\n", - "s1 2 5 a a True\n", - "s2 2 6 a b True\n", - "s2 2 7 a b True\n", - "s1 3 3 a a True\n", - "s2 3 4 a b True\n", - "s2 3 5 a a True\n", - "s1 3 5 a a True\n", - "s2 3 6 a b True\n", - "s2 3 7 a b True\n", - "xx 4 4 a b False\n", - "s1 4 5 a a True\n", - "s2 4 6 a b True\n", - "s2 4 7 a b True\n" - ] - }, { "data": { "text/plain": [ - "(True,\n", - " {(1, 1): (0, 1, 'a', 's1'),\n", - " (1, 2): (0, 2, 'a', 's1'),\n", - " (1, 3): (0, 3, 'a', 's1'),\n", - " (1, 4): (1, 3, 'b', 's2'),\n", - " (1, 5): (0, 5, 'a', 's1'),\n", - " (1, 6): (1, 5, 'b', 's2'),\n", - " (1, 7): (1, 6, 'b', 's2'),\n", - " (2, 2): (1, 2, 'a', 's1'),\n", - " (2, 3): (1, 3, 'a', 's1'),\n", - " (2, 4): (2, 3, 'b', 's2'),\n", - " (2, 5): (1, 5, 'a', 's1'),\n", - " (2, 6): (2, 5, 'b', 's2'),\n", - " (2, 7): (2, 6, 'b', 's2'),\n", - " (3, 3): (2, 3, 'a', 's1'),\n", - " (3, 4): (3, 3, 'b', 's2'),\n", - " (3, 5): (2, 5, 'a', 's1'),\n", - " (3, 6): (3, 5, 'b', 's2'),\n", - " (3, 7): (3, 6, 'b', 's2'),\n", - " (4, 5): (3, 5, 'a', 's1'),\n", - " (4, 6): (4, 5, 'b', 's2'),\n", - " (4, 7): (4, 6, 'b', 's2')})" + "{(1, 2): (0, 1, 'a', 's1'),\n", + " (1, 3): (1, 2, 'b', 's2'),\n", + " (1, 4): (0, 3, 'a', 's1'),\n", + " (1, 5): (0, 4, 'a', 's1'),\n", + " (1, 6): (1, 5, 'b', 's2'),\n", + " (1, 7): (1, 6, 'c', 's2'),\n", + " (1, 8): (0, 7, 'a', 's1'),\n", + " (1, 9): (1, 8, 'c', 's2'),\n", + " (1, 10): (1, 9, 'b', 's2'),\n", + " (2, 4): (1, 3, 'a', 's1'),\n", + " (2, 5): (1, 4, 'a', 's1'),\n", + " (2, 6): (2, 5, 'b', 's2'),\n", + " (2, 7): (2, 6, 'c', 's2'),\n", + " (2, 8): (1, 7, 'a', 's1'),\n", + " (2, 9): (2, 8, 'c', 's2'),\n", + " (2, 10): (2, 9, 'b', 's2'),\n", + " (3, 5): (2, 4, 'a', 's1'),\n", + " (3, 6): (3, 5, 'b', 's2'),\n", + " (3, 7): (3, 6, 'c', 's2'),\n", + " (3, 8): (2, 7, 'a', 's1'),\n", + " (3, 9): (3, 8, 'c', 's2'),\n", + " (3, 10): (3, 9, 'b', 's2'),\n", + " (4, 8): (3, 7, 'a', 's1'),\n", + " (4, 9): (4, 8, 'c', 's2'),\n", + " (4, 10): (4, 9, 'b', 's2')}" ] }, - "execution_count": 43, + "execution_count": 23, "metadata": {}, "output_type": "execute_result" } ], + "source": [ + "bps" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "is_subseq(s1, s2f)" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], "source": [ "is_subseq('aaaa', 'aaababb', return_backpointers=True, debug=True)" ]