Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Use python! Average length to an ATG Please put all of your code for this problem in a file called lengthTOATG.py Let's assume that we
Use python!
Average length to an ATG Please put all of your code for this problem in a file called lengthTOATG.py Let's assume that we have a long DNA sequence in which each symbol is random and equally likely to be an A, C, T, or G. We'd like to determine the average number of symbols until we see the first occurrence of a start codon "ATG" Once you've written a function to compute this, you'll do the same thing to find the average number of symbols until we see the first occurrence of the codon "AAA" Surprisingly, the average for "ATG" and the average for "AAA" are not the same! We'll break this task up into a few parts lengthToATG() First, write a function called lengthTOATG( ) that takes no input, generates a random letter fromA", "T", "C", or "G", and then if the last three letters generated are ATG", it returns the total number of symbols that were generated. Otherwise, it repeats the process by generating a next random letter Recall that in order to generate things at random, you simply include the line... import randon " "T", "6") to generate a random symbol from the list t , , , . at the top of your file. Then, you can use random. choice("A", Clearly, you'll need to have a loop to keep generating symbols untl we see the pattern 'ATG". Since we don't know in advance how many symbols wll need to be generated before we see this pattern, a while loop is the right choice 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