Professional Documents
Culture Documents
TOC Chapter-1-for reference
TOC Chapter-1-for reference
TOC Chapter-1-for reference
COMPUTATION
Subject Code: 3160704
Nidhi S. Periwal
CKPCET, Surat
Chapter-1
Review of Mathematical Theory:
● Inverse Functions
○ An inverse function or an anti function is defined as a function, which can reverse
into another function. In simple words, if any function “f” takes x to y then, the
inverse of “f” will take y to x. If the function is denoted by ‘f’ or ‘F’, then the inverse
function is denoted by f-1 or F-1.
○ If f and g are inverse functions, then f(x) = y if and only if g(y) = x
○ In trigonometry, the inverse sine function is used to find the measure of angle for
which sine function generated the value. For example, sin-1(1) = sin-1(sin 90) = 90
degrees. Hence, sin 90 degrees is equal to 1.
FUNCTIONS AND RELATIONS-summary
● A function f : A → B is one-to-one if f never assigns the same value to two different elements
of its domain.
● It is onto if its range is the entire set B.
● A function from A to B that is both one-to-one and onto is called a bijection from A to B.
● If f and g are inverse functions, then f(x) = y if and only if g(y) = x
Relation
● A predicate or property is a function whose range is {TRUE , FALSE }.
● For example,
○ Let Even be a property that is TRUE if its input is an even number and FALSE if its input is an
odd number.
○ Thus even(4) = TRUE and even(5) = FALSE .
● A property whose domain is a set of k-tuples A × · · · × A is called a relation, a
k-ary relation, or a k-ary relation on A.
● A common case is a 2-ary relation called a binary relation.
● A special type of binary relation, called an equivalence relation, captures the
notion of two objects being equal in some feature.
LOGIC
● Logic involves propositions, which have truth values, either the value true or
the value false.
● The propositions “0 = 1” and “peanut butter is a source of protein” have truth
values false and true, respectively.
● When a simple proposition, which has no variables and is not constructed
from other simpler propositions, is used in a logical argument, its truth
value is the only information that is relevant.
● A proposition involving a variable may be true or false, depending on
the value of the variable. If the domain, or set of possible values, is
taken to be N , the set of nonnegative integers, the proposition “x − 1 is
prime” is true for the value x = 8 and false when x = 10.
● Implication : p -> q , p implies q
LOGIC
LOGIC
● Truth table
LOGIC
● A tautology is a compound proposition that is true for every possible
combination of truth values of its constituent propositions—in other words,
true in every case.
● A contradiction is the opposite, a proposition that is false in every case.
● The proposition p ∨ ¬p is a tautology, and p ∧ ¬p is a contradiction.
● p ↔ q is true precisely when p and q have the same truth values
● P ⇔ Q to mean that the compound propositions P and Q are logically
equivalent. A related idea is logical implication.
● We write P ⇒ Q to mean that in every case where P is true, Q is also true,
and we describe this situation by saying that P logically implies Q.
Proof
● A proof is a convincing logical argument that a statement is true.
● A theorem is a mathematical statement proved true.
● We prove statements that are interesting only because they assist in the proof
of another, more significant statement. Such statements are called lemmas.
● Lemmas: Generally minor, proven proposition which is used as a stepping
stone to a larger result.
● A typical step in a proof is to derive a statement from initial assumptions and
hypotheses, or from statements that have been derived previously, or from
other generally accepted facts, using principles of logical reasoning.
Proof
● proof by Example
● proof by contrapositive
● proof by contradiction.
Proof
If statement p implies q, then its contrapositive is ∼q implies ∼p, and its converse is q implies p.
Proof by Contradiction
Mathematical Induction
● Mathematical Induction is a technique of proving a statement, theorem or
formula which is thought to be true, for each and every natural number n.
● It is a concept in mathematics that is used to prove various mathematical
statements and theorems.
● The principle of mathematical induction is sometimes referred to as PMI.
● It is a technique that is used to prove the basic theorems in mathematics which
involve the solution up to n finite natural terms.
● The technique involves two steps to prove a statement, as stated below −
○ Step 1(Base step) − It proves that a statement is true for the initial value.
○ Step 2(Inductive step) − It proves that if the statement is true for the nth iteration (or number n), then it
is also true for (n+1)th iteration ( or number n+1).
○ Step 1 − Consider an initial value for which the statement is true. It is to be shown that the statement is true for n = initial value.
○ Step 2 − Assume the statement is true for any value of n = k. Then prove the statement is true for n = k+1. We actually break n =
k+1 into two parts, one part is n = k (which is already proved) and try to prove the other part.
Mathematical Induction
Let P(n): n3 + 2n is divisible by 3 be the given statement.
Then, k3 + 2k is divisible by 3
= (k + 1)3 + 2(k + 1)
= k3 + 3k2 + 5k + 3
= (k3 + 2 k) + (3k2 + 3k + 3)
from eq(i)
= 3n + 3(k2 + k + 1)
= 3(n + k2 + k + 1)
Thus, P(k+1) is true i.e. (k + 1)3 + 2(k + 1) is be divisible by 3. Now by the Principle of Mathematical
Induction, we can say that, P(n): n3 + 2n is divisible by 3 is true.
● Strong induction is a variant of induction, in which we assume that the
statement holds for all values preceding k. This provides us with more
information to use when trying to prove the statement.
LANGUAGES
● A language to be any set of strings over an alphabet of symbols.
● Many of the languages we study initially will be much simpler. They might
involve alphabets with just one or two symbols, and perhaps just one or two
basic patterns to which all the strings must conform.
LANGUAGES
Operations
● The basic operation on strings is concatenation. If x and y are two strings
over an alphabet, the concatenation of x and y is written xy and consists of
the symbols of x followed by those of y. If x = ab and y = bab, for example,
then xy = abbab and yx = babab.
● When we concatenate the null string with another string, the result is
just the other string.
● (for every string x, xΛ = Λx = x);
● In general, for two strings x and y, |xy| = |x| + |y|.
● Concatenation is an associative operation; that is, (xy)z = x(yz), for all
possible strings x, y, and z. This allows us to write xyz without specifying how
the factors are grouped
Operations
● If s is a string and s = tuv for three strings t, u, and v,
○ then
○ t is a prefix of s,
○ v is a suffix of s,
○ and u is a substring of s.
○ Because one or both of t and u might be , prefixes and suffixes are special cases of
substrings.
○ The string Λ is a prefix of every string, a suffix of every string, and a substring of every string,
and every string is a prefix, a suffix, and a substring of itself.
Union:
* (Kleene closure)
L+: It is a Positive Closure that represents a set of all strings except Null or ε-strings.
L*: It is “Kleene Closure“, that represents the occurrence of certain alphabets for given language alphabets from zero to the infinite
number of times.