Updated notebooks for new library organisation
[cipher-tools.git] / 2015 / 2015-challenge4.ipynb
index f2a1c9d594d0c13bf4925e8d72cf42ba62cad6f2..3d00e6ebe4aade197668bfbf607ebffdc79c1696 100644 (file)
@@ -2,10 +2,8 @@
  "cells": [
   {
    "cell_type": "code",
-   "execution_count": 1,
-   "metadata": {
-    "collapsed": false
-   },
+   "execution_count": 14,
+   "metadata": {},
    "outputs": [],
    "source": [
     "import os,sys,inspect\n",
     "import matplotlib.pyplot as plt\n",
     "%matplotlib inline\n",
     "\n",
-    "from cipherbreak import *\n",
+    "from cipher.keyword_cipher import *\n",
+    "from support.utilities import *\n",
+    "from support.text_prettify import *\n",
+    "from support.language_models import *\n",
     "\n",
     "c4a = open('4a.ciphertext').read()\n",
     "c4b = open('4b.ciphertext').read()"
@@ -25,9 +26,7 @@
   {
    "cell_type": "code",
    "execution_count": 2,
-   "metadata": {
-    "collapsed": false
-   },
+   "metadata": {},
    "outputs": [
     {
      "data": {
@@ -48,9 +47,7 @@
   {
    "cell_type": "code",
    "execution_count": 3,
-   "metadata": {
-    "collapsed": false
-   },
+   "metadata": {},
    "outputs": [
     {
      "name": "stdout",
@@ -68,9 +65,7 @@
   {
    "cell_type": "code",
    "execution_count": 4,
-   "metadata": {
-    "collapsed": false
-   },
+   "metadata": {},
    "outputs": [
     {
      "data": {
   {
    "cell_type": "code",
    "execution_count": 5,
-   "metadata": {
-    "collapsed": false
-   },
+   "metadata": {},
    "outputs": [
     {
      "data": {
   {
    "cell_type": "code",
    "execution_count": 6,
-   "metadata": {
-    "collapsed": false
-   },
+   "metadata": {},
    "outputs": [
     {
      "name": "stdout",
   {
    "cell_type": "code",
    "execution_count": 7,
-   "metadata": {
-    "collapsed": false
-   },
+   "metadata": {},
    "outputs": [
     {
      "data": {
   {
    "cell_type": "code",
    "execution_count": 8,
-   "metadata": {
-    "collapsed": false
-   },
+   "metadata": {},
    "outputs": [
     {
      "name": "stdout",
   {
    "cell_type": "code",
    "execution_count": 9,
-   "metadata": {
-    "collapsed": false
-   },
+   "metadata": {},
    "outputs": [
     {
      "data": {
   },
   {
    "cell_type": "code",
-   "execution_count": 11,
-   "metadata": {
-    "collapsed": false
-   },
+   "execution_count": 16,
+   "metadata": {},
    "outputs": [
-    {
-     "name": "stdout",
-     "output_type": "stream",
-     "text": [
-      "0 remniatsuvwxyzbcdfghjklopq -1262.9588058797406 hgfaoju, sgu fssfhgux qesu yft ouzs jq equ ez pc xufx xaemt ofts qjigs fqx fmmufat se ru zaep eva pctsuajevt tevahu. js heqsfjqt sye aufooc tjiqjzjhfqs mjuhut ez jqsuoojiuqhu. sgu zjats jt sgfs sgu ajuhgtxelsea pjigs qes auzua se fq jqxjwjxvfo fzsua foo. js tuupt se ru sgu hexuqfpu zea sgu eaifqjdfsjeq avqqjqi sgu afsojqut. fhheaxjqi se pc esgua tevahut sgjt jt f heoouhsjeq ez aevsut, fiuqst fqx tfzu gevtut vtux se safqtmeas qfdj tcpmfsgjtuat fqx yfa hajpjqfot evs ez iuapfqc fqx eq se tevsg fpuajhf. yu gfwu lqeyq sgfs tvhg fq eaifqjtfsjeq ubjtst tjqhu sgu uqx ez sgu yfa, rvs sgjt jt sgu zjats sjpu j gfwu tuuq js qfpux. sgu esgua mjuhu ez jqzeapfsjeq jt pvhg peau tvrsou. j fp ruijqqjqi se yeqxua jz eva tevahu jt hoetua se gepu sgfq yu gfx aufojtux. fqx j fp qes auzuaajqi se zafqhejt! tuu jz cev hfq tmes sgu sye sgjqit j qesjhux. rc sgu yfc, yge safqthajrux sgu afxje jqsuahums cev tuqs pu ofts yuul? gfaac\n",
-      "\n",
-      "1 remniatsuvwxyzbcdfghokljpq -1178.441293417976 hgfajou, sgu fssfhgux qesu yft juzs oq equ ez pc xufx xaemt jfts qoigs fqx fmmufat se ru zaep eva pctsuaoevt tevahu. os heqsfoqt sye aufjjc toiqozohfqs mouhut ez oqsujjoiuqhu. sgu zoats ot sgfs sgu aouhgtxelsea poigs qes auzua se fq oqxowoxvfj fzsua fjj. os tuupt se ru sgu hexuqfpu zea sgu eaifqodfsoeq avqqoqi sgu afsjoqut. fhheaxoqi se pc esgua tevahut sgot ot f hejjuhsoeq ez aevsut, fiuqst fqx tfzu gevtut vtux se safqtmeas qfdo tcpmfsgotuat fqx yfa haopoqfjt evs ez iuapfqc fqx eq se tevsg fpuaohf. yu gfwu lqeyq sgfs tvhg fq eaifqotfsoeq ubotst toqhu sgu uqx ez sgu yfa, rvs sgot ot sgu zoats sopu o gfwu tuuq os qfpux. sgu esgua mouhu ez oqzeapfsoeq ot pvhg peau tvrsju. o fp ruioqqoqi se yeqxua oz eva tevahu ot hjetua se gepu sgfq yu gfx aufjotux. fqx o fp qes auzuaaoqi se zafqheot! tuu oz cev hfq tmes sgu sye sgoqit o qesohux. rc sgu yfc, yge safqthaorux sgu afxoe oqsuahums cev tuqs pu jfts yuul? gfaac\n",
-      "\n",
-      "2 cemniatsuvwxyzbrdfghokljpq -1176.749704780956 hgfajou, sgu fssfhgux qesu yft juzs oq equ ez pr xufx xaemt jfts qoigs fqx fmmufat se cu zaep eva prtsuaoevt tevahu. os heqsfoqt sye aufjjr toiqozohfqs mouhut ez oqsujjoiuqhu. sgu zoats ot sgfs sgu aouhgtxelsea poigs qes auzua se fq oqxowoxvfj fzsua fjj. os tuupt se cu sgu hexuqfpu zea sgu eaifqodfsoeq avqqoqi sgu afsjoqut. fhheaxoqi se pr esgua tevahut sgot ot f hejjuhsoeq ez aevsut, fiuqst fqx tfzu gevtut vtux se safqtmeas qfdo trpmfsgotuat fqx yfa haopoqfjt evs ez iuapfqr fqx eq se tevsg fpuaohf. yu gfwu lqeyq sgfs tvhg fq eaifqotfsoeq ubotst toqhu sgu uqx ez sgu yfa, cvs sgot ot sgu zoats sopu o gfwu tuuq os qfpux. sgu esgua mouhu ez oqzeapfsoeq ot pvhg peau tvcsju. o fp cuioqqoqi se yeqxua oz eva tevahu ot hjetua se gepu sgfq yu gfx aufjotux. fqx o fp qes auzuaaoqi se zafqheot! tuu oz rev hfq tmes sgu sye sgoqit o qesohux. cr sgu yfr, yge safqthaocux sgu afxoe oqsuahums rev tuqs pu jfts yuul? gfaar\n",
-      "\n",
-      "3 vemniatsucwxyzbrdfghokljpq -1172.734320973362 hgfajou, sgu fssfhgux qesu yft juzs oq equ ez pr xufx xaemt jfts qoigs fqx fmmufat se vu zaep eca prtsuaoect tecahu. os heqsfoqt sye aufjjr toiqozohfqs mouhut ez oqsujjoiuqhu. sgu zoats ot sgfs sgu aouhgtxelsea poigs qes auzua se fq oqxowoxcfj fzsua fjj. os tuupt se vu sgu hexuqfpu zea sgu eaifqodfsoeq acqqoqi sgu afsjoqut. fhheaxoqi se pr esgua tecahut sgot ot f hejjuhsoeq ez aecsut, fiuqst fqx tfzu gectut ctux se safqtmeas qfdo trpmfsgotuat fqx yfa haopoqfjt ecs ez iuapfqr fqx eq se tecsg fpuaohf. yu gfwu lqeyq sgfs tchg fq eaifqotfsoeq ubotst toqhu sgu uqx ez sgu yfa, vcs sgot ot sgu zoats sopu o gfwu tuuq os qfpux. sgu esgua mouhu ez oqzeapfsoeq ot pchg peau tcvsju. o fp vuioqqoqi se yeqxua oz eca tecahu ot hjetua se gepu sgfq yu gfx aufjotux. fqx o fp qes auzuaaoqi se zafqheot! tuu oz rec hfq tmes sgu sye sgoqit o qesohux. vr sgu yfr, yge safqthaovux sgu afxoe oqsuahums rec tuqs pu jfts yuul? gfaar\n",
-      "\n",
-      "10 vfmniatsulxpyzcrdbgqokejwh -1138.6987012040154 qgbajou, sgu bssbqgup hfsu ybt juzs oh fhu fz wr pubp pafmt jbts hoigs bhp bmmubat sf vu zafw fla wrtsuaoflt tflaqu. os qfhsboht syf aubjjr toihozoqbhs mouqut fz ohsujjoiuhqu. sgu zoats ot sgbs sgu aouqgtpfesfa woigs hfs auzua sf bh ohpoxoplbj bzsua bjj. os tuuwt sf vu sgu qfpuhbwu zfa sgu faibhodbsofh alhhohi sgu absjohut. bqqfapohi sf wr fsgua tflaqut sgot ot b qfjjuqsofh fz aflsut, biuhst bhp tbzu gfltut ltup sf sabhtmfas hbdo trwmbsgotuat bhp yba qaowohbjt fls fz iuawbhr bhp fh sf tflsg bwuaoqb. yu gbxu ehfyh sgbs tlqg bh faibhotbsofh ucotst tohqu sgu uhp fz sgu yba, vls sgot ot sgu zoats sowu o gbxu tuuh os hbwup. sgu fsgua mouqu fz ohzfawbsofh ot wlqg wfau tlvsju. o bw vuiohhohi sf yfhpua oz fla tflaqu ot qjftua sf gfwu sgbh yu gbp aubjotup. bhp o bw hfs auzuaaohi sf zabhqfot! tuu oz rfl qbh tmfs sgu syf sgohit o hfsoqup. vr sgu ybr, ygf sabhtqaovup sgu abpof ohsuaqums rfl tuhs wu jbts yuue? gbaar\n",
-      "\n",
-      "20 vfyniadsgkxpwzmcqhutolejrb -1125.2537605606442 tuhajog, sug hsshtugp bfsg whd jgzs ob fbg fz rc pghp pafyd jhds boius hbp hyyghad sf vg zafr fka rcdsgaofkd dfkatg. os tfbshobd swf aghjjc doibozothbs yogtgd fz obsgjjoigbtg. sug zoads od suhs sug aogtudpfesfa roius bfs agzga sf hb obpoxopkhj hzsga hjj. os dggrd sf vg sug tfpgbhrg zfa sug faihboqhsofb akbbobi sug ahsjobgd. httfapobi sf rc fsuga dfkatgd suod od h tfjjgtsofb fz afksgd, higbsd hbp dhzg ufkdgd kdgp sf sahbdyfas bhqo dcryhsuodgad hbp wha taorobhjd fks fz igarhbc hbp fb sf dfksu hrgaoth. wg uhxg ebfwb suhs dktu hb faihbodhsofb gmodsd dobtg sug gbp fz sug wha, vks suod od sug zoads sorg o uhxg dggb os bhrgp. sug fsuga yogtg fz obzfarhsofb od rktu rfag dkvsjg. o hr vgiobbobi sf wfbpga oz fka dfkatg od tjfdga sf ufrg suhb wg uhp aghjodgp. hbp o hr bfs agzgaaobi sf zahbtfod! dgg oz cfk thb dyfs sug swf suobid o bfsotgp. vc sug whc, wuf sahbdtaovgp sug ahpof obsgatgys cfk dgbs rg jhds wgge? uhaac\n",
-      "\n",
-      "41 cfjowbdsexuikqmryngtalpzhv -1124.2920779257197 tgnbzae, sge nssntgei vfse knd zeqs av fve fq hr ieni ibfjd znds vawgs nvi njjenbd sf ce qbfh fxb hrdsebafxd dfxbte. as tfvsnavd skf benzzr dawvaqatnvs jaeted fq avsezzawevte. sge qabds ad sgns sge baetgdifpsfb hawgs vfs beqeb sf nv aviauaixnz nqseb nzz. as deehd sf ce sge tfievnhe qfb sge fbwnvaynsafv bxvvavw sge bnszaved. nttfbiavw sf hr fsgeb dfxbted sgad ad n tfzzetsafv fq bfxsed, nwevsd nvi dnqe gfxded xdei sf sbnvdjfbs vnya drhjnsgadebd nvi knb tbahavnzd fxs fq webhnvr nvi fv sf dfxsg nhebatn. ke gnue pvfkv sgns dxtg nv fbwnvadnsafv emadsd davte sge evi fq sge knb, cxs sgad ad sge qabds sahe a gnue deev as vnhei. sge fsgeb jaete fq avqfbhnsafv ad hxtg hfbe dxcsze. a nh cewavvavw sf kfvieb aq fxb dfxbte ad tzfdeb sf gfhe sgnv ke gni benzadei. nvi a nh vfs beqebbavw sf qbnvtfad! dee aq rfx tnv djfs sge skf sgavwd a vfsatei. cr sge knr, kgf sbnvdtbacei sge bniaf avsebtejs rfx devs he znds keep? gnbbr\n",
-      "\n",
-      "42 cfjzwbdsexuikqmryngtalpohv -1085.6036078813306 tgnboae, sge nssntgei vfse knd oeqs av fve fq hr ieni ibfjd onds vawgs nvi njjenbd sf ce qbfh fxb hrdsebafxd dfxbte. as tfvsnavd skf benoor dawvaqatnvs jaeted fq avseooawevte. sge qabds ad sgns sge baetgdifpsfb hawgs vfs beqeb sf nv aviauaixno nqseb noo. as deehd sf ce sge tfievnhe qfb sge fbwnvaynsafv bxvvavw sge bnsoaved. nttfbiavw sf hr fsgeb dfxbted sgad ad n tfooetsafv fq bfxsed, nwevsd nvi dnqe gfxded xdei sf sbnvdjfbs vnya drhjnsgadebd nvi knb tbahavnod fxs fq webhnvr nvi fv sf dfxsg nhebatn. ke gnue pvfkv sgns dxtg nv fbwnvadnsafv emadsd davte sge evi fq sge knb, cxs sgad ad sge qabds sahe a gnue deev as vnhei. sge fsgeb jaete fq avqfbhnsafv ad hxtg hfbe dxcsoe. a nh cewavvavw sf kfvieb aq fxb dfxbte ad tofdeb sf gfhe sgnv ke gni benoadei. nvi a nh vfs beqebbavw sf qbnvtfad! dee aq rfx tnv djfs sge skf sgavwd a vfsatei. cr sge knr, kgf sbnvdtbacei sge bniaf avsebtejs rfx devs he onds keep? gnbbr\n",
-      "\n",
-      "45 bvjzycdsexuikqmrwngtalpohf -1079.7756157738888 tgncoae, sge nssntgei fvse knd oeqs af vfe vq hr ieni icvjd onds faygs nfi njjencd sv be qcvh vxc hrdsecavxd dvxcte. as tvfsnafd skv cenoor dayfaqatnfs jaeted vq afseooayefte. sge qacds ad sgns sge caetgdivpsvc haygs fvs ceqec sv nf afiauaixno nqsec noo. as deehd sv be sge tviefnhe qvc sge vcynfawnsavf cxffafy sge cnsoafed. nttvciafy sv hr vsgec dvxcted sgad ad n tvooetsavf vq cvxsed, nyefsd nfi dnqe gvxded xdei sv scnfdjvcs fnwa drhjnsgadecd nfi knc tcahafnod vxs vq yechnfr nfi vf sv dvxsg nhecatn. ke gnue pfvkf sgns dxtg nf vcynfadnsavf emadsd dafte sge efi vq sge knc, bxs sgad ad sge qacds sahe a gnue deef as fnhei. sge vsgec jaete vq afqvchnsavf ad hxtg hvce dxbsoe. a nh beyaffafy sv kvfiec aq vxc dvxcte ad tovdec sv gvhe sgnf ke gni cenoadei. nfi a nh fvs ceqeccafy sv qcnftvad! dee aq rvx tnf djvs sge skv sgafyd a fvsatei. br sge knr, kgv scnfdtcabei sge cniav afsectejs rvx defs he onds keep? gnccr\n",
-      "\n",
-      "47 bvjzycdtexpikqmrwngsaluohf -1072.6883675689066 sgncoae, tge nttnsgei fvte knd oeqt af vfe vq hr ieni icvjd ondt faygt nfi njjencd tv be qcvh vxc hrdtecavxd dvxcse. at svftnafd tkv cenoor dayfaqasnft jaesed vq afteooayefse. tge qacdt ad tgnt tge caesgdivutvc haygt fvt ceqec tv nf afiapaixno nqtec noo. at deehd tv be tge sviefnhe qvc tge vcynfawntavf cxffafy tge cntoafed. nssvciafy tv hr vtgec dvxcsed tgad ad n svooestavf vq cvxted, nyeftd nfi dnqe gvxded xdei tv tcnfdjvct fnwa drhjntgadecd nfi knc scahafnod vxt vq yechnfr nfi vf tv dvxtg nhecasn. ke gnpe ufvkf tgnt dxsg nf vcynfadntavf emadtd dafse tge efi vq tge knc, bxt tgad ad tge qacdt tahe a gnpe deef at fnhei. tge vtgec jaese vq afqvchntavf ad hxsg hvce dxbtoe. a nh beyaffafy tv kvfiec aq vxc dvxcse ad sovdec tv gvhe tgnf ke gni cenoadei. nfi a nh fvt ceqeccafy tv qcnfsvad! dee aq rvx snf djvt tge tkv tgafyd a fvtasei. br tge knr, kgv tcnfdscabei tge cniav aftecsejt rvx deft he ondt keeu? gnccr\n",
-      "\n",
-      "50 brjzkcdtespiyqmvwngxaluohf -1048.0345619644993 xgncoae, tge nttnxgei frte ynd oeqt af rfe rq hv ieni icrjd ondt fakgt nfi njjencd tr be qcrh rsc hvdtecarsd drscxe. at xrftnafd tyr cenoov dakfaqaxnft jaexed rq afteooakefxe. tge qacdt ad tgnt tge caexgdirutrc hakgt frt ceqec tr nf afiapaisno nqtec noo. at deehd tr be tge xriefnhe qrc tge rcknfawntarf csffafk tge cntoafed. nxxrciafk tr hv rtgec drscxed tgad ad n xrooextarf rq crsted, nkeftd nfi dnqe grsded sdei tr tcnfdjrct fnwa dvhjntgadecd nfi ync xcahafnod rst rq kechnfv nfi rf tr drstg nhecaxn. ye gnpe ufryf tgnt dsxg nf rcknfadntarf emadtd dafxe tge efi rq tge ync, bst tgad ad tge qacdt tahe a gnpe deef at fnhei. tge rtgec jaexe rq afqrchntarf ad hsxg hrce dsbtoe. a nh bekaffafk tr yrfiec aq rsc drscxe ad xordec tr grhe tgnf ye gni cenoadei. nfi a nh frt ceqeccafk tr qcnfxrad! dee aq vrs xnf djrt tge tyr tgafkd a frtaxei. bv tge ynv, ygr tcnfdxcabei tge cniar aftecxejt vrs deft he ondt yeeu? gnccv\n",
-      "\n",
-      "52 vrjzkcdtespiyqmbwngxaluohf -1047.4217167696756 xgncoae, tge nttnxgei frte ynd oeqt af rfe rq hb ieni icrjd ondt fakgt nfi njjencd tr ve qcrh rsc hbdtecarsd drscxe. at xrftnafd tyr cenoob dakfaqaxnft jaexed rq afteooakefxe. tge qacdt ad tgnt tge caexgdirutrc hakgt frt ceqec tr nf afiapaisno nqtec noo. at deehd tr ve tge xriefnhe qrc tge rcknfawntarf csffafk tge cntoafed. nxxrciafk tr hb rtgec drscxed tgad ad n xrooextarf rq crsted, nkeftd nfi dnqe grsded sdei tr tcnfdjrct fnwa dbhjntgadecd nfi ync xcahafnod rst rq kechnfb nfi rf tr drstg nhecaxn. ye gnpe ufryf tgnt dsxg nf rcknfadntarf emadtd dafxe tge efi rq tge ync, vst tgad ad tge qacdt tahe a gnpe deef at fnhei. tge rtgec jaexe rq afqrchntarf ad hsxg hrce dsvtoe. a nh vekaffafk tr yrfiec aq rsc drscxe ad xordec tr grhe tgnf ye gni cenoadei. nfi a nh frt ceqeccafk tr qcnfxrad! dee aq brs xnf djrt tge tyr tgafkd a frtaxei. vb tge ynb, ygr tcnfdxcavei tge cniar aftecxejt brs deft he ondt yeeu? gnccb\n",
-      "\n",
-      "53 vrjzkcdtespiyqwbmngxaluohf -1047.3736493946644 xgncoae, tge nttnxgei frte ynd oeqt af rfe rq hb ieni icrjd ondt fakgt nfi njjencd tr ve qcrh rsc hbdtecarsd drscxe. at xrftnafd tyr cenoob dakfaqaxnft jaexed rq afteooakefxe. tge qacdt ad tgnt tge caexgdirutrc hakgt frt ceqec tr nf afiapaisno nqtec noo. at deehd tr ve tge xriefnhe qrc tge rcknfamntarf csffafk tge cntoafed. nxxrciafk tr hb rtgec drscxed tgad ad n xrooextarf rq crsted, nkeftd nfi dnqe grsded sdei tr tcnfdjrct fnma dbhjntgadecd nfi ync xcahafnod rst rq kechnfb nfi rf tr drstg nhecaxn. ye gnpe ufryf tgnt dsxg nf rcknfadntarf ewadtd dafxe tge efi rq tge ync, vst tgad ad tge qacdt tahe a gnpe deef at fnhei. tge rtgec jaexe rq afqrchntarf ad hsxg hrce dsvtoe. a nh vekaffafk tr yrfiec aq rsc drscxe ad xordec tr grhe tgnf ye gni cenoadei. nfi a nh frt ceqeccafk tr qcnfxrad! dee aq brs xnf djrt tge tyr tgafkd a frtaxei. vb tge ynb, ygr tcnfdxcavei tge cniar aftecxejt brs deft he ondt yeeu? gnccb\n",
-      "\n",
-      "56 zrjvkcdtespihqwbmngualxoyf -1026.091865606169 ugncoae, tge nttnugei frte hnd oeqt af rfe rq yb ieni icrjd ondt fakgt nfi njjencd tr ze qcry rsc ybdtecarsd drscue. at urftnafd thr cenoob dakfaqaunft jaeued rq afteooakefue. tge qacdt ad tgnt tge caeugdirxtrc yakgt frt ceqec tr nf afiapaisno nqtec noo. at deeyd tr ze tge uriefnye qrc tge rcknfamntarf csffafk tge cntoafed. nuurciafk tr yb rtgec drscued tgad ad n urooeutarf rq crsted, nkeftd nfi dnqe grsded sdei tr tcnfdjrct fnma dbyjntgadecd nfi hnc ucayafnod rst rq kecynfb nfi rf tr drstg nyecaun. he gnpe xfrhf tgnt dsug nf rcknfadntarf ewadtd dafue tge efi rq tge hnc, zst tgad ad tge qacdt taye a gnpe deef at fnyei. tge rtgec jaeue rq afqrcyntarf ad ysug yrce dsztoe. a ny zekaffafk tr hrfiec aq rsc drscue ad uordec tr grye tgnf he gni cenoadei. nfi a ny frt ceqeccafk tr qcnfurad! dee aq brs unf djrt tge thr tgafkd a frtauei. zb tge hnb, hgr tcnfducazei tge cniar aftecuejt brs deft ye ondt heex? gnccb\n",
-      "\n",
-      "59 zrjvkcatedpihqwbxnguslmoyf -1019.2155510698342 ugncose, tge nttnugei frte hna oeqt sf rfe rq yb ieni icrja onat fskgt nfi njjenca tr ze qcry rdc ybatecsrda ardcue. st urftnsfa thr cenoob askfsqsunft jseuea rq sfteooskefue. tge qscat sa tgnt tge cseugairmtrc yskgt frt ceqec tr nf sfispsidno nqtec noo. st aeeya tr ze tge uriefnye qrc tge rcknfsxntsrf cdffsfk tge cntosfea. nuurcisfk tr yb rtgec ardcuea tgsa sa n urooeutsrf rq crdtea, nkefta nfi anqe grdaea daei tr tcnfajrct fnxs abyjntgsaeca nfi hnc ucsysfnoa rdt rq kecynfb nfi rf tr ardtg nyecsun. he gnpe mfrhf tgnt adug nf rcknfsantsrf ewsata asfue tge efi rq tge hnc, zdt tgsa sa tge qscat tsye s gnpe aeef st fnyei. tge rtgec jseue rq sfqrcyntsrf sa ydug yrce adztoe. s ny zeksffsfk tr hrfiec sq rdc ardcue sa uoraec tr grye tgnf he gni cenosaei. nfi s ny frt ceqeccsfk tr qcnfursa! aee sq brd unf ajrt tge thr tgsfka s frtsuei. zb tge hnb, hgr tcnfaucszei tge cnisr sftecuejt brd aeft ye onat heem? gnccb\n",
-      "\n",
-      "63 zelvkcatrdpmhjwbxngusqioyf -1017.7604294276406 ugncosr, tgr nttnugrm fetr hna orjt sf efr ej yb mrnm mcela onat fskgt nfm nllrnca te zr jcey edc ybatrcseda aedcur. st ueftnsfa the crnoob askfsjsunft lsrura ej sftrooskrfur. tgr jscat sa tgnt tgr csrugameitec yskgt fet crjrc te nf sfmspsmdno njtrc noo. st arrya te zr tgr uemrfnyr jec tgr ecknfsxntsef cdffsfk tgr cntosfra. nuuecmsfk te yb etgrc aedcura tgsa sa n ueoorutsef ej cedtra, nkrfta nfm anjr gedara darm te tcnfalect fnxs abylntgsarca nfm hnc ucsysfnoa edt ej krcynfb nfm ef te aedtg nyrcsun. hr gnpr ifehf tgnt adug nf ecknfsantsef rwsata asfur tgr rfm ej tgr hnc, zdt tgsa sa tgr jscat tsyr s gnpr arrf st fnyrm. tgr etgrc lsrur ej sfjecyntsef sa ydug yecr adztor. s ny zrksffsfk te hefmrc sj edc aedcur sa uoearc te geyr tgnf hr gnm crnosarm. nfm s ny fet crjrccsfk te jcnfuesa! arr sj bed unf alet tgr the tgsfka s fetsurm. zb tgr hnb, hge tcnfaucszrm tgr cnmse sftrcurlt bed arft yr onat hrri? gnccb\n",
-      "\n",
-      "401 ytmpcnrhakvslzdfqigeoxwbju -1014.7565957992581 eginboa, hga ihhiegas utha lir bazh ou tua tz jf sais sntmr birh uocgh ius immainr ht ya zntj tkn jfrhanotkr rtknea. oh etuhiour hlt naibbf rocuozoeiuh moaear tz ouhabbocauea. hga zonrh or hgih hga noaegrstwhtn jocgh uth nazan ht iu ousovoskib izhan ibb. oh raajr ht ya hga etsauija ztn hga tnciuoqihotu nkuuouc hga nihbouar. ieetnsouc ht jf thgan rtknear hgor or i etbbaehotu tz ntkhar, icauhr ius riza gtkrar kras ht hniurmtnh uiqo rfjmihgoranr ius lin enojouibr tkh tz canjiuf ius tu ht rtkhg ijanoei. la giva wutlu hgih rkeg iu tnciuorihotu adorhr rouea hga aus tz hga lin, ykh hgor or hga zonrh hoja o giva raau oh uijas. hga thgan moaea tz ouztnjihotu or jkeg jtna rkyhba. o ij yacouuouc ht ltusan oz tkn rtknea or ebtran ht gtja hgiu la gis naiboras. ius o ij uth nazannouc ht zniuetor! raa oz ftk eiu rmth hga hlt hgoucr o uthoeas. yf hga lif, lgt hniurenoyas hga nisot ouhaneamh ftk rauh ja birh laaw? ginnf\n",
-      "\n",
-      "11879 jtlqogfshdxnbrcwzeamupkvyi -991.2276834904978 maegvuh, sah essemahn itsh bef vhrs ui tih tr yw nhen ngtlf vefs iuoas ein ellhegf st jh rgty tdg ywfshgutdf ftdgmh. us mtiseuif sbt ghevvw fuoiurumeis luhmhf tr uishvvuohimh. sah rugfs uf saes sah guhmafntkstg yuoas its ghrhg st ei uinuxundev ershg evv. us fhhyf st jh sah mtnhieyh rtg sah tgoeiuzesuti gdiiuio sah gesvuihf. emmtgnuio st yw tsahg ftdgmhf sauf uf e mtvvhmsuti tr gtdshf, eohisf ein ferh atdfhf dfhn st sgeifltgs iezu fwylesaufhgf ein beg mguyuievf tds tr ohgyeiw ein ti st ftdsa eyhgume. bh aexh kitbi saes fdma ei tgoeiufesuti hcufsf fuimh sah hin tr sah beg, jds sauf uf sah rugfs suyh u aexh fhhi us ieyhn. sah tsahg luhmh tr uirtgyesuti uf ydma ytgh fdjsvh. u ey jhouiiuio st btinhg ur tdg ftdgmh uf mvtfhg st atyh saei bh aen ghevufhn. ein u ey its ghrhgguio st rgeimtuf! fhh ur wtd mei flts sah sbt sauiof u itsumhn. jw sah bew, bat sgeifmgujhn sah genut uishgmhls wtd fhis yh vefs bhhk? aeggw\n",
-      "\n",
-      "11882 jtlqigfshdknbrcmzeawupxvyo -988.5494150402712 waegvuh, sah essewahn otsh bef vhrs uo toh tr ym nhen ngtlf vefs ouias eon ellhegf st jh rgty tdg ymfshgutdf ftdgwh. us wtoseuof sbt ghevvm fuiouruweos luhwhf tr uoshvvuihowh. sah rugfs uf saes sah guhwafntxstg yuias ots ghrhg st eo uonukundev ershg evv. us fhhyf st jh sah wtnhoeyh rtg sah tgieouzesuto gdoouoi sah gesvuohf. ewwtgnuoi st ym tsahg ftdgwhf sauf uf e wtvvhwsuto tr gtdshf, eihosf eon ferh atdfhf dfhn st sgeofltgs oezu fmylesaufhgf eon beg wguyuoevf tds tr ihgyeom eon to st ftdsa eyhguwe. bh aekh xotbo saes fdwa eo tgieoufesuto hcufsf fuowh sah hon tr sah beg, jds sauf uf sah rugfs suyh u aekh fhho us oeyhn. sah tsahg luhwh tr uortgyesuto uf ydwa ytgh fdjsvh. u ey jhiuoouoi st btonhg ur tdg ftdgwh uf wvtfhg st atyh saeo bh aen ghevufhn. eon u ey ots ghrhgguoi st rgeowtuf! fhh ur mtd weo flts sah sbt sauoif u otsuwhn. jm sah bem, bat sgeofwgujhn sah genut uoshgwhls mtd fhos yh vefs bhhx? aeggm\n",
-      "\n",
-      "38275 ylupsroeakjbiwgxzdmchqftvn -978.2449056535245 cmdrtha, ema deedcmab nlea ido tawe hn lna lw vx badb brluo tdoe nhsme dnb duuadro el ya wrlv lkr vxoearhlko olkrca. he clnedhno eil radttx ohsnhwhcdne uhacao lw hneatthsanca. ema whroe ho emde ema rhacmoblfelr vhsme nle rawar el dn hnbhjhbkdt dwear dtt. he oaavo el ya ema clbandva wlr ema lrsdnhzdehln rknnhns ema rdethnao. dcclrbhns el vx lemar olkrcao emho ho d clttacehln lw rlkeao, dsaneo dnb odwa mlkoao koab el erdnoulre ndzh oxvudemhoaro dnb idr crhvhndto lke lw sarvdnx dnb ln el olkem dvarhcd. ia mdja fnlin emde okcm dn lrsdnhodehln aghoeo ohnca ema anb lw ema idr, yke emho ho ema whroe ehva h mdja oaan he ndvab. ema lemar uhaca lw hnwlrvdehln ho vkcm vlra okyeta. h dv yashnnhns el ilnbar hw lkr olkrca ho ctloar el mlva emdn ia mdb radthoab. dnb h dv nle rawarrhns el wrdnclho! oaa hw xlk cdn oule ema eil emhnso h nlehcab. yx ema idx, iml erdnocrhyab ema rdbhl hnearcaue xlk oane va tdoe iaaf? mdrrx\n",
-      "\n",
-      "38276 yluvsroeakjbiwgxzdmchqftpn -974.4830434072574 cmdrtha, ema deedcmab nlea ido tawe hn lna lw px badb brluo tdoe nhsme dnb duuadro el ya wrlp lkr pxoearhlko olkrca. he clnedhno eil radttx ohsnhwhcdne uhacao lw hneatthsanca. ema whroe ho emde ema rhacmoblfelr phsme nle rawar el dn hnbhjhbkdt dwear dtt. he oaapo el ya ema clbandpa wlr ema lrsdnhzdehln rknnhns ema rdethnao. dcclrbhns el px lemar olkrcao emho ho d clttacehln lw rlkeao, dsaneo dnb odwa mlkoao koab el erdnoulre ndzh oxpudemhoaro dnb idr crhphndto lke lw sarpdnx dnb ln el olkem dparhcd. ia mdja fnlin emde okcm dn lrsdnhodehln aghoeo ohnca ema anb lw ema idr, yke emho ho ema whroe ehpa h mdja oaan he ndpab. ema lemar uhaca lw hnwlrpdehln ho pkcm plra okyeta. h dp yashnnhns el ilnbar hw lkr olkrca ho ctloar el mlpa emdn ia mdb radthoab. dnb h dp nle rawarrhns el wrdnclho! oaa hw xlk cdn oule ema eil emhnso h nlehcab. yx ema idx, iml erdnocrhyab ema rdbhl hnearcaue xlk oane pa tdoe iaaf? mdrrx\n",
-      "\n",
-      "78883 beuzxnalopgyivqkwtrchjfmds -957.1987270553409 crtnmho, lro tlltcroy selo ita movl hs eso ev dk yoty yneua mtal shxrl tsy tuuotna le bo vned epn dkalonhepa aepnco. hl ceslthsa lie notmmk ahxshvhctsl uhocoa ev hslommhxosco. lro vhnal ha lrtl lro nhocrayeflen dhxrl sel novon le ts hsyhghyptm tvlon tmm. hl aooda le bo lro ceyostdo ven lro enxtshwtlhes npsshsx lro ntlmhsoa. tccenyhsx le dk elron aepncoa lrha ha t cemmoclhes ev neploa, txosla tsy atvo repaoa paoy le lntsauenl stwh akdutlrhaona tsy itn cnhdhstma epl ev xondtsk tsy es le aeplr tdonhct. io rtgo fseis lrtl apcr ts enxtshatlhes oqhala ahsco lro osy ev lro itn, bpl lrha ha lro vhnal lhdo h rtgo aoos hl stdoy. lro elron uhoco ev hsvendtlhes ha dpcr deno apblmo. h td boxhsshsx le iesyon hv epn aepnco ha cmeaon le redo lrts io rty notmhaoy. tsy h td sel novonnhsx le vntsceha! aoo hv kep cts auel lro lie lrhsxa h selhcoy. bk lro itk, ire lntsacnhboy lro ntyhe hsloncoul kep aosl do mtal ioof? rtnnk\n",
-      "\n",
-      "465709 dojzgtrasuqvmlypbeifhxkwcn -941.3015373634643 fietwhs, ais eaaefisv noas mer wsla hn ons ol cp vsev vtojr wera nhgia env ejjsetr ao ds ltoc out cprasthour routfs. ha fonaehnr amo tsewwp rhgnhlhfena jhsfsr ol hnaswwhgsnfs. ais lhtra hr aiea ais thsfirvokaot chgia noa tslst ao en hnvhqhvuew elast eww. ha rsscr ao ds ais fovsnecs lot ais otgenhbeahon tunnhng ais teawhnsr. effotvhng ao cp oaist routfsr aihr hr e fowwsfahon ol touasr, egsnar env rels ioursr ursv ao atenrjota nebh rpcjeaihrstr env met fthchnewr oua ol gstcenp env on ao rouai ecsthfe. ms ieqs knomn aiea rufi en otgenhreahon syhrar rhnfs ais snv ol ais met, dua aihr hr ais lhtra ahcs h ieqs rssn ha necsv. ais oaist jhsfs ol hnlotceahon hr cufi cots rudaws. h ec dsghnnhng ao monvst hl out routfs hr fworst ao iocs aien ms iev tsewhrsv. env h ec noa tslstthng ao ltenfohr! rss hl pou fen rjoa ais amo aihngr h noahfsv. dp ais mep, mio atenrfthdsv ais tevho hnastfsja pou rsna cs wera mssk? iettp\n",
-      "\n",
-      "1750157 qhyxutaieljkvwzdmsofrpbgcn -941.2815644870221 fostgre, ioe siisfoek nhie vsa gewi rn hne hw cd kesk kthya gsai nruoi snk syyesta ih qe wthc hlt cdaietrhla ahltfe. ri fhnisrna ivh tesggd arunrwrfsni yrefea hw rnieggruenfe. ioe wrtai ra iosi ioe trefoakhbiht cruoi nhi tewet ih sn rnkrjrklsg swiet sgg. ri aeeca ih qe ioe fhkensce wht ioe htusnrmsirhn tlnnrnu ioe tsigrnea. sffhtkrnu ih cd hioet ahltfea iora ra s fhggefirhn hw thliea, suenia snk aswe ohlaea laek ih itsnayhti nsmr adcysioraeta snk vst ftrcrnsga hli hw uetcsnd snk hn ih ahlio scetrfs. ve osje bnhvn iosi alfo sn htusnrasirhn ezraia arnfe ioe enk hw ioe vst, qli iora ra ioe wrtai irce r osje aeen ri nscek. ioe hioet yrefe hw rnwhtcsirhn ra clfo chte alqige. r sc qeurnnrnu ih vhnket rw hlt ahltfe ra fghaet ih ohce iosn ve osk tesgraek. snk r sc nhi tewettrnu ih wtsnfhra! aee rw dhl fsn ayhi ioe ivh iornua r nhirfek. qd ioe vsd, voh itsnaftrqek ioe tskrh rnietfeyi dhl aeni ce gsai veeb? osttd\n",
-      "\n"
-     ]
-    },
     {
      "data": {
       "text/plain": [
-       "('qhyxutaieljkvwzdmsofrpbgcn', -941.2815644870221)"
+       "('firzuyhgjkmopqatlnesvwxbcd', -2435.9305949573036)"
       ]
      },
-     "execution_count": 11,
+     "execution_count": 16,
      "metadata": {},
      "output_type": "execute_result"
     }
    ],
    "source": [
-    "monoalphabetic_break_hillclimbing(c4a, alphabet=keyword_cipher_alphabet_of(key_a_word, wrap_alphabet=key_a_wrap))"
+    "monoalphabetic_break_hillclimbing(c4a, \n",
+    "            plain_alphabet=keyword_cipher_alphabet_of(key_a_word, wrap_alphabet=key_a_wrap),\n",
+    "            fitness=Ptrigrams)"
    ]
   },
   {
    "cell_type": "code",
    "execution_count": null,
-   "metadata": {
-    "collapsed": true
-   },
+   "metadata": {},
    "outputs": [],
    "source": []
   }
    "name": "python",
    "nbconvert_exporter": "python",
    "pygments_lexer": "ipython3",
-   "version": "3.4.3"
+   "version": "3.6.3"
   }
  },
  "nbformat": 4,
- "nbformat_minor": 0
+ "nbformat_minor": 1
 }