Function - Formula Sheet
Key Algorithmic Formulas and Syntax
| Formula Name | Syntax / Representation | Symbol Definitions |
|---|---|---|
| Function Definition | let rec fn a1 a2 ... an := k | fn: Function name rec: Keyword for recursion a1...an: Parameter variables k: Expression to compute |
| Function Type Mapping | x -> y | x: Input data type y: Output data type |
| Multi-parameter Mapping | x1 -> x2 -> y | x1: First input type x2: Second input type y: Output data type |
| Euclidean GCD Relation | gcd(a, b) = gcd(b, a mod b) | a, b: Positive integers mod: Modulo operator for remainder |
| Exponentiation Precondition | requires: b greater than or equal to 0 | b: Exponent value (must be non-negative) |
| Exponentiation Postcondition | returns: a to the power of b | a: Base value b: Exponent value |
More for this chapter
Book Back Questions10 textbook MCQs · solved
Additional MCQs15 extra MCQs · solved
Practice TestInteractive · instant score
Book Back TestTest yourself on the textbook set
Additional MCQ TestTest yourself on the extra set
Study NotesConcepts & methods
More chapters in Computer Science
View all
2 Data Abstraction
3 Scoping
4 Algorithmic Strategies
5 Python -Variables and Operators
6 Control Structures
7 Python functions
8 Strings and String manipulation
9 Lists, Tuples, Sets and Dictionary
10 Python Classes and objects
11 Database Concepts
12 Structured Query Language (SQL)
13 Python and CSV files
14 Importing C++ programs in Python.
15 Data manipulation through SQL
16 Data visualization using pyplot: line chart, pie chart and bar chart