AMT-2a. Functions in Computer Science
AMT-2a. Functions in Computer Science
Mathematics
1 Introduction
In discrete mathematics, functions play a crucial role in various aspects of com-
puter science. A function in discrete math is a mapping from a set of inputs
(called the domain) to a set of possible outputs (called the codomain). Func-
tions are essential because they formalize the relationships between data, which
is key for algorithms, computation, and problem-solving in computer science.
1
2.3 Growth of Functions (Asymptotic Notation)
Definition: Functions that describe how the running time of an algorithm
grows as the input size increases. Common notations include Big O (O),
Big Omega (Ω), and Big Theta (Θ).
Importance: These functions are used to categorize algorithms based on
their efficiency and scalability.
Example: Bubble sort has O(n2 ) time complexity, and binary search has
O(log n).
2
2.7 Characteristic Functions
Definition: A characteristic function of a set A returns 1 if the element
belongs to A, and 0 otherwise.
Example:
f (a, m) = a mod m, f (17, 5) = 2
Example:
2n (exponential), log2 n (logarithmic)
3
3 Summary
Functions in discrete mathematics are the foundation for various applications
in computer science. They provide the basis for data structures, algorithms,
logic design, cryptography, complexity analysis, and much more. Understand-
ing functions and their properties allows computer scientists to design efficient
algorithms and systems for a wide range of computational tasks.