subject

Given the same input, i. e., a sequence of characters starting with∧and ending with #, and any combination of 0s and 1s in-between, specify a set of rewrite rules that determine whether the string contains the same number of 0s and 1s. Here is some sample "output": $0011# should be rewritten as $#

$1001 # should be rewritten as $#

$110110# should be rewritten as $11

$000 1 1 00 should be rewritten as $000#

In other words, the $# indicates that the input string has the same number of Os and 1s. If the string does not contain the same number of 0s and 1s, the resulting string shows how many more Os or 1s there are in the input string.

ansver
Answers: 1

Another question on Computers and Technology

question
Computers and Technology, 24.06.2019 16:50
Develop the program incrementally: a) start by reading and displaying each line of the input file to make sure you are reading the data set correctly. b) use the split string method to extract information from each line into a list. print the list to prove that this step is working correctly. d) convert the exam scores to type int and calculate the student’s average. display those items to prove this step is working correctly. e) create a tuple containing the six items for each student (name, exam scores, exam mean). display the tuples to prove this step is working correctly. (optionally, you may want to have the exam scores in a list so your tuple is (name, scores_list, f) append each tuple to a list. display the list to prove this step is working correctly. g) use the sort list method to re-order the tuples in the list. display the list to prove this step is working correctly. h) use a for statement to display the contents of the list as a table (with appropriate formatting). i) use a for statement to calculate the average of all scores on exam #1, then display the results. note that you could have calculated this average within the first loop, but we are explicitly requiring you to do this calculation by looping though your list of tuples. j) add the logic to calculate the average of all scores on exam #2, then display the results.
Answers: 2
question
Computers and Technology, 24.06.2019 19:20
Kiesha has a worksheet with a range of cells using the following columns: name, score, group, study group, and date. kiesha needs to sort the worksheet on the date field. which option she use to most efficiently complete this task ? a use the cut and paste option to reorganize the data to fit that order b use the filter function to organize the data based on the date c use the order function to organize the data based on the date d use the sort function to organize the data based on date order
Answers: 3
question
Computers and Technology, 25.06.2019 03:40
Acurrent vehicle registration expires at of the first owner listed on the registration form. a. stretch and flex b. bend and break c. wear down d. bounce around
Answers: 1
question
Computers and Technology, 25.06.2019 17:00
Ajay wants to read a brief overview about early settlers in the united states which type of online text sources should he most likely use
Answers: 3
You know the right answer?
Given the same input, i. e., a sequence of characters starting with∧and ending with #, and any combi...
Questions
question
Chemistry, 05.07.2019 23:30
Questions on the website: 13722362