Ask Question, Ask an Expert

+61-413 786 465

info@mywordsolution.com

Ask Computer Engineering Expert

Programming Assignment: Foundations of Algorithms

The following is a problem to be completed by the individual (i.e., it is not collaborative) and then implemented. You may use any programming language you wish. Follow the requirements provided under Syllabus & Course Information under the link Programming Assignment Requirements.

1. Programming (non-collaborative)Due at the end of Module 13. You are consulting for a group of people (who would prefer not to be mentioned here by name) whose job consists of monitoring and analyzing electronic signals coming from ships in the Atlantic ocean. They want a fast algorithm for a basic primitive that arises frequently: untangling a superposition of two known signals. Specifically, they are picturing a situation in which each of two ships is emitting a short sequence of 0s and 1s over and over, and they want to make sure that the signal they are hearing is simply an interleaving of these two emissions, with nothing extra added in.

This describes the whole problem; we can make it a little more explicit as follows. Given a string x consisting of 0s and 1s, we write xk to denote k copies of x concatenated together. We say that string x′ is a repetition of x if it is a prex of xk for some number k. So x′ = 10110110110 is a repetition of x = 101.

We say that a string s is an interleaving of x and y if its symbols can be partitioned into two (not necessarily contiguous) subsequence s′ and s′′ so that s′ is a repetition of x and s′′ is a repetition of y. (So each symbol in s must belong to exactly one of s′ and s′′.) For example, if x = 101 and y = 00, then s = 100010101 is an interleaving of x and y since characters 1, 2, 5, 7, 8, and 9 form 101101a repetition of xand the remaining characters 3, 4, 6 form 000a repetition of y. In terms of our application, x and y are the repeating sequences from the two ships, and s is the signal we are listening to. We want to make sure s unravels into simple repetitions of x and y.

(a) Give an efficient algorithm that takes strings s, x, and y and decides if s is an interleaving of x and y. Derive the computational complexity of your algorithm.

(b) Implement your algorithm above and test its run time to verify your analysis. Remember that CPU time is not a valid measure for testing run time. You must use something such as the number of comparisons.

Computer Engineering, Engineering

  • Category:- Computer Engineering
  • Reference No.:- M92792996
  • Price:- $40

Guranteed 36 Hours Delivery, In Price:- $40

Have any Question?


Related Questions in Computer Engineering

Task the first task is to create your business narrative

Task The first task is to create your business narrative. Some of the questions that you should address include (but are not limited to) the following. •What is the name of your business? •Who will be the users of the sy ...

Fully explain at least one reason why many developing

Fully explain at least one reason why many developing countries suffered serious debt crisis in the early 1980s. Does this reason you explained in debt support Krueger & Srinivasan's argument? Why or why not? How could t ...

Please do it in c programrevisit the matrix addition

Please do it in C program Revisit the matrix addition function Write the program so that it would not need to take a third pointer for the result matrix Instead, have the function return a pointer to the results matrix P ...

Both the search and the insertion time for a b-tree are a

Both the search and the insertion time for a B-tree are a function of the height of the tree. We would like to develop a measure of the worst-case search or insertion time. Consider a B-tree of degree d that contains a t ...

We have seen how dynamic arrays enable arrays to grow while

We have seen how dynamic arrays enable arrays to grow while still achieving constant-time amortized performance. This problem concerns extending dynamic arrays to let them both grow and shrink on demand. a) Consider an u ...

Write a c program please follow instructions exactly this

Write a C++ program. PLEASE FOLLOW INSTRUCTIONS EXACTLY. This program takes its inputs from a file that contains numbers. The program reads them in as type double. The program outputs to the screen the  standard deviatio ...

Flyers inc just paid an eps of 49 this year flyers is

Flyers, Inc., just paid an EPS of $4.9 this year. Flyers is expected to maintain a retained earnings ratio of 50% and ROE of 5.5% for the next five years. After the fifth year, ROE is expected to decrease to 3.3%. Applyi ...

What are the minimum numbers of keys and pointers in btree

What are the minimum numbers of keys and pointers in Btree (i) interior nodes and (ii) leaves, when: a) n = 10; i.e., a block holds 10 keys and 11 pointeis. b) n = 11; i.e., a block holds 11 keys and 12 pointers.

Benefits of abating emission mb500-20acost of abating

Benefits of abating emission: MB=500-20A Cost of abating emission: MC=200+5A What are the marginal benefit and marginal cost of abatement at socially efficient level of abatement? What is the net social benefit at the ef ...

Scheme questionthe following program can be used to

Scheme Question The following program can be used to determine if a given interpreter is using applicative-order evaluations or normal-order evaluation: (define (p)(p)) (define (test x y) (if (= x 0) 0 y)) (test 0 (p)) ( ...

  • 4,153,160 Questions Asked
  • 13,132 Experts
  • 2,558,936 Questions Answered

Ask Experts for help!!

Looking for Assignment Help?

Start excelling in your Courses, Get help with Assignment

Write us your full requirement for evaluation and you will receive response within 20 minutes turnaround time.

Ask Now Help with Problems, Get a Best Answer

Why might a bank avoid the use of interest rate swaps even

Why might a bank avoid the use of interest rate swaps, even when the institution is exposed to significant interest rate

Describe the difference between zero coupon bonds and

Describe the difference between zero coupon bonds and coupon bonds. Under what conditions will a coupon bond sell at a p

Compute the present value of an annuity of 880 per year

Compute the present value of an annuity of $ 880 per year for 16 years, given a discount rate of 6 percent per annum. As

Compute the present value of an 1150 payment made in ten

Compute the present value of an $1,150 payment made in ten years when the discount rate is 12 percent. (Do not round int

Compute the present value of an annuity of 699 per year

Compute the present value of an annuity of $ 699 per year for 19 years, given a discount rate of 6 percent per annum. As