0 0 votes can you please explain how 1-(1/2)^ln(n) becomes (n-1)/n ? Answer will be $\Theta(n)$ \[ \begin{aligned} j & =n / 2+n / 4+n / 8+\ldots+1 \\ & =n\left[1 / 2^{1}+1 / 2^{2}+1 / 2^{3}+\ldots+1 / 2^{\lg n}\right] \end{aligned} \] (Sum of first $n$ terms of GP is $\left[a \cdot \frac{1-r^{r}}{1-r}\right]$, where $a$ is the first term, $r$ is the common ratio $<1$, and $n$ is the number of terms)<br /> \[ \begin{array}{l} =n\left[1 / 2 \frac{1-(1 / 2)^{18 n}}{1-1 / 2}\right] \\ =n\left[\frac{n-1}{n}\right] \Leftarrow \\ =n-1=\Theta(n) \end{array} \] Algorithms algorithms time-complexity test-series + – mehul vaidya 877 views answer comment Share Follow Print See all 3 Comments 3 3 Comments reply Shaik Masthan commented Aug 16, 2018 reply Follow flag 1-$({\frac{1}{2}})^{lg n}$ = 1-$({2^{-1}})^{lg n}$ = 1-$({2})^{-lg n}$ = 1-$({2})^{{lg\; (n}^{-1})}$ =1-$({n^{-1}})^{lg 2}$ = 1-$({n^{-1}})^{1}$ = 1-$({n^{-1}})$ = 1-$\frac{1}{n}$ = $\frac{n-1}{n}$ 1 1 replyShare arvin commented Aug 16, 2018 reply Follow flag see (1/2)log2n can be writen as... 1/ 2log2n = 1/nlog22 = (1/n) (nlogab <==> blogan) this is the formulae... 1 1 replyShare mehul vaidya commented Aug 16, 2018 reply Follow flag Thank You @Shaik Masthan , You have answered many of my doubts, Your help is truly invaluable. Regard 0 0 replyShare Please log in or register to add a comment.
Best answer 2 2 votes could you post full question, just curious Vegeta answered Aug 16, 2018 • selected Aug 16, 2018 by mehul vaidya Vegeta comment Share Follow See 1 comment 1 1 comment reply mehul vaidya commented Aug 16, 2018 reply Follow flag https://gateoverflow.in/976/gate2006-15 0 0 replyShare Please log in or register to add a comment.
1 1 vote Here 1/2 is cancel out by 1 - 1/2 $n[1 - (1/2) ^\ log n]$ log property :: 2 ^ log n (base 2) then replace n with 2 = n ^ log 2 = n So, our equestion are in form ->n[1 - ( 2^(-1) ) ^logn] so we can write as n[1 - (n^-1) ^ log2 ] then = $n[ 1- 1/n ]$ = $n[ \frac{n-1}{n} ]$ = $ n - 1 $ arya_stark answered Aug 16, 2018 • edited Aug 16, 2018 by arya_stark arya_stark comment Share Follow 0 reply Please log in or register to add a comment.