The purpose of this book is to give the reader a taste of discrete mathematics and its applications in the computer field. The audience for this book includes computer science students who want a broad and accessible overview of discrete mathematics and its applications to the computer field.
Introduction
The Greeks invented democracy and their democracy was radically different from today's representative democracy.4 The sophistication of Greek architecture and sculpture is evident in the Parthenon on the Acropolis and the Elgin Marbles5 now held in the British Museum in London . 4Athenian democracy included the full participation of the citizens (i.e., the male adult members of the city-state who were not slaves), while in representative democracy, the citizens elect representatives to govern and represent their interests.
The Babylonians
The fall of the Roman Empire in Western Europe led to a decline in knowledge and learning in Europe. The counting board is an early version of the abacus and was usually made of wood or stone.
The Egyptians
Champollion's insight was that the group of hieroglyphic symbols represented the name of the Ptolemaic pharaoh "Ptolemy". The Rhind papyrus also addressed problems such as calculating the number of bricks needed for a part of a building project.
The Greeks
Power was placed in the hands of the citizens, who were men (women or slaves did not participate in Athenian democracy). Archimedes also calculated an upper limit on the number of grains of sand in the known universe.
The Romans
The Romans seem to have been aware of a device similar to the Antikythera that was able to calculate the position of the planets. It involves replacing each letter in the plaintext (i.e., the original message) with a letter that is a fixed number of positions lower in the alphabet.
Islamic Influence
This led to the preservation of Greek texts during the Dark Ages in Europe. The origin of the word algorithm from the name of the Islamic scholar 'Al-Khwarizmi'.
Chinese and Indian Mathematics
Indian mathematicians have made significant contributions such as the development of the decimal notation of numbers, which is now used worldwide. Knowledge of decimal numbers reached Europe through Arab mathematicians and the resulting system is known as the Hindu-Arabic numeral system.
Review Questions
This was known as the Taming Calendar and it was based on a cycle of 391 years. They were familiar with the theorem and proof of Pythagoras' theorem, rational numbers, quadratic equations, as well as calculating the square root from 2 to five decimal places.
Summary
We began our journey by examining some of the contributions of the Babylonians. We then moved on to look at some of the achievements of the Egyptians, the Greeks and the Romans; Islamic scholars; and the Indians and Chinese.
Introduction
There are many examples of sets such as the set of natural numbersℕ, the set of integersℤ and the set of rational numbersℚ. The domain of a function (denoted by domf) is the set of values in A for which the partial function is defined.
Set Theory
The cardinality (or size) of an affine set S determines the number of elements present in the set. Note Russell's paradox can also be illustrated by the story of a town that has exactly one barber who is a man. The barber shaves all and only those men in town who do not shave themselves.
Relations
Example 2.6 (Symmetric relationship) The graph of a symmetric relationship will show fromatoban versus arrow frombtoa for each arrow. Example 2.7 (Transitive relation) The graph of a transitive relation will show that whenever there is an arrow from ato and an arrow from btoc, there is an arrow from atoc.
Functions
A table is a visual representation of a relationship, and the data is organized in rows and columns. The domain of a function (denoted by dom f) is the set of values in A for which the function is defined.
Application of Functions
The scope of a formal parameter (eg the parameter k above in the function sqr) is limited to the definition of the function in which it occurs. The definition of the factorial function uses two equations, which are distinguished by the use of different patterns in the formal parameters.
Review Questions
Miranda is a higher order language and it allows functions to be passed as parameters and returned as results. Pooling is allowed, and this allows a function of n arguments to be treated as a function of 1 arguments.
Summary
Introduction
For example, the public key RSA cryptographic system relies on its security because of the infeasibility of the integer factorization problem for large numbers. The real numbers ℝ are defined as the set of converging sequences of rational numbers and they are a superset of the rational numbers.
Elementary Number Theory
The product of two numbers is even if at least one of the numbers is even. The proof is indirect: that is, the opposite of the desired result is assumed to be correct, and it is shown that this assumption leads to a contradiction.
Prime Number Theory
The least common multiple is the least common multiple of a and b and is denoted lcm (a,b). Euclid's algorithm is one of the oldest known algorithms and provides a procedure for finding the greatest common divisor of two numbers.
Theory of Congruences 6
However, x does not always have an inverse modulo, and this is clear because, for example, [3]6 is a zero divisor modulo 6, i.e. [3]6. Given n> 0, there are u(n) numbers that are relatively prime, and there are u(n) numbers that have an inverse modulus.
Binary System and Computer Representation of Numbersof Numbers
The base 2 is written on the left side and the number to be converted to binary is placed in the first column. For example, a 2-byte integer has 16 bits, with the first bit used as the sign bit (the sign is 1 for negative integers and 0 for positive integers), and the remaining 15 bits represent the number.
Review Questions
An integer number is represented by a sequence (usually 2 or 4) of bytes where each byte is 8-bit. A positive number is represented by the normal binary representation discussed earlier, while a negative number is represented by using 2's complement of the original number (ie 0 changes to 1 and 1 changes to 0 and the sign bit is 1) .
Summary
Introduction
Thus, we have shown that if the formula is true for an arbitrary natural number, then it is true for its successor+ 1. Thus, we have shown that if the binomial theorem is true for an arbitrary natural number, then it is true for of the successor+ 1.
Strong Induction
So we have shown that if all natural numbers smaller than or equal to k are divisible by a prime number, then nk+ 1 is divisible by a prime number. We have shown that the base case P(2) is true, and so it follows by strong mathematical induction that every natural number greater than one is divisible by some prime number.
Recursion
A binary tree4 is a well-known data structure in computer science and consists of a root node along with a left and right binary tree. This means that a binary tree has a root node and may have no subtrees; it can only consist of a root node with a left subtree; root node with right subtree only; or a root node with left and right subtrees.
Structural Induction
A binary tree is defined as a finite set of nodes (starting with the root node), where each node consists of a data value and a link to a left subtree and a right subtree. Base Step A single node is a binary tree rootð Þ Recursive Step. i) Suppose X and Yare binary trees and x is a node then XxY is a binary tree, where X is the left subtree, the right subtree, and the new root node. ii) Suppose X is a binary tree and x is a node then xX and Xx are binary trees, consisting of the root node and a single child left or right subtree.
Review Questions
Example 4.6 (Structural Induction) We have given a recursive definition of the subset So of natural numbers that consists of all multiples of 5. We have not proved that all elements of the set S are divisible by 5, and we prove this by structural induction.
Summary
Recursion can be used to define functions, sequences, and sets in mathematics, and a recursive definition consists of two parts, namely the base case and the recursive step. It can be used to show that all members of a recursively defined set have some property, and the proof consists of two parts, namely the base case and the recursive (inductive) step.
Introduction
We find that the total number of outcomes after the first operation is followed by the second operation, which is m n. A combination is the selection of a certain number of objects in any order, the order of selection is not important.
Sequences and Series
The order of the arrangement is important as the arrangement 'abc' is different from 'cba'. A series is the sum of terms in a sequence, and the sum of the first terms of the sequence1,a2,….an… is given by a1+a2+ +which is denoted by.
Arithmetic and Geometric Sequences
A series is convergent if its sum approaches a certain value, becomes larger and larger, and it is formally written as.
Arithmetic and Geometric Series
Example (Geometric series) Find the sum of the first terms of the following geometric series What is the sum of the series. The sum of the series is the limit of the sum of the first terms approaching infinity.
Simple and Compound Interest
The case of whenr= 1 corresponds to the arithmetic series a +a+ +a, and the sum of this series is simply na. Finally, at the end of year 3, another 121 euros in interest is earned, so the new principal is 1331 euros, and the total interest earned for the 3 years is the sum of the interests earned for each year (ie 331 euros).
Time Value of Money and Annuities
Permutations and Combinations
There are three possible outcomes resulting in an even number and two outcomes from a coin toss. There are three possible outcomes resulting in an odd number and six outcomes from rolling a die.
Review Questions
Summary
Introduction
Linear algebra deals with the solution of a set of linear equations and the study of matrices (see ch.8) and vectors. Abstract algebra deals with the study of abstract algebraic structures such as monoids, groups, rings, integral domains, fields, and vector spaces.
Simple and Simultaneous Equations
Example (Simultaneous equation - elimination method) Solve the following simultaneous equations using the elimination method. Simultaneous equation - method of elimination) The approach is to manipulate both equations so that one or xoria can be eliminated and thus reduced to a simple. Example (Simultaneous Equation - Graphing Techniques) Find the solution of the following simultaneous equations using graphing techniques:. Simultaneous Equation - Graphical Techniques) Each simultaneous equation represents a line, so the solution of both simultaneous equations is the point of intersection of the two lines (if any).
Quadratic Equations
Example 2 (Quadratic Equations—Quadratic Formula) Solve the quadratic equation 2x2+ 5x–3 = 0 using the quadratic formula. Quadratic Equations—Quadratic Formula) For these examples = 2;b= 5; and c= −3, and these values are entered into the quadratic formula. The graphical solution to the quadratic equation is then given by the points where the curve intersects the X-axis (ie y = 0 on the X-axis).
Indices and Logarithms
There may be no solution (ie, the curve does not intersect the X-axis), one solution (a double root), or two solutions. The graph of the curve= 2x2− x− 6 is given below, and therefore the points where the curve intersects the X-axis are determined.
Horner ’ s Method for Polynomials
Abstract Algebra
Setytox0y+aj(ie.bjforP) and ztox0z+y(ie.bj−1forQ) (iii) Calculate b0settingytox0y+a0. i) The set of sequences R* under relation to the empty sequence K element of the identity. ii) The set of integers under addition forms an infinite monoid in which 0 is the identity element. If the order of Gisfinite, then Gis is said to be a finite group. i) The set of integers under addition (ℤ, +) forms an infinite set in which 0 is the identity element. ii) The set of matrices with integer 22 under addition, where the identity element is 0 0. iii).
Review Questions
Summary
Introduction
The memory of the Turing machine is a tape consisting of a potentially infinite number of one-dimensional cells. The Turing machine provides a mathematical abstraction of computer execution and storage, as well as a mathematical definition of an algorithm.
Finite-State Machines
A string2R* is accepted by the finite-state machine if d*(q0,s) =qf where qf2F and the set of all strings accepted by the finite-state machine is the language generated by the machine. Affinite-state machine is called deterministic (Fig. 7.2) if the transition function is a function,2 and otherwise (where it is a relation) it is said to be non-deterministic.
Pushdown Automata
This means that if the input symbol occurs in state q1, and the symbol on top of the stack is b, then bit is popped from the stack and pushed onto the stack. Finally, part (6) states that the automaton may move from stateq1 to the accepting stateqf only when the stack consists of the single stack symbolZ.
Turing Machines
The unlimited supply of paper is formalized in the Turing machine by a paper tape marked in squares, and the tape is potentially infinite in both directions. The FSM is essentially the machine's controller, and the tape is essentially the store.
Review Questions
However, if the problem is unsolvable, then the machine will either stop or count forever. Turing also introduced the concept of a Universal Turing Machine and this machine is able to simulate any other Turing machine.
Summary
A state transition is determined from the current state of the machine, the input symbol, and the element at the top of the stack. A Turing machine is the most powerful model for computation and is equivalent to an actual computer in the sense that it can compute exactly the same set of functions.
Introduction
It is possible to deal with matrices with an infinite number of rows and columns, and although such matrices cannot be written explicitly, it is still possible to add, subtract, and multiply with a scalar, provided that each has a well-defined entry (ie, j) of the matrix element. The use of efficient algorithms for matrix computation is essential, and this is an active area of research in the field of numerical analysis.
Two Two Matrices
The addition of two 22 matrices A and B is given by a matrix whose entries are the addition of the individual components of A and B. The identity matrix being added is given by the matrix whose entries are all 0, and has the property that A + 0 = 0 + A = ONE.
Matrix Operations
The multiplicative identity matrix I has the property that A I = IA = A, and is given as. The identity matrix I is an n matrix and the entries are given by rij where rii= 1 andrij= 0 kui6¼j (Fig.8.3).
Determinants
In other words, the determinant of A is determined by taking each row of A and multiplying each element by the corresponding cofactor and adding the results. Cramer's rule is a theorem that expresses the solution of a system of linear equations with several unknowns using the determinant of a matrix.
Eigen Vectors and Values
The polynomial function p(k) = det (A−kI) is called the characteristic polynomial of A and is from degreen. The characteristic equation isp(k) = 0 and since the polynomial is of degreen, there are at most roots of the characteristic equation, and thus at most eigenvalues.
Gaussian Elimination
The other common approach to solving a set of linear equations is to use Cramer's rule, which was discussed in Sect.13.4. Finally, another possible (but computationally expensive) approach to solving the set of linear equations Ax= v is to compute the determinant and inverse of A, and then compute x= A−1v.
Review Questions
Summary
Eigenvalues and eigenvectors lead to the characteristic polynomial and each matrix satisfies its characteristic polynomial.
Introduction
The seven bridges of Königsberg2 (Figure 9.1) is one of the earliest problems in graph theory. In fact, Euler noted that for a walk through a graph, going through each edge exactly once depends on the degree of the nodes (i.e., the number of edges it touches).
Undirected Graphs
This matrix lists the vertices and edges in the rows and columns, and an entry of 1 is made if the vertex is one of the nodes of the edge and 0 otherwise. It is defined as the total length (number of edges) of the shortest path between v1 and v2.
Trees
The depth of a node is the path length (ie the number of edges) from the root to the node. The depth of a tree is the length of the path from the root to the deepest node of the tree.
Graph Algorithms
Graph Colouring and Four-Colour Problem
The chromatic number of a graph is the minimum number of colors needed to color the graph. Example 9.2 Show that the chromatic color of the following graph G is 3 (this example is adapted from [3]) (Figure 9.9).
Review Questions
Summary
It might be expected that many colors would be required, but the four-color theorem shows that four colors are actually sufficient to color a planar graph. A tree is a connected and acylic graph, and a binary tree is a tree where each node has at most two child nodes.
Introduction
His solution is one of the simplest and most widely known encryption techniques, and it involves replacing each letter in the plaintext (i.e. the original message) with a letter a fixed number of positions down the alphabet. The process of enciphering a message (i.e. the plaintext) simply involves going through each letter in the plaintext and writing down the corresponding cipher letter.
Breaking the Enigma Codes
The team at Bletchley Park broke the Enigma codes, making a vital contribution to the British and Allied war effort. The raw material (i.e. encrypted messages) to be deciphered came from wireless intercept stations dotted around Britain and from various overseas countries.
Cryptographic Systems
The link between British intelligence and Bletchley Park ended in the mid-1980s. In the mid-1990s, it was decided to restore Bletchley Park, and today it is run as a museum by the Bletchley Park Trust.
Symmetric Key Systems
The algorithm is then applied to each 64-bit message block and the plaintext message block is converted to a 64-bit ciphertext block. Decryption of ciphertext is similar to encryption and involves running the algorithm in reverse.
Public Key Systems
4 The private key is kept secret and the public key is published (but associated with the trading partner). This involves signature generation using the private key and signature verification using the public key.
Review Questions
Summary
It involves encrypting and decrypting messages, and theoretical results of number theory are used to convert the original messages (or plaintext) into encrypted text which is then sent to the intended recipient via a secure channel. The ciphertext is meaningless to anyone other than the intended recipient, and the received ciphertext is then decrypted so that the recipient can read the message.
Introduction
The modulator generates a signal that is used to transmit a sequence of symbols over the channel. The channel encoder introduces redundancy into the information sequence u, and the channel decoder uses the redundancy for error detection and correction.
Mathematical Foundations
A subset of a vector space is a basis for V if it consists of linearly independent vectors and its linear range is V (ie, the basis generates V). We will use the basis of the vector space of codewords to create a generator matrix to simplify the encoding of information words.
Simple Channel Code
In other words, if the symbol 0 is to be sent, the encoder will transmit the code word 000, and similarly, if the symbol 1 is to be sent, the encoder will transmit 111. In the first case when no encoder is used there are two errors while there is only one error when the encoder is used.
Block Codes
Each block is of length k (ie the information words are of length k) and is then encoded separately into codewords of length k. A block code (n, k) is a code where all code words are of length and all information words are of length k. v) The number of possible information words is given by M =qk(where each information symbol can have a qpossible value and the length of the information word isk). we).
Linear Block Codes
The parity check property of orthogonality holds if and only if the vector belongs to the linear block code. Example 9.5 (Parity check matrix—Hamming code) The purpose of this example is to construct the parity check matrix for the binary Hamming code and to show an example of the parity check orthogonality property.
Miscellaneous Codes in Use
Review Questions
Summary
Introduction