2. The Math of Asymptotics
Solve the two following problems:
• Algorithm A uses 8n primitive operations, while Algorithm B uses n2 primitive operations. Determine the value n0 such that A runs faster than B for all n ≥ n0.
• Algorithm A uses 10n primitive operations, while Algorithm B uses 2nlog n prim- itive operations. Determine the value n0 such that A runs faster than B for all n ≥ n0.
• Algorithm A uses 10nlog n primitive operations, while Algorithm B uses n2 prim- itive operations. Determine the value n0 such that A runs faster than B for all n ≥ n0.
Remark: log n stands for log2 n (logarithm in base 2 of n).