Data Structures and Algorithms in Python
by Michael T. Goodrich, Roberto Tamassia, Michael H. Goldwasser
Appendix B
Useful Mathematical Facts
In this appendix we give several useful mathematical facts. We begin with some combinatorial definitions and facts.
Logarithms and Exponents
The logarithm function is defined as
![]()
The following identities hold for logarithms and exponents:
- logb ac = logba + logbc
- logb a/c = logba − logbc
- logb ac = clogba
- logb a = (logca)/logcb
- blogc a = alogcb
- (ba)c = bac
- ba bc = ba+c
- ba /bc = ba−c
In addition, we have the following:
Proposition B.1: If a > 0, b > 0, and c > a + b, then
loga + logb < 2logc − 2.
Justification: It is enough to show that ab < c2/4. We can write

The natural logarithm function lnx = loge x, where e = 2.71828. . ., is the value of the following progression:
![]()
In addition,

There are a number of useful inequalities relating to these functions (which derive from these definitions).
Proposition B.2: If x > −1,
![]()
Proposition B.3: For 0 ≤ x < 1,
Proposition B.4: For any two positive real numbers x and n,
Integer Functions and Relations
The “floor” ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access