Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

python or sagemath code plz Problem 1. In this problem, the goal is to crack the substitution cipher in an example. 1. Write a function

image text in transcribed

python or sagemath code plz

Problem 1. In this problem, the goal is to crack the substitution cipher in an example. 1. Write a function to output the monogram distribution of a given a string of capital letters. By a monogram we mean A,B,C, etc. Your output should look something like this: sage: dist("ALWAYSDOMATH") A 3 25.00 L 1 8.33 W 1 8.33 Y 1 8.33 S 1 8.33 D1 8.33 0 1 8.33 M1 8.33 T 1 8.33 H 1 8.33 2. Write a function to output the bigram distribution of a given a string of capital letters. By a bigram we mean AA, AB, AC, etc. Test your program by outputting the bigram distribution of the following text. What are the 5 most common bigrams in the given text? Compare against the most common bigrams in the English language. BUTESPECIALLYHELOVEDTORUNINTHEDIMTWILIGHTOFTHESUMM ERMIDNIGHTSLISTENINGTOTHESUBDUEDANDSLEEPYMURMURSOF THEFORESTREADINGSIGNSANDSOUNDSASAMANMAYREADABOOKAN DSEEKINGFORTHEMYSTERIOUSSOMETHINGTHATCALLEDCALLEDW AKINGORSLEEPINGATALLTIMESFORHIMTOCOME 3. The following ciphertext was encrypted using a simple substitution ci- pher. What was the original plaintext message? RMRXELNELNZNRPRCZURWDIDEPYRDPUAEUUADALSDPIPRFDXZUR FEUZPAENKDDCIEXEVDIRUNRXSZNNRKYDUZVZUZYRVAUNSDDINR PUADSZNNRKRYRULZMNBWWDNNMBYYLCEFRVEURCVECENUDPZRIM RDYIRNESSPZQRXEUDYLUAPDDUAZBNECINDFDCABCIPDIECIUJD CULUZZCDEPUZZNELNUADWAECWDNZMNBPFRFEYEPDNDFDCABCIP DINDFDCULMRFDUZZCDEWUBEYYLEPUZZAENKDDCGCZJCUZXEGDX RNUEGDNMPZXURXDUZURXDZAIDEPZAIDEPIZCUJZPPLEKZBUXEN UDPYBGDRXNBPDADYYKDEYYPRVAUADNTBRUDWYDFDPLZBGCZJMZ PEABXECKDRCV Problem 1. In this problem, the goal is to crack the substitution cipher in an example. 1. Write a function to output the monogram distribution of a given a string of capital letters. By a monogram we mean A,B,C, etc. Your output should look something like this: sage: dist("ALWAYSDOMATH") A 3 25.00 L 1 8.33 W 1 8.33 Y 1 8.33 S 1 8.33 D1 8.33 0 1 8.33 M1 8.33 T 1 8.33 H 1 8.33 2. Write a function to output the bigram distribution of a given a string of capital letters. By a bigram we mean AA, AB, AC, etc. Test your program by outputting the bigram distribution of the following text. What are the 5 most common bigrams in the given text? Compare against the most common bigrams in the English language. BUTESPECIALLYHELOVEDTORUNINTHEDIMTWILIGHTOFTHESUMM ERMIDNIGHTSLISTENINGTOTHESUBDUEDANDSLEEPYMURMURSOF THEFORESTREADINGSIGNSANDSOUNDSASAMANMAYREADABOOKAN DSEEKINGFORTHEMYSTERIOUSSOMETHINGTHATCALLEDCALLEDW AKINGORSLEEPINGATALLTIMESFORHIMTOCOME 3. The following ciphertext was encrypted using a simple substitution ci- pher. What was the original plaintext message? RMRXELNELNZNRPRCZURWDIDEPYRDPUAEUUADALSDPIPRFDXZUR FEUZPAENKDDCIEXEVDIRUNRXSZNNRKYDUZVZUZYRVAUNSDDINR PUADSZNNRKRYRULZMNBWWDNNMBYYLCEFRVEURCVECENUDPZRIM RDYIRNESSPZQRXEUDYLUAPDDUAZBNECINDFDCABCIPDIECIUJD CULUZZCDEPUZZNELNUADWAECWDNZMNBPFRFEYEPDNDFDCABCIP DINDFDCULMRFDUZZCDEWUBEYYLEPUZZAENKDDCGCZJCUZXEGDX RNUEGDNMPZXURXDUZURXDZAIDEPZAIDEPIZCUJZPPLEKZBUXEN UDPYBGDRXNBPDADYYKDEYYPRVAUADNTBRUDWYDFDPLZBGCZJMZ PEABXECKDRCV

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Advances In Databases 11th British National Conference On Databases Bncod 11 Keele Uk July 7 9 1993 Proceedings Lncs 696

Authors: Michael F. Worboys ,Anna F. Grundy

1993rd Edition

3540569219, 978-3540569213

More Books

Students also viewed these Databases questions