Mazdak Farrokhzad edited b) Algorithm.tex  almost 10 years ago

Commit id: 6a6272eef715e82587e1113f3b38df0ab9f7063c

deletions | additions      

       

However, if we only know the length of the input, and not the numbers themselves, we get differing upper and lower bounds. A binary number of length $n$ is any number $k$ such that $\floor{\log_2(k)}=n$. The smallest such number is $2^n$, and the largest such number is $2^{n+1}-1$. Let $n=\floor{\log_2(k)}$ be the length of $k$, and $m=\floor{\log_2(p)}$ be the length of $p$. We then get:  \[  T_{\verb|min|}(m, T_{\mathtt{min}}(m,  n) = \sum_{i=1}^{2^n}{\left[(i + 1) \cdot m\right]} \]  \[  T_{\verb|max|}(m, T_{\mathtt{max}}(m,  n) = \sum_{i=1}^{2^{n+1}-1}{\left[\floor{\log_2((2^{m+1}-1)^{i-1})} \cdot \floor{\log_2(2^{m+1}-1)} \right]} \]