Comprehesive knowledge on computing and information technology
Amazing
Recursive Definitions
The set EVEN is defined recursively as follows:
The last rule is called an EXCLUSION RULE (it prevents members from sneaking into a set by unknown means, and it is tacitly presumed in recursive definitions.)
How else can the set EVEN be defined recursively?
Supposing you want to prove that the sum of any two numbers in EVEN is also in EVEN, which definition would best serve your purpose?
Supposing you want to prove that the product of any two numbers in EVEN is also in EVEN, which definition would best serve your purpose?
A recursive definition is better than another if it produces shorter proofs for set membership.
Set EVEN has fine definitions that are non recursive later in the course, we shall be interested in certain sets that have no better definition than the recursive one
The choice of whether or not to use a recursive definition depends on:
Following is a recursive definition of the positive integers:
How would you define INTEGERS to include both positive and negative integers?
Definition of the set POLYNOMIAL :
Use the definition of POLYNOMIAL to prove that is in 3x - 2 is in POLYNOMIAL
Use the definition of POLYNOMIAL to prove that 4x + 2x -6 is in POLYNOMIAL
Suppose in a calculus class we prove that:
Using the recursive definition of POLYNOMIAL and these proofs it is now a trivial exercise to show that all POLYNOMIALS can be differentiated, how?
We don’t yet know the most efficient alg orithm for doing this but we know that it can be done.
Perhaps even more importantly recursive definitions can be used to show that certain tasks are theoretically impossible for any computer to perform…
But that is beyond the scope of this course…
Rule 1: The children of MOI are all elements of the set DESCENDANTS
Rule 2: if x is an element of DESCENDANTS then so are x’s children.
Definition of set FACTORIAL:
Rule 1: 0! = 1
Rule 2: n! = n (n – 1)!
L1=x += {x xx xxx xxxx ...}
L odd= X 2n-1 for n > 0 ={x xxx xxxxx ...}
L4= X * = {˄ xx xxxx xxxxx ...}
Kleene Closure e.g. S*
What constitutes a valid arithmetic expression (AE) that can be typed on one line, in a computer-digestible form?
What is the alphabet?
Are the following strings in language AE?
What rules govern formation of correct AE strings?
Recursive definition of AE most natural way rather than a list of forbidden substrings, parentheses requirements and rules!
Rule 1: Any number (positive, negative or zero) is in AE
Rule 2: If x is in AE then so are (x) and –(x)
Rule 3: If x and y are in AE then so are x + y, x –y, x * y, x / y, x ** y
Is the arithmetic expression (4 +25 / (10 ** 2) / 5 in AE?
Is the arithmetic expression (2 + 5) * (6 * (9 –2)/5)/4 * (2 + 9) – 1 in AE?
How does the recursive definition allow us to simply carry out such proofs?
THEOREM 2: No arithmetic expression can contain the character $
THEOREM 3: No arithmetic expression can begin or end with the symbol /
Definition of the set WFF (well-formed formulae):
Σ = → ¬ ( ) a b c d ...
Rule 1: Any single Latin letter is a WFF e.g. a b c d
Rule 2: If p is a WFF, then so are (p) and ¬p
Rule 3: If p and q are WFFs then so is p → q
Are the following in WFF?
Start your journey to mastering the art of logic and arithmetic expressions today!
Oh, and the best bit...It's free!