The role of Mathematics in Computer Science
The position of Mathematics in Computer Science cannot be overemphasized. In this article, you are going to be told how computer science is related to mathematics. You will be given example with code sample using javascript syntax.
Definitions:
Computer Science is the study of computers and computational systems. Unlike electrical and computer engineers, computer scientists deal mostly with software and software systems; this includes their theory, design, development, and application … [University of Maryland, accessed 8th January 2021].
Computer science is the study of computational machines, computational problems, and computation itself … [Wikipedia 2021, accessed 8th January 2021].
Mathematics, the science of structure, order, and relation that has evolved from elemental practices of counting, measuring, and describing the shapes of objects … [Britainica 2020, accessed 8th January 2021].
Computation is any type of calculation that includes both arithmetical and non-arithmetical steps and which follows a well-defined model (e.g. an algorithm).
Mechanical or electronic devices (or, historically, people) that perform computations are known as computers. An especially well-known discipline of the study of computation in computer science.
History:
The history of computer science began long before our modern discipline of computer science, usually appearing in forms like mathematics or physics … [Wikipedia 2020, accessed 8th January 2021].
The pioneers and fathers of Computer Science were those from the field of Mathematics usually their first discipline or specialty, in addition to second disciplines ( like physics and electrical engineering among others). These founding fathers are not limited to Al-Khwarizmi, Blaise Pascal, John Von Neumann, Alan Turing, … down to Claude Shannon (whom in 1937, 1948, founded information theory, and laid foundations for practical digital circuit design) and Shima Masatoshi (whom in 1968, 1980 designed the Intel 4004, the first commercial microprocessor)
Mathematics and Computer Science:
While knowing how to program is essential to the study of computer science, it is only one element of the field. In fact, in computer science, programming languages are created and are seen as a tool used in communicating solutions to problems. Programing is used to express an Algorithm to a computer system.
If the fields of mathematics are to be seen as one it is[would be] called concrete mathematics which is made up of:
- Continuous Mathematics
- Discrete mathematics
Both 1 and 2 above are studied by both Computer Science and other Natural/Physical sciences and Engineering, however, 2 is more attributed to Computer Science. In Computer Science, while 1 is applied more in computer graphics, information theory, Machine Learning, …, 2 is applied in databases theory, logical proofs, and traditional programming as it uses mathematical structures to describe these applications.
Examples:
Function
Mathematical function:
Given f(x) = 2x + x — 1. Take x = 1.
Then we have that: f(1) = 2 (1) + 1–1 = 2+1–1 = 2
Programming function: To write code that mimics the math function, we code: Take x to be the same thing as the number below
const functionOfANumber = (number) => { return ( 2 * number ) + ( number ) — 1}
functionOfANumber(1) // 2
The function of a Function:
Let f(g(s)) = s / 2. Given the example above above, it look writing x = g(s)
So you have to look for first g(s) and then plug the result to f(g(s)). Take s = 4
Then g(4) = 4 / 2 = 2 … f(g(s)) = 2x + x -1 => f(2) = 2 * 2 + 2 -1 = 4 + 2 -1 = 5
This implies that f(g(s)) = 5 = f(g(4) => y.
In programming: We pass the second function g(s) as a parameter to the function f.
// f(x)
const functionOfANumberX = (number) => {return ( 2 * number ) + ( number ) — 1;};// g(s)
const functionOfANumberS = (number) => {
return ( number ) / 2;
}
// f(g(s))
const f_of_g_of_s = (f, g, s) => {
const result = f(g(s));console.log(result);return result;
}f_of_g_of_s(functionOfANumberX,functionOfANumberS, 4); // 5
Relational Databases employs the tools of set theory, relations, binary operations, functions and some other if not all mathematical structures.
Given the histories and definitions of both Computer Science and Mathematics, we[ I ] may define computer science as [to be] automated mathematics that is used to solve problems.