Answered step by step
Verified Expert Solution
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
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
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started