Comp 283, 2025 Summer Session 1

Course Site for Comp 283

Useful Operators - Floor and Ceiling

The floor operator, denoted \(\left \lfloor{x}\right \rfloor\), tells us the greatest integer \(\leq x\).

The ceiling operator, denoted \(\left \lceil{x}\right \rceil\), tells us the smallest integer \(\geq x\).

(Basically, they’re just fancy ways of saying “round down” and “round up”)

Example

Property of Floor

\[x-1 < \left \lfloor{x}\right \rfloor \leq x\]

Property of Ceiling

\[x \leq \left \lceil{x}\right \rceil < x + 1\]

Bases

We usually represent numbers in base ten

Bases

Example

Base 2

Length of Binary Messages

If I want to express \(x\) in binary, how long will it be?

(In other words, how many bits will it take?)

Useful Operator - Divides

For all integers \(a,b\) we can say \(a\) divides \(b\), or \(a \mid b\), iff there exists some integer \(m\) such that \(a\cdot m = b\).

Example

\[\forall a \in \mathbb{Z}, a \mid 0\]

Useful Operator - Mod

For positive Integers, \(x \bmod y\) is the remainder of \(x/y\).

More generally, \(x \bmod y = x - \left \lfloor{x/y}\right \rfloor \cdot y\).

Examples

Congruence Modulo y

Another way we can express mods is via congruency.

\(x \equiv z \pmod y\) reads as “\(x\) is congruent to \(z\) mod \(y\)”.

What this means is that \(x \bmod y = z \bmod y\).

Example

GCD + Relatively Prime Numbers

The greatest common divisor of two integers \(x\) and \(y\), denoted \(GCD(x,y)\) is the largest positive integer that divides both \(x\) and \(y\).

Example

If \(GCD(x,y) = 1\), then \(x\) and \(y\) are relatively prime (also called coprime).