- #1
evinda
Gold Member
MHB
- 3,836
- 0
Hello! (Wave)
I am looking at the following exercise:
For each function $f(n)$ and for each time $t$ find the maximum size $n$ of the problem that can be solved in time $t$, assuming that the algorithm of the problem requires time $f(n)$ microseconds( 1 microsecond=$10^{-6}$ second)
Suppose that we have $f(n)=n!$ and want to fill the following array.
$$\begin{matrix}
\text{1 sec } & \text{1 min} & \text{1 hour } & \text{ 1 month } & \text{1 year} & \text{ 1 century} & \\
--- & --- & --- & --- & --- & --- &
\end{matrix}$$How can we find the desired values of $n$?
Do we have to use Stirling's approximation?Also we have to use the following relations, right? (Thinking)
I am looking at the following exercise:
For each function $f(n)$ and for each time $t$ find the maximum size $n$ of the problem that can be solved in time $t$, assuming that the algorithm of the problem requires time $f(n)$ microseconds( 1 microsecond=$10^{-6}$ second)
Suppose that we have $f(n)=n!$ and want to fill the following array.
$$\begin{matrix}
\text{1 sec } & \text{1 min} & \text{1 hour } & \text{ 1 month } & \text{1 year} & \text{ 1 century} & \\
--- & --- & --- & --- & --- & --- &
\end{matrix}$$How can we find the desired values of $n$?
Do we have to use Stirling's approximation?Also we have to use the following relations, right? (Thinking)
- 1 sec=$10^6$ ms
- 1 minute=$60 \cdot 10^6$ ms
- 1 hour=$3600 \cdot 10^6$ ms
- 1 day=$24 \cdot 3600 \cdot 10^6$ ms
- 1 month=$30 \cdot 24 \cdot 3600 \cdot 10^6$ ms
- 1 year=$12 \cdot 30 \cdot 24 \cdot 3600 \cdot 10^6 $ ms
- 1 century=$100 \cdot 12 \cdot 30 \cdot 24 \cdot 3600 \cdot 10^6$ ms