American singer Taylor Swift started doing musical theaters at the age of nine. Before that she...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
American singer Taylor Swift started doing musical theaters at the age of nine. Before that she used to attend the Wyndcroft School in the USA. Due to her undying passion in music, her father enrolled little Taylor in a guitar course in the school. The tutor there taught Taylor how to play the major and minor scales of the guitar. After two months of lessons, Taylor needed to pass a test with 50% accuracy to get the course completion certificate from the school. The test was to play all the notes of the C major scale in the given order "C D EFGABC". D E A B -2 The results from the test measured the accuracy percentage of the longest common sequence of notes played by the students when compared to the given sequence of C DEFGABC. For example, when Taylor gave this test, she got an accuracy of 75% as her played notes were “CEFDABGAC" When asked, the teachers explained their accuracy measurement formula as below: Accuracy = (Length of Longest Common Played Notes Total Length of Given Sequence) x 100 For little Taylor, her longest common played notes were in the sequence of "CEFABC". So the accuracy measured was 75% as her length of longest common played notes is 6 and the total length of the given sequence is 8. Since there are numerous students in the course, the school decided to develop an algorithm that will find the accuracy output of the students along with their longest common played notes and also determine whether they passed or failed. Your job is to help the school build the algorithm. SAMPLE INPUT: //given note sequence in test by school CEFDABGAC /played note sequence by a student CDEFGABC SAMPLE OUTPUT: CEFABC 75% PASSED Problem 2: In a small version of the FRIENDS world, there exists only 10 words with which people communicate. The words are indexed for simplicity using the alphabets given below: M: monkeys B: because W: wearing O: of C: coats E: evolution A: are R: results D: doctors P: eruption At a turn of events, two friends named Ross and Chandler got into a debate when they blamed each other for copying their joke. So they invited Monica over to help them decide whether Chandler copied the joke from Ross or not. Ross's Joke: monkeys wearing coats are doctors because of evolution Chandler's Joke: doctors monkeys wearing coats are results of eruption So to make the decision, Monica thought of applying "Longest Common Sequence" algorithm to both the jokes and tell Chandler how many consecutive words he had copied from Ross. She found the LCS to contain the words "monkeys, wearing, coats, are, of". Your job is to help Monica make the program to get the LCS word count and also print the sequence. (Hint: You will need to first store the index table given above.) SAMPLE INPUT: M WCADBOE DM W CAROP SAMPLE OUTPUT: monkeys wearing coats are of American singer Taylor Swift started doing musical theaters at the age of nine. Before that she used to attend the Wyndcroft School in the USA. Due to her undying passion in music, her father enrolled little Taylor in a guitar course in the school. The tutor there taught Taylor how to play the major and minor scales of the guitar. After two months of lessons, Taylor needed to pass a test with 50% accuracy to get the course completion certificate from the school. The test was to play all the notes of the C major scale in the given order "C D EFGABC". D E A B -2 The results from the test measured the accuracy percentage of the longest common sequence of notes played by the students when compared to the given sequence of C DEFGABC. For example, when Taylor gave this test, she got an accuracy of 75% as her played notes were “CEFDABGAC" When asked, the teachers explained their accuracy measurement formula as below: Accuracy = (Length of Longest Common Played Notes Total Length of Given Sequence) x 100 For little Taylor, her longest common played notes were in the sequence of "CEFABC". So the accuracy measured was 75% as her length of longest common played notes is 6 and the total length of the given sequence is 8. Since there are numerous students in the course, the school decided to develop an algorithm that will find the accuracy output of the students along with their longest common played notes and also determine whether they passed or failed. Your job is to help the school build the algorithm. SAMPLE INPUT: //given note sequence in test by school CEFDABGAC /played note sequence by a student CDEFGABC SAMPLE OUTPUT: CEFABC 75% PASSED Problem 2: In a small version of the FRIENDS world, there exists only 10 words with which people communicate. The words are indexed for simplicity using the alphabets given below: M: monkeys B: because W: wearing O: of C: coats E: evolution A: are R: results D: doctors P: eruption At a turn of events, two friends named Ross and Chandler got into a debate when they blamed each other for copying their joke. So they invited Monica over to help them decide whether Chandler copied the joke from Ross or not. Ross's Joke: monkeys wearing coats are doctors because of evolution Chandler's Joke: doctors monkeys wearing coats are results of eruption So to make the decision, Monica thought of applying "Longest Common Sequence" algorithm to both the jokes and tell Chandler how many consecutive words he had copied from Ross. She found the LCS to contain the words "monkeys, wearing, coats, are, of". Your job is to help Monica make the program to get the LCS word count and also print the sequence. (Hint: You will need to first store the index table given above.) SAMPLE INPUT: M WCADBOE DM W CAROP SAMPLE OUTPUT: monkeys wearing coats are of
Expert Answer:
Answer rating: 100% (QA)
1 LCS or the Longest Common Subsequence is fairly known problem which can be solved using the concepts of Dynamic Programming in a 2D Matrix Here is a ... View the full answer
Related Book For
Contemporary Business Mathematics with Canadian Applications
ISBN: 978-0134141084
11th edition
Authors: S. A. Hummelbrunner, Kelly Halliday, Ali R. Hassanlou, K. Suzanne Coombs
Posted Date:
Students also viewed these algorithms questions
-
A person who is retiring at the age of 65 and who has $200,000 wants to leave an estate of at least $30,000. How much can the individual draw annually on the $200,000 (starting at the end of the...
-
A worker plans to retire at the age of 65, at which time he will start collecting his retirement benefits. Then there is a sudden change in the forecast of inflation when the worker is 63 years old....
-
At the age of 25, Tasha Fellows obtained her university degree and entered the workforce. She sought the opinion of an investment advisor regarding a tax-free savings account (TFSA). The main...
-
Consider an ideal dual-loop heat-powered refrigeration cycle using R-134a as the working fluid, as shown in Fig. P9.135. Saturated vapor at 200 F leaves the boiler and expands in the turbine to the...
-
Whether one views homosexual relations as wrong is closely related to whether one views homosexuality as a biological trait or the outcome of one's environment and/or socialization. Thus, it is not...
-
Southern California Publishing Company is trying to decide whether to revise its popular textbook, Financial Psychoanalysis Made Simple. The company has estimated that the revision will cost $...
-
Suppose the wealth that is to be received at a time \(T\) in the future has the form where \(a\) is a constant and \(x\) is a random variable. The value of the variable \(h\) can be selected by the...
-
An insurance company has the business objective of reducing the amount of time it takes to approve applications for life insurance. The approval process consists of underwriting, which includes a...
-
2) What is the negation of this proposition? [0.5pt] "If it is below freezing, it is snowing" a) It is not below freezing, and it is not snowing b) It is below freezing, and it is not snowing c) It...
-
The following trial balance was extracted from the books of Alice Ltd, a wine merchant, at the close of business on 31 December 2020 Trial Balance Capital Purchases Sales Revenue Trade payable Trade...
-
You are the Global Marketing Manager for East End in the UK. Your task is to design a Marketing Plan for East End for entry in the Canadian market (Toronto). Do an Environmental Analysis for the...
-
You drive an old car on a straight, level highway at \(45 \mathrm{mi} / \mathrm{h}\) for \(10 \mathrm{mi}\), and then the car stalls. You leave the car and, continuing in the direction in which you...
-
You throw a ball straight up with an initial speed of \(10 \mathrm{~m} / \mathrm{s}\). (a) What is the ball's instantaneous acceleration at instant \(t_{1}\), just after it leaves your hand; at...
-
You and your brother both leave your house at the same instant and drive in separate cars along a straight highway to a nearby lake. After \(10 \mathrm{~min}\), you are both \(3.0 \mathrm{~km}\) from...
-
You and your friend are running at a long racetrack. You pass the starting line while running at a constant \(4.0 \mathrm{~m} / \mathrm{s}\). Fifteen seconds later, your friend passes the starting...
-
A child on a sled slides down an icy slope, starting at a speed of \(2.5 \mathrm{~m} / \mathrm{s}\). The slope makes a \(15^{\circ}\) angle with the horizontal. After sliding \(10 \mathrm{~m}\) down...
-
In 2002, Martha Stewart was accused of trading ImClone stock based on private (inside) information. The private information motivated her to sell the stock before it was publicly revealed that...
-
Tiger, Inc. signed a lease for equipment on July 1, 2007.The lease is for 10 years (the useful life of the asset).The first of 10 equal annual payments of $500,000 was made on July 1, 2007.The...
-
Keys Company has a target of establishing a fund of $50 000. If $10 000 is deposited at the end of every six months, and the fund earns interest at 4% compounded quarterly, how long will it take to...
-
Debbie plans to buy a house for cash instead of paying a mortgage. She is willing to set aside $12 000 at the end of each year for 15 years. She puts her savings in a Tax Free Savings Account (TFSA)...
-
A 162/3% discount allowed on a flash drive amounts to $14.82. What was the net price?
-
The \(x\) component of the velocity of a car changes from \(-10 \mathrm{~m} / \mathrm{s}\) to \(-2.0 \mathrm{~m} / \mathrm{s}\) in \(10 \mathrm{~s}\). (a) Is the car traveling in the positive or...
-
The day after the incident described in Problem 44, the instructor finds herself in the same situation. This time, she tries a harder physics exercise. She keeps running at a constant \(6.0...
-
(a) A car is speeding up in the negative \(x\) direction. In what direction do \(\vec{a}\) and \(\vec{v}\) point? (b) To which of the four graphs in Figures 3 . 2 and 3 . 3 does the situation...
Study smarter with the SolutionInn App