28 Aug, 2006PSC 20061 Song Classification for Dancing Manolis Cristodoukalis, Costas Iliopoulos, M. Sohel Rahman, W.F. Smyth.

Slides:



Advertisements
Similar presentations
1 Average Case Analysis of an Exact String Matching Algorithm Advisor: Professor R. C. T. Lee Speaker: S. C. Chen.
Advertisements

College of Information Technology & Design
Parameterized Matching Amir, Farach, Muthukrishnan Orgad Keller Modified by Ariel Rosenfeld.
Parametrized Matching Amir, Farach, Muthukrishnan Orgad Keller.
Combinatorial Pattern Matching CS 466 Saurabh Sinha.
1 Turing Machines and Equivalent Models Section 13.2 The Church-Turing Thesis.
Michael Alves, Patrick Dugan, Robert Daniels, Carlos Vicuna
Discrete Mathematics Lecture 5 Alexander Bukharovich New York University.
Designing Algorithms Csci 107 Lecture 4. Outline Last time Computing 1+2+…+n Adding 2 n-digit numbers Today: More algorithms Sequential search Variations.
Bar Ilan University And Georgia Tech Artistic Consultant: Aviya Amir.
15-853Page : Algorithms in the Real World Suffix Trees.
296.3: Algorithms in the Real World
Tries Search for ‘bell’ O(n) by KMP algorithm O(dm) in a trie Tries
Complexity 11-1 Complexity Andrei Bulatov Space Complexity.
Pattern Matching1. 2 Outline and Reading Strings (§9.1.1) Pattern matching algorithms Brute-force algorithm (§9.1.2) Boyer-Moore algorithm (§9.1.3) Knuth-Morris-Pratt.
1 Introduction to Computability Theory Lecture12: Decidable Languages Prof. Amos Israeli.
Finite Automata Great Theoretical Ideas In Computer Science Anupam Gupta Danny Sleator CS Fall 2010 Lecture 20Oct 28, 2010Carnegie Mellon University.
Goodrich, Tamassia String Processing1 Pattern Matching.
Efficiency of Algorithms
6-1 String Matching Learning Outcomes Students are able to: Explain naïve, Rabin-Karp, Knuth-Morris- Pratt algorithms Analyse the complexity of these algorithms.
Property Matching and Weighted Matching Amihood Amir, Eran Chencinski, Costas Iliopoulos, Tsvi Kopelowitz and Hui Zhang.
The Theory of NP-Completeness
Dynamic Text and Static Pattern Matching Amihood Amir Gad M. Landau Moshe Lewenstein Dina Sokol Bar-Ilan University.
String Matching COMP171 Fall String matching 2 Pattern Matching * Given a text string T[0..n-1] and a pattern P[0..m-1], find all occurrences of.
1 Pseudo-polynomial time algorithm (The concept and the terminology are important) Partition Problem: Input: Finite set A=(a 1, a 2, …, a n } and a size.
Algorithms for Regulatory Motif Discovery Xiaohui Xie University of California, Irvine.
Chapter 2: Design of Algorithms
Designing Algorithms Csci 107 Lecture 4.
Pattern Matching in Weighted Sequences Oren Kapah Bar-Ilan University Joint Work With: Amihood Amir Costas S. Iliopoulos Ely Porat.
Asynchronous Pattern Matching - Address Level Errors Amihood Amir Bar Ilan University 2010.
1 Introduction to Computability Theory Lecture11: The Halting Problem Prof. Amos Israeli.
Pattern Matching1. 2 Outline Strings Pattern matching algorithms Brute-force algorithm Boyer-Moore algorithm Knuth-Morris-Pratt algorithm.
Great Theoretical Ideas in Computer Science.
String Matching Input: Strings P (pattern) and T (text); |P| = m, |T| = n. Output: Indices of all occurrences of P in T. ExampleT = discombobulate later.
String Matching. Problem is to find if a pattern P[1..m] occurs within text T[1..n] Simple solution: Naïve String Matching –Match each position in the.
1 Problem Solving using computers Data.. Representation & storage Representation of Numeric data The Binary System.
DECIDABILITY OF PRESBURGER ARITHMETIC USING FINITE AUTOMATA Presented by : Shubha Jain Reference : Paper by Alexandre Boudet and Hubert Comon.
MCS 101: Algorithms Instructor Neelima Gupta
An Implementation of The Teiresias Algorithm Na Zhao Chengjun Zhan.
Strings and Pattern Matching Algorithms Pattern P[0..m-1] Text T[0..n-1] Brute Force Pattern Matching Algorithm BruteForceMatch(T,P): Input: Strings T.
Book: Algorithms on strings, trees and sequences by Dan Gusfield Presented by: Amir Anter and Vladimir Zoubritsky.
CMSC 330: Organization of Programming Languages Finite Automata NFAs  DFAs.
Specifying Languages Our aim is to be able to specify languages for use in the computer. The sketch of an FSA is easy for us to understand, but difficult.
1 String Matching Algorithms Topics  Basics of Strings  Brute-force String Matcher  Rabin-Karp String Matching Algorithm  KMP Algorithm.
1 Turing’s Thesis. 2 Turing’s thesis: Any computation carried out by mechanical means can be performed by a Turing Machine (1930)
Ravello, Settembre 2003Indexing Structures for Approximate String Matching Alessandra Gabriele Filippo Mignosi Antonio Restivo Marinella Sciortino.
1 String Processing CHP # 3. 2 Introduction Computer are frequently used for data processing, here we discuss primary application of computer today is.
CompSci 102 Discrete Math for Computer Science February 7, 2012 Prof. Rodger Slides modified from Rosen.
Strings Basic data type in computational biology A string is an ordered succession of characters or symbols from a finite set called an alphabet Sequence.
Computer Science Background for Biologists CSC 487/687 Computing for Bioinformatics Fall 2005.
Computer Programming 2 Lab (1) I.Fatimah Alzahrani.
Finite Automata Great Theoretical Ideas In Computer Science Victor Adamchik Danny Sleator CS Spring 2010 Lecture 20Mar 30, 2010Carnegie Mellon.
Dipankar Ranjan Baisya, Mir Md. Faysal & M. Sohel Rahman CSE, BUET Dhaka 1000 Degenerate String Reconstruction from Cover Arrays (Extended Abstract) 1.
Pattern Matching With Don’t Cares Clifford & Clifford’s Algorithm Orgad Keller.
Suffix Tree 6 Mar MinKoo Seo. Contents  Basic Text Searching  Introduction to Suffix Tree  Suffix Trees and Exact Matching  Longest Common Substring.
CSC-305 Design and Analysis of AlgorithmsBS(CS) -6 Fall-2014CSC-305 Design and Analysis of AlgorithmsBS(CS) -6 Fall-2014 Design and Analysis of Algorithms.
Advanced Algorithms Analysis and Design
String Matching (Chap. 32)
HIERARCHY THEOREMS Hu Rui Prof. Takahashi laboratory
Rabin & Karp Algorithm.
Fast Fourier Transform
Pattern Matching With Don’t Cares Clifford & Clifford’s Algorithm
String-Matching Algorithms (UNIT-5)
Decidable Languages Costas Busch - LSU.
Pattern Matching 12/8/ :21 PM Pattern Matching Pattern Matching
Algorithm Discovery and Design
Pattern Matching 1/14/2019 8:30 AM Pattern Matching Pattern Matching.
Pattern Matching 2/15/2019 6:17 PM Pattern Matching Pattern Matching.
Pattern Matching Pattern Matching 5/1/2019 3:53 PM Spring 2007
Pattern Matching 4/27/2019 1:16 AM Pattern Matching Pattern Matching
Presentation transcript:

28 Aug, 2006PSC Song Classification for Dancing Manolis Cristodoukalis, Costas Iliopoulos, M. Sohel Rahman, W.F. Smyth

28 Aug, 2006PSC Classical Pattern Matching Input: A text T = T[1..n], A Pattern P = P[1..m], both over the alphabet . Output: Whether P occurs in T If yes, then the set occ(P) = {i | T[i..i+m-1 ] = P}

28 Aug, 2006PSC Example – Pattern matching AAGCTA Pattern Text Pattern P = AAGCTA Text T = CAAGCTAAGCTAC CCGTAAGCTAAAC AAGCTA Occ(P) = {2, 7}

28 Aug, 2006PSC Our Case Input: TextA musical Sequence PatternRhythm Output: Slightly different from Classical PM A ‘extended/modified’ notion of PM

28 Aug, 2006PSC Musical Sequence A string t = t[1]t[2]…t[n] t[i]   N + Example: [0,50,100,200,250,300,350,400,500,550] Significance: Sequence of events!

28 Aug, 2006PSC Musical Sequence A string t = t[1]t[2]…t[n] t[i]   N + Example: [0,50,100,200,250,300,350,400,500,550] Some (musical) event occurs at 0 ms

28 Aug, 2006PSC Musical Sequence A string t = t[1]t[2]…t[n] t[i]   N + Example: [0,50,100,200,250,300,350,400,500,550] Some (musical) event occurs at 0 ms Some (musical) event occurs at 50 ms

28 Aug, 2006PSC Musical Sequence A string t = t[1]t[2]…t[n] t[i]   N + Example: [0,50,100,200,250,300,350,400,500,550] Some (musical) event occurs at 0 ms Some (musical) event occurs at 50 ms Some (musical) event occurs at 100 ms And so on…

28 Aug, 2006PSC Musical Sequence [0,50,100,200,250,300,350,400,500,550] Alternative Representation (We use) [50,50,100,50,50,50,50,100,50] Significance: Sequence of “duration” of the events!

28 Aug, 2006PSC Musical Sequence First Representation Duration of First Event = 50 – 0 = 50 50

28 Aug, 2006PSC Musical Sequence First Representation Duration of Second Event = 100 – 50 = 50 50

28 Aug, 2006PSC Musical Sequence First Representation Duration of Second Event = 200 – 100 =

28 Aug, 2006PSC Musical Sequence First Representation Alternative Representation

28 Aug, 2006PSC Rhythm A string r = r[1]r[2]…r[m] r[j]  {Q, S} Q means a quick(er) event S means a slow(er) event S is double the length (duration) of Q Exact length of Q or S is not a priori known

28 Aug, 2006PSC New Notion of Match Let Q  q  N + Then S  2  q Q matches t[i..i’] iff q = t[i] + t[i+1] + … + t[i’] 1  i  i’  n If i = i’ then the match is SOLID

28 Aug, 2006PSC New Notion of Match Let q = = 150 = q Q

28 Aug, 2006PSC New Notion of Match Let q = = 150 = q Q Q

28 Aug, 2006PSC New Notion of Match Let q = Q Q Q Q Q Q

28 Aug, 2006PSC New Notion of Match Let q = Q Q Q Q Q Q Solid Match

28 Aug, 2006PSC New Notion of Match S  2  q S matches t[i..i’] iff either of following is true: i = i’ and t[i] = 2q (SOLID) i  i’ and there exists i  i 1  i’ such that q = t[i] + t[i+1] + … + t[i 1 ] = t[i 1 +1] + t[i+1] + … + t[i’] 1  i  i’  n So, S is either solid or a tile of 2 consec utive Q’s

28 Aug, 2006PSC New Notion of Match Let q = 100, then S  2q = 200 t[1] + t[2] = 100 = t[3] S

28 Aug, 2006PSC New Notion of Match Let q = 100, then S  2q = 200 t[4] + t[5] = 100 = t[6] + t[7] S S

28 Aug, 2006PSC New Notion of Match Let q = 100, then S  2q = S S S S

28 Aug, 2006PSC New Notion of Match Let q = 100, then S  2q = S S SS Although, t[2] + t[3] + t[4] = 200 = 2q S

28 Aug, 2006PSC New Notion of Match Let q = 100, then S  2q = S S S S S S

28 Aug, 2006PSC New Notion of Match Let r = QSS and Let q = Q S S r r matches t[2..5]

28 Aug, 2006PSC New Notion of Match Let r = QSS and Let q = Q S S r r Q S S r matches t[5..8]

28 Aug, 2006PSC New Notion of Match Let r = QSS and Let q = Q S S r r r covers t[2..8] Q S S

28 Aug, 2006PSC Our Problem Input: A musical Sequence t A rhythm r Output: The longest substring t[i..i’] that is covered by r

28 Aug, 2006PSC Restriction For each match of r, at least one S mus t be solid Let r = QSS and Let q = Q S r S SOLID S

28 Aug, 2006PSC Restriction For each match of r, at least one S mus t be solid Let r = QSS and Let q = r Q S r S At least one S must be Solid

28 Aug, 2006PSC Restriction For each match of r, at least one S mus t be solid Let r = QSS and Let q = r Q S r S At least one S must be Solid SOLID S

28 Aug, 2006PSC Motivation Our aim is to classify music according to dancing rhythm Music seq can be considered as a series of events corresponding to music signal s Drum beats Guiter picks Horn hits

28 Aug, 2006PSC Motivation The intervals between these events cha racterize how the song is danced Basically two dancing rhythms: Quick & Slow Example: cha-cha  SSQQSSSQQS foxtrot  SSQQSSQQ jive  SSQQSQQS

28 Aug, 2006PSC Motivation So solution to our problem can classify songs according to dancing rhythms!

28 Aug, 2006PSC Algorithm Stage 1: Find all occurrences of S for a chosen value    such that  /2  . Stage 2: Transform areas around each S into sequences of Q. Stage 3: Find the matches of r and cons equently the cover.

28 Aug, 2006PSC Algorithm: Stage 1 We construct two arrays: first[1..|  |]: first[  ] = i iff the first occurre nce of symbol  appears at position i. next[1..n]: next[i] = j iff the next occurren ce of symbol at t[i] appears at t[j].

28 Aug, 2006PSC Algorithm: Stage  = {50, 100}, assume indexed alphabet

28 Aug, 2006PSC Algorithm: Stage  = {50, 100}, assume indexed alphabet first[1] = 1 First occurrence of 50

28 Aug, 2006PSC Algorithm: Stage  = {50, 100}, assume indexed alphabet first[1] = 1 first[2] = 3First occurrence of 100

28 Aug, 2006PSC Algorithm: Stage next[1] = 2Next occurrence of t[1] = 50

28 Aug, 2006PSC Algorithm: Stage next[1] = 2next[2] = 4Next occurrence of t[2] = 50

28 Aug, 2006PSC Algorithm: Stage next[1] = 2 next[3] = 8 next[2] = 4 Next occurrence of t[3] = 100 And so on …

28 Aug, 2006PSC Algorithm: Stage … 1011 … S Consider an S at t[5].

28 Aug, 2006PSC Algorithm: Stage … 1011 … S Q

28 Aug, 2006PSC Algorithm: Stage … 1011 … S Q Q

28 Aug, 2006PSC Algorithm: Stage … 1011 … S Q Q > 50 So Stop!

28 Aug, 2006PSC Algorithm: Stage … 1011 … S Q Q Q

28 Aug, 2006PSC Algorithm: Stage … 1011 … S Q Q Q Q So we get a new sequence t consisting of Q and S

28 Aug, 2006PSC Algorithm: Stage 3 Here we get t consisting of Q and S. We first want to find the matches of r in t. Define S t  S in t, Q t  Q in t Define S r  S in r, Q r  Q in r

28 Aug, 2006PSC Algorithm: Stage 3 Construct t  as follows: S t = 01, Q t = 1 Construct Invalid set I where I contains the position of 1 due to S t. QQSQQ

28 Aug, 2006PSC Algorithm: Stage 3 Construct t  as follows: S t = 01, Q t = 1 Construct Invalid set I where I contains the position of 1 due to S t. QQSQQ No match can occur at position 4 because it is not a ‘ real ’ position in t I = {4} 12354

28 Aug, 2006PSC Algorithm: Stage 3 Construct r as follows: S r = 10, Q r = 0 SQ 1 0 0

28 Aug, 2006PSC Algorithm: Stage 3 Construct r as follows: S r = 10, Q r = 0 SQ

28 Aug, 2006PSC Algorithm: Stage 3 Find matches of r’ in t’’. Perform bitwise or at each position. If the result is all 1 and the position is not i n invalid set then a match Otherwise no match

28 Aug, 2006PSC Algorithm: Stage 3 Find matches of r’ in t’’ Bitwise Or 110 No Match!!! I = {4}

28 Aug, 2006PSC Algorithm: Stage 3 Find matches of r’ in t’’ Bitwise Or 100 No Match!!! I = {4}

28 Aug, 2006PSC Algorithm: Stage 3 Find matches of r’ in t’’ Bitwise Or 111 All 1 ’ s!!! And 3  I. So a MATCH!!! I = {4}

28 Aug, 2006PSC Algorithm: Stage 3 Find matches of r’ in t’’ Bitwise Or 111 All 1 ’ s!!! But, 4  I. So NO MATCH!!! I = {4}

28 Aug, 2006PSC Algortihm In this way we can find the matches & then we can easily compute the cover

28 Aug, 2006PSC Conclusion In practical cases size of the rhuthm is 10  13. So we have assumed m to be constant. It would be interesting, however, to remove t he dependency on m It would be interesting to remove the restricti on of one S being Solid Applying another restriction on the number of additions in the numeric text may turn out to be useful