Logo image
The Discrete Convolution Method for Solving the Exact String Matching Problem
Thesis

The Discrete Convolution Method for Solving the Exact String Matching Problem

Hou, Kuan-Wei
Masters, 國立清華大學, 電機工程學系
2011

Abstract

字串比對 旋積 機率 終止 移位加法演算法 string matching convolution probability termination shift-add algorithm
In this thesis, we introduce discrete convolution method on solving the exact string matching problem. Based on the assumption that all the text and pattern strings are generated randomly, we derived an equation which can approximate the probability of appearing of a pattern string in a text string. From this equation, we see that the probability that a pattern string appears in a text string reduces to 0 quickly as the length of the pattern string increases. Because of this observation, we introduce an algorithm based on the discrete convolution method with early termination. The algorithm terminates as soon as it discovers that a prefix of the pattern string does not appear in the text string. We show that the discrete convolution method with early termination is quite efficient to solve exact string matching problem for randomly generated text and pattern strings. In this thesis, we also show that the shift-add algorithm is equivalent to and can be implemented by the discrete convolution.

Metrics

1 Record Views

Details

Logo image