# O\big(g(n)\big)

URL:: https://brilliant.org/courses/computer-science-algorithms/the-speed-of-algorithms-2/big-o-formally/3/
Author:: brilliant.org
## Highlights
> Here's the **formal, mathematical** definition of Big O:O:O:
> Let f(n)f(n)f(n) and g(n)g(n)g(n) be positive-valued functions and let O(g(n))O\big(g(n)\big)O(g(n)) be a set of functions.
> f(n)f(n)f(n) is in the set O(g(n))O\big(g(n)\big)O(g(n)) if the ratio f(n)/g(n)f(n)/g(n)f(n)/g(n) eventually stays at or below some constant ccc as nnn gets very large.
> For example, the function f(n)=99nf(n) = 99 nf(n)=99n is in O(n)O(n)O(n) because the ratio between f(n)f(n)f(n) and g(n)=ng(n) = ng(n)=n is always c=99c=99c=99. ([View Highlight](https://read.readwise.io/read/01ga7fmsfw2cs54wkk6bzys9ez))
---
Title: O\big(g(n)\big)
Author: brilliant.org
Tags: readwise, articles
date: 2024-01-30
---
# O\big(g(n)\big)

URL:: https://brilliant.org/courses/computer-science-algorithms/the-speed-of-algorithms-2/big-o-formally/3/
Author:: brilliant.org
## AI-Generated Summary
f(n) is in the set O(g(n)) if the ratio f(n)/g(n) eventually stays at or below some constant c as n gets very large.
## Highlights
> Here's the **formal, mathematical** definition of Big O:O:O:
> Let f(n)f(n)f(n) and g(n)g(n)g(n) be positive-valued functions and let O(g(n))O\big(g(n)\big)O(g(n)) be a set of functions.
> f(n)f(n)f(n) is in the set O(g(n))O\big(g(n)\big)O(g(n)) if the ratio f(n)/g(n)f(n)/g(n)f(n)/g(n) eventually stays at or below some constant ccc as nnn gets very large.
> For example, the function f(n)=99nf(n) = 99 nf(n)=99n is in O(n)O(n)O(n) because the ratio between f(n)f(n)f(n) and g(n)=ng(n) = ng(n)=n is always c=99c=99c=99. ([View Highlight](https://read.readwise.io/read/01ga7fmsfw2cs54wkk6bzys9ez))