Note that there are some explanatory texts on larger screens.

plurals
  1. PORecurrences using Substitution Method
    text
    copied!<p>Determine the positive number c &amp; n0 for the following recurrences (Using Substitution Method):</p> <ol> <li><p>T(n) = T(ceiling(n/2)) + 1 ... Guess is Big-Oh(log base 2 of n)</p></li> <li><p>T(n) = 3T(floor(n/3)) + n ... Guess is Big-Omega (n * log base 3 of n)</p></li> <li><p>T(n) = 2T(floor(n/2) + 17) + n ... Guess is Big-Oh(n * log base 2 of n).</p></li> </ol> <p>I am giving my Solution for Problem 1:</p> <p>Our Guess is: T(n) = O (log_2(n)). By Induction Hypothesis assume T(k) &lt;= c * log_2(k) for all k &lt; n,here c is a const &amp; c > 0</p> <pre><code> T(n) = T(ceiling(n/2)) + 1 &lt;=&gt; T(n) &lt;= c*log_2(ceiling(n/2)) + 1 &lt;=&gt; " &lt;= c*{log_2(n/2) + 1} + 1 &lt;=&gt; " = c*log_2(n/2) + c + 1 &lt;=&gt; " = c*{log_2(n) - log_2(2)} + c + 1 &lt;=&gt; " = c*log_2(n) - c + c + 1 &lt;=&gt; " = c*log_2(n) + 1 &lt;=&gt; T(n) not_&lt;= c*log_2(n) because c*log_2(n) + 1 not_&lt;= c*log_2(n). </code></pre> <p>To solve this remedy used a trick a follows:</p> <pre><code> T(n) = T(ceiling(n/2)) + 1 &lt;=&gt; " &lt;= c*log(ceiling(n/2)) + 1 &lt;=&gt; " &lt;= c*{log_2 (n/2) + b} + 1 where 0 &lt;= b &lt; 1 &lt;=&gt; " &lt;= c*{log_2 (n) - log_2(2) + b) + 1 &lt;=&gt; " = c*{log_2(n) - 1 + b} + 1 &lt;=&gt; " = c*log_2(n) - c + bc + 1 &lt;=&gt; " = c*log_2(n) - (c - bc - 1) if c - bc -1 &gt;= 0 c &gt;= 1 / (1 - b) &lt;=&gt; T(n) &lt;= c*log_2(n) for c &gt;= {1 / (1 - b)} so T(n) = O(log_2(n)). This solution is seems to be correct to me ... My Ques is: Is it the proper approach to do? Thanks to all of U. </code></pre>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload