Answered step by step
Verified Expert Solution
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 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 songanalysis 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 oneletter name. Starting with
the chords listed above, we might say etc., so that the sequence above would be rep
resented by 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
and the length of the longest shared contiguous subsequence is for
Write a dynamic programming algorithm to compute, given two sequences of chords one of length
and the other of length the length of the longest shared contiguous subsequence. As usual, provide
an argument for your algorithm's correctness and analyze its runtime.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started