Need help. I need regular expressions that correlate to computer science Write a
ID: 3672982 • Letter: N
Question
Need help. I need regular expressions that correlate to computer science
Write a regular expression that defines a simple musical score. Notes are represented by their duration, immediately followed by the frequency and then optionally a sharp,"#", or a flat, "b". The frequency is specified by the capital letters A..G. The frequency letter "R" represents a rest or no sound. A rest never has a sharp or flat. The duration is a number representing the inverse of the time per bar. A quarter note is represented as "4", and eight note as an "8". The possible values are 1, 2, 4, 8 and 16. There can be one or more spaces between the notes. Write a Deterministic Finite State Automata (DFA) for two of the above languages. This should be a circle and arrow diagram with the edges labeled with the input symbol.Explanation / Answer
Hi below i explained a Relational Database Approach to Polyphonic Music Search Systems Using Regular Expressions for your reference,
ANALYSIS
As much as worst case running times tend to be overlypessimistic, average case running times will hide the enormity of the worst case. With this in mind, we present both worst and average case performance analysis.
Example Regular Expression Query
([< p11, d11 >< p12, d12 > . . . < p1q, d1q >]
[< pl1, dl1 >< pl2, dl2 > . . . < plr, dlr >])?{m, x}
We begin with the generalized query. Though it does not demonstrate matching of series of patterns or “or’s” of patterns, methods for accomplishing those portions of a query are computationally similar to a portion of a query it does demonstrate: matching ranges of a pattern. The query would be translated into SQL.
Corresponding SQL Query
select S1.id, Sl.id from
notes N11, ..., notes Nlr,
clusters C1, ..., clusters C1q, ...
clusters Cl1, ..., clusters Clr,
scores S1, ..., scores Sl where
N11.pitch=p11 and N11.duration=d11 and ...
and Nlr.pitch=plr and Nlr.duration=dlr and
C11.id=C12.id and ... and
C1q-1.id=C1q.id and ... and
Cl1.id=Cl2.id and ... and
Clr-1.id=Clr.id and
C1.note=N11.id and ... and
C1q.note=N1q.id and ... and
Cl1.note=Nl1.id and ... and
Clr.note=Nlr.id and
S1.cluster=C11.id and ... and
Sl.cluster=Cl1.id and
S1.next=S2.id and ... and
Sl-1.next=Sl.id and
S1.c_num-Sl.c_num>=(m*count) and
S1.c_num-Sl.c_num<=(x*count)
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.