Question: Simple Out Put # Given a sequence L of numbers, the greedy increasing subsequence of L, # say G, is inductively defined as follows: #

 Simple Out Put # Given a sequence L of numbers, the

Simple Out Putgreedy increasing subsequence of L, # say G, is inductively defined asfollows: # - If L is of length at most 1 then # Given a sequence L of numbers, the greedy increasing subsequence of L, # say G, is inductively defined as follows: # - If L is of length at most 1 then G is L. # - If L is of the form (e_0, e_1, ..., e_n) with n >= 1, then: # - either e_1 is greater than e_0, in which case G is e_0 followed by the # greedy increasing subsequence of (e_1, ..., e_n), # - or e_1 is less than or equal to e_0, in which case G is the greedy # increasing subsequence of (e_0, e_2,..., e_n). # # 1. Generates a random list L of digits whose length is chosen by the user # (done). # 2. Displays L (done), # 3. Displays the integer made from these digits (without the leading 0s, # if any). # 4. Graphically displays the greedy increasing subsequence of L as # horizontal bars. # 5. Graphically displays the nonzero values in L as steps.

from random import seed, randrange import sys

try: for_seed, length = (int(x) for x in input('Enter two integers, the second ' 'one being strictly positive: ' ).split() ) if length Given a sequence L of numbers, the greedy increasing subsequence of L, say G, is inductively defined as follows: If L is of length at most 1 then G is L. If L is of the form (eo, e1, ..., en) with n > 1, then: o either eu is greater than eo, in which case G is eo followed by the greedy increasing subsequence of (e1, ..., en), or ez is less than or equal to eo, in which case G is the greedy increasing subsequence of (eo, C2, ..., en). 1. Generates a random list L of digits whose length is chosen by the user (done). 2. Displays L (done), 3. Displays the integer made from these digits (without the leading Os, if any). 4. Graphically displays the greedy increasing subsequence of L as horizontal bars. 5. Graphically displays the nonzero values in L as steps. $ python3 quiz_1.py Enter two integers, the second one being strictly positive: 321 12 Here are the generated digits: [4, 6, 2, 5, 8, 7, 5, 3, 9, 7, 6, 6] The integer made from these digits is: 462587539766 Here is the greedy increasing subsequence of values, horizontally displayed: Here are the nonzero values, displayed as stairs: $ python3 quiz_1.py Enter two integers, the second one being strictly positive: 0 7 Here are the generated digits: [6, 6, 0, 4, 8, 7, 6] The integer made from these digits is: 6604876 Here is the greedy increasing subsequence of values, horizontally displayed: Here are the nonzero values, displayed as stairs: Given a sequence L of numbers, the greedy increasing subsequence of L, say G, is inductively defined as follows: If L is of length at most 1 then G is L. If L is of the form (eo, e1, ..., en) with n > 1, then: o either eu is greater than eo, in which case G is eo followed by the greedy increasing subsequence of (e1, ..., en), or ez is less than or equal to eo, in which case G is the greedy increasing subsequence of (eo, C2, ..., en). 1. Generates a random list L of digits whose length is chosen by the user (done). 2. Displays L (done), 3. Displays the integer made from these digits (without the leading Os, if any). 4. Graphically displays the greedy increasing subsequence of L as horizontal bars. 5. Graphically displays the nonzero values in L as steps. $ python3 quiz_1.py Enter two integers, the second one being strictly positive: 321 12 Here are the generated digits: [4, 6, 2, 5, 8, 7, 5, 3, 9, 7, 6, 6] The integer made from these digits is: 462587539766 Here is the greedy increasing subsequence of values, horizontally displayed: Here are the nonzero values, displayed as stairs: $ python3 quiz_1.py Enter two integers, the second one being strictly positive: 0 7 Here are the generated digits: [6, 6, 0, 4, 8, 7, 6] The integer made from these digits is: 6604876 Here is the greedy increasing subsequence of values, horizontally displayed: Here are the nonzero values, displayed as stairs

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!