ANSWER:
$$ \begin{eqnarray} 3^{\log_2(\log_5 x)}(\log_2 5)^{\log_2 3} & = & 6^{\log_2 3} \\ (\log_5 x)^{\log_2 3}(\log_2 5)^{\log_2 3} & = & 6^{\log_2 3} \\ (\log_5 x)(\log_2 5) & = & 6 \\ \frac{\log_2 x}{\log_2 5}(\log_2 5) & = & 6 \\ \log_2 x & = & 6 \\ x & = & 2^6 \\ x & = & 64 \\ \end{eqnarray} $$public static long f(List a) { if (a.size() > 1) { f(a.subList(0, a.size()/2)); f(a.subList(3*a.size()/8, 7*a.size()/8)); f(a.subList(a.size()/4, 3*a.size()/4)); f(a.subList(a.size()/8, 5*a.size()/8)); f(a.subList(a.size()/2, a.size())); for (int i = 0; i < a.size(); i++) { for (int j = 0; j < i; j++) { System.out.print("*"); } } } }
ANSWER:
Pretty much by inspection, you can see there are 5 recursive calls, each operating on a list half the size of the input, followed by the printing of $\sum_{i=1}^n{i}$ stars, so:
$$ T(n) = 5T(\frac{n}{2}) + \frac{n(n+1)}{2} $$Using the Master Theorem: $a=5$, $b=2$, $d=2$, and since $d < \log_2{5}$, we have $T(n) \in \Theta(n^{\log_2{5}})$.
ANSWER:
Okay so $\widetilde{O}(f)$ is the set of all functions asymptotically bounded above by $\lambda n. cf(n)(\log n)^k$ for some constants $c$ and $k$. So let’s consider $\widetilde{O}(n^3)$. This is the set of all functions asymptotically bounded above by:
$$ \lambda n. cf(n^3)(\log n)(\log n)(\log n)\cdots(\log n) $$No matter how many $\log n$ factors we have, that value will, beyond some value $N$, be less than: $$ \lambda n. cf(n^{3+\varepsilon}) $$ no matter how small you make $\varepsilon$, it still outruns all those log factors, in the limit, at least. How can we prove this? Um, well, that would be a good question to ask on Math StackExchange.
ANSWER:
Here’s the key:
T H E Q U I C K B R O W N F X A D G L M P S V Y ZNow
W O O H O O 2 2 2 0 2 2 1 0 0 1 0 0yields
22 20 22 10 01 00 N O N I H T
The ciphertext is NONIHT.
ANSWER:
10 4 4 3 1 3 3 4 7 10 / / \ / \ / \ / \ / \ / \ / \ / 10 10 16 4 16 3 16 4 16 4 16 7 16 10 16 16 / / \ / / \ / 10 10 4 10 10 7 10
ANSWERS INLINE:
ANSWER:
I don't know yet. I just sent Dr. Dorin a query to see if he knows.
ANSWER:
Do the standard depth-first traversal, marking nodes with colors as you go, always checking previously colored nodes. If you complete your traversal without running into any conflicts, report true. Report false on the first conflict.
ANSWER:
Las Vegas, because it will eventually finish (assuming the random number generator is really random), though it might take a long, long, time.
ANSWERS INLINE:
A weight=4 value=13 | B weight=6 value=10 | C weight=5 value=8 | D weight=7 value=5 | E weight=3 value=14 | |
---|---|---|---|---|---|
1 | 0 | 0 | 0 | 0 | 0 |
2 | 0 | 0 | 0 | 0 | 0 |
3 | 0 | 0 | 0 | 0 | 14 |
4 | 13 | 13 | 13 | 13 | 14 |
5 | 13 | 13 | 13 | 13 | 14 |
6 | 13 | 13 | 13 | 13 | 14 |
7 | 13 | 13 | 13 | 13 | 27 |
8 | 13 | 13 | 13 | 13 | 27 |
9 | 13 | 13 | 21 | 21 | 27 |
10 | 13 | 23 | 23 | 23 | 27 |
11 | 13 | 23 | 23 | 23 | 27 |
12 | 13 | 23 | 23 | 23 | 35 |
13 | 13 | 23 | 23 | 23 | 37 |
14 | 13 | 23 | 23 | 23 | 37 |
15 | 13 | 23 | 31 | 31 | 37 |