> For the complete documentation index, see [llms.txt](https://cs61b-2.gitbook.io/cs61b-textbook-fall-2026/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://cs61b-2.gitbook.io/cs61b-textbook-fall-2026/33.-sorting-and-algorithmic-bounds/33.2-math-problems-out-of-nowhere.md).

# 33.2 Math Problems Out of Nowhere

## A Math Problem

<details>

<summary>Is <span class="math">N!\in \Omega((\frac{N}{2})^\frac{N}{2})</span>Prove your answer. [Recall that ∈ Ω can be informally be interpreted to mean >=. In other words, does factorial grow at least as quickly as <span class="math">(\frac{N}{2})^\frac{N}{2}</span>?</summary>

10!

* 10 \* 9 \* 8 \* 7 \* 6 \* … \* 1

$$5^5$$

* 5 \* 5 \* 5 \* 5 \* 5

$$N!>(\frac{N}{2})^\frac{N}{2}$$ for large N, therefore $$N!\in \Omega((\frac{N}{2})^\frac{N}{2})$$

</details>

## Another Math Problem

<details>

<summary>Given: <span class="math">N!>(\frac{N}{2})^\frac{N}{2}</span>, which we used to prove our answer to the previous problem. Show that <span class="math">log(N!) \in \Omega(N * logN)</span>. [Recall: log means an unspecified base]</summary>

We have that $$N!>(\frac{N}{2})^\frac{N}{2}$$

* Taking the log of both sides, we have that $$log(N!)>log((\frac{N}{2})^\frac{N}{2})$$.
* Bringing down the exponent we have that $$log(N!)>\frac{N}{2}\*log((\frac{N}{2}))$$.
* Discarding the unnecessary constant, we have $$log(N!)>\Omega(N\*log(\frac{N}{2}))$$.
* From there, we have that $$log(N!)>\Omega(N\*log(N))$$. \[since $$log(\frac{N}{2})$$ is the same thing asymptotically as $$log(N)$$]

In other words, $$log(N!)$$ grows at least as quickly as $$N\*log(N)$$.

</details>

## Last Math Problem

<details>

<summary>In the previous problem, we showed that <span class="math">log(N!) \in \Omega(N * logN)</span>. Now show that <span class="math">N*logN \in \Omega(log(N!))</span>.</summary>

Proof:

* $$log(N!)=log(N)+log(N-1)+...+log(1)$$
* $$N\*logN=log(N)+log(N)+...+log(N)$$
* Therefore $$N\*logN \in \Omega(log(N!))$$

</details>

## Omega and Theta

<details>

<summary>Given <span class="math">N*logN \in \Omega(log(N!))</span> and <span class="math">log(N!) \in \Omega(N * logN)</span>. Which of the following can we say?<br><br>A. <span class="math">N*logN \in \Theta(log(N!))</span><br>B. <span class="math">log(N!) \in \Theta(N * logN)</span><br>C. Both A and B<br>D. Neither</summary>

Answer: C. Both A and B

</details>

## Summary

We’ve shown that $$N\*logN \in \Theta(log(N!))$$.

* In other words, these two functions grow at the same rate asymptotically.

As for why we did this, we will see in a little while...


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://cs61b-2.gitbook.io/cs61b-textbook-fall-2026/33.-sorting-and-algorithmic-bounds/33.2-math-problems-out-of-nowhere.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
