Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

It turns out that many songs share similar chord sequences. Jazz songs in C major, for example, often contain a sequence of chords C 6

It turns out that many songs share similar chord sequences. Jazz songs in C major, for example, often
contain a sequence of chords C6,A-7,D-7,G7,C6.(By the way, even though music theory is cool,
you definitely do not need to know what these symbols mean to solve this problem!)
Suppose you have a database consisting of the full sequence of chords in each of a large number of
songs, and you want to learn about the common chord sequences that appear in these songs to help
you practice. One operation you might want to build into your song-analysis software is this: given the
full chord sequence for each of two songs, find the longest shared contiguous subsequence of chords.
To simplify matters, let's imagine we have given each possible chord a one-letter name. Starting with
the chords listed above, we might say A=C6,B=A-7, etc., so that the sequence above would be rep-
resented by A,B,C,D,A. Further, let's just try to find the length of the longest shared contiguous
subsequence rather than the subsequence itself. For example, if your two songs are A,B,C,D,A,D,A
and E,F,G,F,C,D,A,F,D,A,G, the length of the longest shared contiguous subsequence is 3, for
C,D,A
Write a dynamic programming algorithm to compute, given two sequences of chords (one of length m
and the other of length n), the length of the longest shared contiguous subsequence. As usual, provide
an argument for your algorithm's correctness and analyze its runtime.
image text in transcribed

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Systems Design Implementation And Management

Authors: Peter Robb,Carlos Coronel

5th Edition

061906269X, 9780619062699

More Books

Students also viewed these Databases questions

Question

Different types of Grading?

Answered: 1 week ago

Question

Explain the functions of financial management.

Answered: 1 week ago

Question

HOW MANY TOTAL WORLD WAR?

Answered: 1 week ago

Question

Discuss the scope of financial management.

Answered: 1 week ago