# Thread: Bit operations algorithm question

1. ## Bit operations algorithm question

Suppose that an algorithm uses $\displaystyle 3n^2+2^n$ bit operations to solve a problem of size $\displaystyle n$.

Suppose that your machine can perform one bit operation in $\displaystyle 10^{-9}$ seconds, how long does it take your algorithm to solve a problem of size given below.

Note, if your algorithm takes more than 60 seconds, answer in minutes. For more than 60 minutes, answer in hours. For more than 24 hours, answer in days. For more than 365 days, answer in years. For more than 100 years, answer in centuries.
a) 10
b) 20
c) 50
d) 100

Our class has been taught nothing so far concerning algorithm size, so I really need help on this. I've listed the question word for word.

2. Surely subbing in the n value will give you total amount of bit operations need then multiplying by 10^-9 will give you the amount of seconds it takes.

Ex.

for n = 100 you get...

$\displaystyle 3 \cdot 100^2 + 2^{100} = 1267650600228229401496703235376$ bit operations.

Multiply by 10^-9 to get roughly $\displaystyle 1.2676 \times 10^{21}$ seconds.

By the way I got that to be $\displaystyle 4.01969368413314759 \times 10^{11}$ centuries!

Surely subbing in the n value will give you total amount of bit operations need then multiplying by 10^-9 will give you the amount of seconds it takes.

Ex.

for n = 100 you get...

$\displaystyle 3 \cdot 100^2 + 2^{100} = 1267650600228229401496703235376$ bit operations.

Multiply by 10^-9 to get roughly $\displaystyle 1.2676 \times 10^{21}$ seconds.

By the way I got that to be $\displaystyle 4.01969368413314759 \times 10^{11}$ centuries!
Thanks for confirming what I thought was meant for us to do. The question wasn't really worded well for me. I thought it'd be a lot worse.