[x]
Posted via EE Mobile

Search, ask, and monitor your questions on the go with EE Mobile. Visit Experts Exchange from your mobile device and never be out of touch again.

06/03/2007 at 08:55AM PDT, ID: 22609745
[x]
Attachment Details
[x]
The Solution Rating System

With so many solutions, how can you tell which solutions are most likely to help you and which ones are not? To provide you with a tool to use, we rate our solutions based on various elements that most accurately determine if a solution is a quality solution. To explain what factors affect the solution rating, here are the elements we take into consideration when formulating our solution rating.

  • The Grade of the Solution
  • The Zone Rank of the Expert Providing the Solution
  • The Number of Author and Expert Comments
  • The Number of Experts Contributing
  • The Feedback of the Community

Your Input Matters
Because of the way the system is set up, the most important variable in this equation is you. As a member of Experts Exchange, you are able to cast your vote on the quality of the solutions in regard to how complete, accurate, helpful and easy to understand each solution is. When you provide your feedback, each rating is adjusted accordingly. So, if you see a solution that has a poor rating that you think is a good solution, let us know by rating it. As you do, the rating will be adjusted and will become more accurate for other members of our site.

If you have any suggestions that you would like to make for our rating system, please ask a question in the Suggestions Zone of Community Support.

Thank you!

7.0

How to prove order of growth in Big Theta

Asked by william007 in Algorithms

Tags: theta, big, order, growth, prove

This is an algorithm of BruteForceStringMatch found from the book "The design and analysis of algorithm" by anany Levitin at pg105.
The description of the algorithm:
Given a string of characters called the text and a string of m characters(m<=n) called the pattern, find the starting index of substring of the text that

matches the pattern.

Followed is the pseudo code:
for i<-0 to n-m do
  j <- 0
  while j<m and p[j]=T[i+j]
    j<-j+1
  if j=m return i
return -1

The book says that for this algorithm, the order of growth in Big Theta is nm, but it doesn't give the steps of proving it.

Hence I tried to write the prove on my own, this is what I try:
Since the worst case is to make all m comparisons before shifting the pattern and this can be happen for each of the n-m+1 tries, hence is has a total of m

(n-m+1) tries
To prove m(n-m+1) belong to the order of growth in Big Theta is nm, we need to show for all n>=n0, m>=m0 that
a(mn)<=m(n-m+1)<=b(mn) where a and b are positive integers and n0, m0 are nonnegative integers.
To prove the right inequality(upper bound)
m(n-m+1)
<=m(n-m+1+(m-1)) when m>=1,n>=0
<=mn
This proved the right inequality.(with b=1, m>=1 ,n>=0)

Is the assumption and procedure for proving right inequality correct? I am not sure of it because the book only mentioned for function of one input

parameter, says t(n), to show that the order of growth in Big Theta is g(n) we need to prove a(g(n))<=t(n)<=b(g(n)) for all n>=n0.
But this question seems like involved two input parameters. Is it correct that for function of two input parameters, says t(n,m), to show that the order of

growth in Big Theta is g(n,m) we need to prove a(g(n,m))<=t(n,m)<=b(g(n,m)) for all n>=n0, m>=m0?

If it is correct, may I know how to prove the left inequality, ie. a(mn)<=m(n-m+1)?
 
Loading Advertisement...
 
[+][-]06/03/07 09:02 AM, ID: 19204142

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]06/03/07 09:25 AM, ID: 19204196

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]06/04/07 08:40 AM, ID: 19209403

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]06/09/07 04:04 AM, ID: 19248015

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]06/15/07 05:45 PM, ID: 19296564

Experts Exchange has a courteous staff of administrators who help members get the most out of the website by means of administrative comments like this one.

Start your 30-day free trial to view this Administrative Comment or ask the Experts your question.

 
[+][-]06/19/07 04:56 AM, ID: 19314940

View this solution now by starting your 30-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zone: Algorithms
Tags: theta, big, order, growth, prove
Sign Up Now!
Solution Provided By: Vee_Mod
Participating Experts: 4
Solution Grade: B
 
 
[+][-]06/26/07 02:57 PM, ID: 19368191

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
 
Loading Advertisement...
20090824-EE-VQP-74