Recursive Functions. 6.1 Primitive Recursive Functions

Size: px
Start display at page:

Download "Recursive Functions. 6.1 Primitive Recursive Functions"

Transcription

1 6 Recursive Functions The intuitive notion of an effectively computable function is the notion of a function for which there are definite, explicit rules, following which one could in principle compute its value for any given arguments. This chapter studies an extensive class of effectively computable functions, the recursively computable, or simply recursive, functions. According to Church s thesis, these are in fact all the effectively computable functions. Evidence for Church s thesis will be developed in this chapter by accumulating examples of effectively computable functions that turn out to be recursive. The subclass of primitive recursive functions is introduced in section 6.1, and the full class of recursive functions in section 6.2. The next chapter contains further examples. The discussion of recursive computability in this chapter and the next is entirely independent of the discussion of Turing and abacus computability in the preceding three chapters, but in the chapter after next the three notions of computability will be proved equivalent to each other. 6.1 Primitive Recursive Functions Intuitively, the notion of an effectively computable function f from natural numbers to natural numbers is the notion of a function for which there is a finite list of instructions that in principle make it possible to determine the value f (x 1,..., x n ) for any arguments x 1,..., x n. The instructions must be so definite and explicit that they require no external sources of information and no ingenuity to execute. But the determination of the value given the arguments need only be possible in principle, disregarding practical considerations of time, expense, and the like: the notion of effective computability is an idealized one. For purposes of computation, the natural numbers that are the arguments and values of the function must be presented in some system of numerals or other, though the class of functions that is effectively computable will not be affected by the choice of system of numerals. (This is because conversion from one system of numerals to another is itself an effective process that can be carried out according to definite, explicit rules.) Of course, in practice some systems of numerals are easier to work with than others, but that is irrelevant to the idealized notion of effective computability. For present purposes we adopt a variant of the primeval monadic or tally notation, in which a positive integer n is represented by n strokes. The variation is needed because we want to consider not just positive integers (excluding zero) but the natural numbers 63

2 64 RECURSIVE FUNCTIONS (including zero). We adopt the system in which the number zero is represented by the cipher 0, and a natural number n > 0 is represented by the cipher 0 followed by a sequence of n little raised strokes or accents. Thus the numeral for one is 0, the numeral for two is 0, and so on. Two functions that are extremely easy to compute in this notation are the zero function, whose value z(x) is the same, namely zero, for any argument x, and the successor function s(x), whose value for any number x is the next larger number. In our special notation we write: z(0) = 0 z(0 ) = 0 z(0 ) = 0 s(0) = 0 s(0 ) = 0 s(0 ) = 0 To compute the zero function, given any any argument, we simply ignore the argument and write down the symbol 0. To compute the successor function in our special notation, given a number written in that notation, we just add one more accent at the right. Some other functions it is easy to compute (in any notation) are the identity functions. We have earlier encountered also the identity function of one argument, id or more fully id 1 1, which assigns to each natural number as argument that same number as value: id 1 1 (x) = x. There are two identity functions of two arguments: id 2 1 and id2 2. For any pair of natural numbers as arguments, these pick out the first and second, respectively, as values: id 2 1 (x, y) = x id2 2 (x, y) = y. In general, for each positive integer n, there are n identity functions of n arguments, which pick out the first, second,..., and nth of the arguments: id n i (x 1,...,x i,...,x n ) = x i. Identity functions are also called projection functions. [In terms of analytic geometry, id 2 1 (x, y) and id2 2 (x, y) are the projections x and y of the point (x, y) to the X-axis and to the Y-axis respectively.] The foregoing functions zero, successor, and the various identity functions are together called the basic functions. They can be, so to speak, computed in one step, at least on one way of counting steps. The stock of effectively computable functions can be enlarged by applying certain processes for defining new functions from old. A first sort of operation, composition, is familiar and straightforward. If f is a function of m arguments and each of g 1,..., g m is a function of n arguments, then the function obtained by composition from f, g 1,..., g m is the function h where we have h(x 1,...,x n ) = f (g 1 (x 1,...,x n ),...,g m (x 1,...,x n )) (Cn)

3 One might indicate this in shorthand: 6.1. PRIMITIVE RECURSIVE FUNCTIONS 65 h = Cn[ f, g 1,...,g m ]. Composition is also called substitution. Clearly, if the functions g i are all effectively computable and the function f is effectively computable, then so is the function h. The number of steps needed to compute h(x 1,...,x n ) will be the sum of the number of steps needed to compute y 1 = g 1 (x 1,...,x n ), the number needed to compute y 2 = g 2 (x 1,...,x n ), and so on, plus at the end the number of steps needed to compute f (y 1,...,y m ). 6.1 Example (Constant functions). For any natural number n, let the constant function const n be defined by const n (x) = n for all x. Then for each n, const n can be obtained from the basic functions by finitely many applications of composition. For, const 0 is just the zero function z, and Cn[s, z] is the function h with h(x) = s(z(x)) = s(0) = 0 = 1 = const 1 (x) for all x, so const 1 = Cn[s, z]. (Actually, such notations as Cn[s, z] are genuine function symbols, belonging to the same grammatical category as h, and we could have simply written Cn[s, z](x) = s(z(x)) here rather than the more longwinded if h = Cn[s, z], then h(x) = z(x).) Similarly const 2 = Cn[s, const 1 ], and generally const n+1 = Cn[s, const n ]. The examples of effectively computable functions we have had so far are admittedly not very exciting. More interesting examples are obtainable using a different process for defining new functions from old, a process that can be used to define addition in terms of successor, multiplication in terms of addition, exponentiation in terms of multiplication, and so on. By way of introduction, consider addition. The rules for computing this function in our special notation can be stated very concisely in two equations as follows: x + 0 = x x + y = (x + y). To see how these equations enable us to compute sums consider adding 2 = 0 and 3 = 0. The equations tell us: = (0 + 0 ) by 2nd equation with x = 0 and y = = (0 + 0 ) by 2nd equation with x = 0 and y = = (0 + 0) by 2nd equation with x = 0 and y = = 0 by 1st equation with x = 0. Combining, we have the following: = (0 + 0 ) = (0 + 0 ) = (0 + 0) = 0. So the sum is 0 = 5. Thus we use the second equation to reduce the problem of computing x + y to that of computing x + z for smaller and smaller z, until we arrive at z = 0, when the first equation tells us directly how to compute x + 0.

4 66 RECURSIVE FUNCTIONS Similarly, for multiplication we have the rules or equations x 0 = 0 x y = x + (x y) which enable us to reduce the computation of a product to the computation of sums, which we know how to compute: 0 0 = 0 + (0 0 ) = 0 + (0 + (0 0 )) = 0 + (0 + (0 + (0 0))) = 0 + (0 + (0 + 0)) = 0 + (0 + 0 ) after which we would carry out the computation of the sum in the last line in the way indicated above, and obtain 0. Now addition and multiplication are just the first two of a series of arithmetic operations, all of which are effectively computable. The next item in the series is exponentiation. Just as multiplication is repeated addition, so exponentiation is repeated multiplication. To compute x y, that is, to raise x to the power y, multiply together yxs as follows: x x x x (a row of yxs). Conventionally, a product of no factors is taken to be 1, so we have the equation For higher powers we have x 0 = 0. x 1 = x x 2 = x x. x y = x x x x y+1 = x x x x = x x y So we have the equation (a row of yxs) (a row of y + 1 xs). x y = x x y. Again we have two equations, and these enable us to reduce the computation of a power to the computation of products, which we know how to do. Evidently the next item in the series, super-exponentiation, would be defined as follows: x x xx... (a stack of yxs). The alternative notation x y may be used for exponentiation to avoid piling up of superscripts. In this notation the definition would be written as follows: x x x... x (a row of yxs).

5 6.1. PRIMITIVE RECURSIVE FUNCTIONS 67 Actually, we need to indicate the grouping here. It is to the right, like this: and not to the left, like this: x (x (x... x...)) (...((x x) x)...) x. For it makes a difference: 3 (3 3) = 3 (27) = ; while (3 3) 3 = 27 3 = Writing x y for the super-exponential, the equations would be x 0 = 0 x y = x (x y). The next item in the series, super-duper-exponentiation, is analogously defined, and so on. The process for defining new functions from old at work in these cases is called (primitive) recursion. As our official format for this process we take the following: h(x, 0) = f (x), h(x, y ) = g(x, y, h(x, y)) (Pr). Where the boxed equations called the recursion equations for the function h hold, h is said to be definable by (primitive) recursion from the functions f and g. In shorthand, h = Pr[ f, g]. Functions obtainable from the basic functions by composition and recursion are called primitive recursive. All such functions are effectively computable. For if f and g are effectively computable functions, then h is an effectively computable function. The number of steps needed to compute h(x, y) will be the sum of the number of steps needed to compute z 0 = f (x) = h(x, 0), the number needed to compute z 1 = g(x, 0, z 0 ) = h(x, 1), the number needed to compute z 2 = g(x, 1, z 1 ) = h(x, 2), and so on up to z y = g(x, y 1, z y 1 ) = h(x, y). The definitions of sum, product, and power we gave above are approximately in our official boxed format. [The main difference is that the boxed format allows one, in computing h(x, y ), to apply a function taking x, y, and h(x, y) as arguments. In the examples of sum, product, and power, we never needed to use y as an argument.] By fussing over the definitions we gave above, we can put them exactly into the format (Pr), thus showing addition and multiplication to be primitive recursive. 6.2 Example (The addition or sum function). We start with the definition given by the equations we had above, x + 0 = x x + y = (x + y). As a step toward reducing this to the boxed format (Pr) for recursion, we replace the ordinary plus sign, written between the arguments, by a sign written out front: sum(x, 0) = x sum(x, y ) = sum(x, y).

6 68 RECURSIVE FUNCTIONS To put these equations in the boxed format (Pr), we must find functions f and g for which we have f (x) = x g(x, y, ) = s( ) for all natural numbers x, y, and. Such functions lie ready to hand: f = id 1 1, g = Cn [s, id 3 3 ]. In the boxed format we have sum(x, 0) = id 1 1 (x) sum(x, s(y)) = Cn[ s, id 3 3] (x, y, sum(x, y)) and in shorthand we have sum = Pr [ id 1 1, Cn[ s, id 3 3]]. 6.3 Example (The multiplication or product function). We claim prod = Pr[z, Cn[sum, id 3 1, id3 3 ]]. To verify this claim we relate it to the boxed formats (Cn) and (Pr). In terms of (Pr) the claim is that the equations prod(x, 0) = z(x) prod(x, s(y)) = g(x, y, prod(x, y)) hold for all natural numbers x and y, where [setting h = g, f = sum, g 1 = id 3 1, g 2 = id 3 3 in the boxed (Cn) format] we have g(x 1, x 2, x 3 ) = Cn [ sum, id 3 1, id3 3] (x1, x 2, x 3 ) = sum ( id 3 1 (x 1, x 2, x 3 ), id 3 3 (x 1, x 2, x 3 ) ) = x 1 + x 3 for all natural numbers x 1, x 2, x 3. Overall, then, the claim is that the equations prod(x, 0) = z(x) prod(x, s(y)) = x + prod(x, y) hold for all natural numbers x and y, which is true: x 0 = 0 x y = x + x y. Our rigid format for recursion serves for functions of two arguments such as sum and product, but we are sometimes going to wish to use such a scheme to define functions of a single argument, and functions of more than two arguments. Where there are three or more arguments x 1,..., x n, y instead of just the two x, y that appear in (Pr), the modification is achieved by viewing each of the five occurrences of x in the boxed format as shorthand for x 1,..., x n. Thus with n = 2 the format is h(x 1, x 2, 0) = f (x 1, x 2 ) h(x 1, x 2, s(y)) = g(x 1, x 2, y, h(x 1, x 2, y)). 6.4 Example (The factorial function). The factorial x! for positive x is the product x of all the positive integers up to and including x, and by convention 0! = 1. Thus we have 0! = 1 y! = y! y.

7 6.1. PRIMITIVE RECURSIVE FUNCTIONS 69 To show this function is recursive we would seem to need a version of the format for recursion with n = 0. Actually, however, we can simply define a two-argument function with a dummy argument, and then get rid of the dummy argument afterwards by composing with an identity function. For example, in the case of the factorial function we can define dummyfac(x, 0) = const 1 (x) dummyfac(x, y ) = dummyfac(x, y) y so that dummyfac(x, y) = y! regardless of the value of x, and then define fac(y) = dummyfac (y, y). More formally, fac = Cn [ Pr [ const 1, Cn [ prod, id 3 3, Cn[ s, id 3 2]]], id, id ]. (We leave to the reader the verification of this fact, as well as the conversions of informalstyle definitions into formal-style definitions in subsequent examples.) The example of the factorial function can be generalized. 6.5 Proposition. Let f be a primitive recursive function. Then the functions are primitive recursive. g(x, y) = f (x, 0) + f (x, 1) + + f (x, y) = h(x, y) = f (x, 0) f (x, 1) f (x, y) = Proof: We have for the g the recursion equations and similarly for h. g(x, 0) = f (x, 0) g(x, y ) = g(x, y) + f (x, y ) y f (x, i) i=0 y f (x, i) Readers may wish, in the further examples to follow, to try to find definitions of their own before reading ours; and for this reason we give the description of the functions first, and our definitions of them (in informal style) afterwards. 6.6 Example. The exponential or power function. 6.7 Example (The (modified) predecessor function). Define pred (x) to be the predecessor x 1 of x for x > 0, and let pred(0) = 0 by convention. Then the function pred is primitive recursive. 6.8 Example (The (modified) difference function). Define x. y to be the difference x y if x y, and let x. y = 0 by convention otherwise. Then the function. is primitive recursive. 6.9 Example (The signum functions). Define sg(0) = 0, and sg(x) = 1 if x > 0, and define sg(0) = 1 and sg(x) = 0 if x > 0. Then sg and sg are primitive recursive. i=0

8 70 RECURSIVE FUNCTIONS Proofs Example 6.6. x 0 = 1, x s(y) = x (x y), or more formally, exp = Pr [ Cn[s, z], Cn [ prod, id 3 1, id3 3]]. Example 6.7. pred(0) = 0, pred(y ) = y. Example 6.8. x. 0 = x, x. y = pred(x. y). Example 6.9. sg(y) = 1. (1. y), sg(y) = 1. y. 6.2 Minimization We now introduce one further process for defining new functions from old, which can take us beyond primitive recursive functions, and indeed can take us beyond total functions to partial functions. Intuitively, we consider a partial function f to be effectively computable if a list of definite, explicit instructions can be given, following which one will, in the case they are applied to any x in the domain of f, arrive after a finite number of steps at the value f (x), but following which one will, in the case they are applied to any x not in the domain of f, go on forever without arriving at any result. This notion applies also to two- and many-place functions. Now the new process we want to consider is this. Given a function f of n + 1 arguments, the operation of minimization yields a total or partial function h of n arguments as follows: y if f (x 1,...,x n, y) = 0, and for all t < y Mn[ f ](x 1,...,x n ) = f (x 1,...,x n, t) is defined and 0 undefined if there is no such y. If h = Mn[ f ] and f is an effectively computable total or partial function, then h also will be such a function. For writing x for x 1,..., x n, we compute h(x) by successively computing f (x, 0), f (x, 1), f (x, 2), and so on, stopping if and when we reach a y with f (x, y) = 0. If x is in the domain of h, there will be such a y, and the number of steps needed to compute h(x) will be the sum of the number of steps needed to compute f (x, 0), the number of steps needed to compute f (x, 1), and so on, up through the number of steps needed to compute f (x, y) = 0. If x is not in the domain of h, this may be for either of two reasons. On the one hand, it may be that all of f (x, 0), f (x, 1), f (x, 2),...are defined, but they are all nonzero. On the other hand, it may be that for some i, all of f (x, 0), f (x, 1),..., f (x, i 1) are defined and nonzero, but f (x, i) is undefined. In either case, the attempt to compute h(x) will involve one in a process that goes on forever without producing a result. In case f is a total function, we do not have to worry about the second of the two ways in which Mn[ f ] may fail to be defined, and the above definition boils down to the following simpler form. the smallest y for which Mn[ f ](x 1,...,x n ) = f (x 1,...,x n, y) = 0 if such a y exists undefined otherwise.

9 PROBLEMS 71 The total function f is called regular if for every x 1,..., x n there is a y such that f (x 1,..., x n, y) = 0. In case f is a regular function, Mn[ f ] will be a total function. In fact, if f is a total function, Mn[ f ] will be total if and only if f is regular. For example, the product function is regular, since for every x, x 0 = 0; and Mn[prod] is simply the zero function. But the sum function is not regular, since x + y = 0 only in case x = y = 0; and Mn[sum] is the function that is defined only for 0, for which it takes the value 0, and undefined for all x > 0. The functions that can be obtained from the basic functions z, s, id n i by the processes Cn, Pr, and Mn are called the recursive (total or partial) functions. (In the literature, recursive function is often used to mean more specifically recursive total function, and partial recursive function is then used to mean recursive total or partial function.) As we have observed along the way, recursive functions are all effectively computable. The hypothesis that, conversely, all effectively computable total functions are recursive is known as Church s thesis (the hypothesis that all effectively computable partial functions are recursive being known as the extended version of Church s thesis). The interest of Church s thesis derives largely from the following fact. Later chapters will show that some particular functions of great interest in logic and mathematics are nonrecursive. In order to infer from such a theoretical result the conclusion that such functions are not effectively computable (from which may be inferred the practical advice that logicians and mathematicians would be wasting their time looking for a set of instructions to compute the function), we need assurance that Church s thesis is correct. At present Church s thesis is, for us, simply an hypothesis. It has been made somewhat plausible to the extent that we have shown a significant number of effectively computable functions to be recursive, but one can hardly on the basis of just these few examples be assured of its correctness. More evidence of the correctness of the thesis will accumulate as we consider more examples in the next two chapters. Before turning to examples, it may be well to mention that the thesis that every effectively computable total function is primitive recursive would simply be erroneous. Examples of recursive total functions that are not primitive recursive are described in the next chapter. Problems 6.1 Let f be a two-place recursive total function. Show that the following functions are also recursive: (a) g(x, y) = f (y, x) (b) h(x) = f (x, x) (c) k 17 (x) = f (17, x) and k 17 (x) = f (x, 17). 6.2 Let J 0 (a, b) be the function coding pairs of positive integers by positive integers that was called J in Example 1.2, and from now on use the name J for the corresponding function coding pairs of natural numbers by natural numbers, so that J(a, b) = J 0 (a + 1, b + 1) 1. Show that J is primitive recursive.

10 72 RECURSIVE FUNCTIONS 6.3 Show that the following functions are primitive recursive: (a) the absolute difference x y, defined to be x y if y < x, and y x otherwise. (b) the order characteristic, χ (x, y), defined to be 1 if x y, and 0 otherwise. (c) the maximum max(x, y), defined to be the larger of x and y. 6.4 Show that the following functions are primitive recursive: (a) c(x, y, z) = 1 if yz = x, and 0 otherwise. (b) d(x, y, z) = 1 if J(y, z) = x, and 0 otherwise. 6.5 Define K (n) and L(n) as the first and second entries of the pair coded (under the coding J of the preceding problems) by the number n, so that J(K (n), L(n)) = n. Show that the functions K and L are primitive recursive. 6.6 An alternative coding of pairs of numbers by numbers was considered in Example 1.2, based on the fact that every natural number n can be written in one and only one way as 1 less than a power of 2 times an odd number, n = 2 k(n) (2l(n). 1). 1. Show that the functions k and l are primitive recursive. 6.7 Devise some reasonable way of assigning code numbers to recursive functions. 6.8 Given a reasonable way of coding recursive functions by natural numbers, let d(x) = 1 if the one-place recursive function with code number x is defined and has value 0 for argument x, and d(x) = 0 otherwise. Show that this function is not recursive. 6.9 Let h(x, y) = 1 if the one-place recursive function with code number x is defined for argument y, and h(x, y) = 0 otherwise. Show that this function is not recursive.

Phil 320 Chapter 7: Recursive sets and relations Note: 0. Introduction Significance of and main objectives for chapter 7:

Phil 320 Chapter 7: Recursive sets and relations Note: 0. Introduction Significance of and main objectives for chapter 7: Phil 320 Chapter 7: Recursive sets and relations (Note: We cover only section 7.1.) 0. Introduction Significance of and main objectives for chapter 7: 1. Chapter 7 generalizes the notion of recursive (or

More information

COMPUTABILITY THEORY AND RECURSIVELY ENUMERABLE SETS

COMPUTABILITY THEORY AND RECURSIVELY ENUMERABLE SETS COMPUTABILITY THEORY AND RECURSIVELY ENUMERABLE SETS JOSHUA LENERS Abstract. An algorithm is function from ω to ω defined by a finite set of instructions to transform a given input x to the desired output

More information

Equations and Functions, Variables and Expressions

Equations and Functions, Variables and Expressions Equations and Functions, Variables and Expressions Equations and functions are ubiquitous components of mathematical language. Success in mathematics beyond basic arithmetic depends on having a solid working

More information

6.001 Notes: Section 4.1

6.001 Notes: Section 4.1 6.001 Notes: Section 4.1 Slide 4.1.1 In this lecture, we are going to take a careful look at the kinds of procedures we can build. We will first go back to look very carefully at the substitution model,

More information

Recursive Functions. Recursive functions are built up from basic functions by some operations.

Recursive Functions. Recursive functions are built up from basic functions by some operations. Recursive Functions Recursive functions are built up from basic functions by some operations. The Successor Function Let s get very primitive. Suppose we have 0 defined, and want to build the nonnegative

More information

EXTREME POINTS AND AFFINE EQUIVALENCE

EXTREME POINTS AND AFFINE EQUIVALENCE EXTREME POINTS AND AFFINE EQUIVALENCE The purpose of this note is to use the notions of extreme points and affine transformations which are studied in the file affine-convex.pdf to prove that certain standard

More information

Semantics via Syntax. f (4) = if define f (x) =2 x + 55.

Semantics via Syntax. f (4) = if define f (x) =2 x + 55. 1 Semantics via Syntax The specification of a programming language starts with its syntax. As every programmer knows, the syntax of a language comes in the shape of a variant of a BNF (Backus-Naur Form)

More information

THREE LECTURES ON BASIC TOPOLOGY. 1. Basic notions.

THREE LECTURES ON BASIC TOPOLOGY. 1. Basic notions. THREE LECTURES ON BASIC TOPOLOGY PHILIP FOTH 1. Basic notions. Let X be a set. To make a topological space out of X, one must specify a collection T of subsets of X, which are said to be open subsets of

More information

(a) Give inductive definitions of the relations M N and M N of single-step and many-step β-reduction between λ-terms M and N. (You may assume the

(a) Give inductive definitions of the relations M N and M N of single-step and many-step β-reduction between λ-terms M and N. (You may assume the COMPUTER SCIENCE TRIPOS Part IB 205 Paper 6 4 (AMP) (a) Give inductive definitions of the relations M N and M N of single-step and many-step β-reduction between λ-terms M and N. (You may assume the definition

More information

Reducibilities relations with applications to symbolic dynamics

Reducibilities relations with applications to symbolic dynamics Reducibilities relations with applications to symbolic dynamics Part I: Computability E. Jeandel LORIA (Nancy, France) E. Jeandel, CASD, Part I: Computability 1/1 Introduction What is computability? Why

More information

Introduction to Homotopy Type Theory

Introduction to Homotopy Type Theory Introduction to Homotopy Type Theory Lecture notes for a course at EWSCS 2017 Thorsten Altenkirch March 5, 2017 1 What is this course about? To explain what Homotopy Type Theory is, I will first talk about

More information

Generating Functions

Generating Functions 6.04/8.06J Mathematics for Computer Science Srini Devadas and Eric Lehman April 7, 005 Lecture Notes Generating Functions Generating functions are one of the most surprising, useful, and clever inventions

More information

SECTION 5.1. Sequences

SECTION 5.1. Sequences SECTION 5.1 Sequences Sequences Problem: count number of ancestors one has 2 parents, 4 grandparents, 8 greatgrandparents,, written in a row as 2, 4, 8, 16, 32, 64, 128, To look for pattern of the numbers,

More information

Introduction. chapter Functions

Introduction. chapter Functions chapter 1 Introduction In this chapter we set the stage for the rest of the book. We start by reviewing the notion of a function, then introduce the concept of functional programming, summarise the main

More information

Divisibility Rules and Their Explanations

Divisibility Rules and Their Explanations Divisibility Rules and Their Explanations Increase Your Number Sense These divisibility rules apply to determining the divisibility of a positive integer (1, 2, 3, ) by another positive integer or 0 (although

More information

A catalogue of proofs that various sets, functions and relations are primitive recursive 26 February 2012 at 20:57

A catalogue of proofs that various sets, functions and relations are primitive recursive 26 February 2012 at 20:57 A catalogue of proofs that various sets, functions and relations are primitive recursive 26 February 2012 at 20:57 Public In this note (which is mainly intended as a 'memo' for myself) I am interested

More information

Section 13.2 The Church-Turing Thesis The Church-Turing Thesis: Anything that is intuitively computable can be be computed by a Turing machine.

Section 13.2 The Church-Turing Thesis The Church-Turing Thesis: Anything that is intuitively computable can be be computed by a Turing machine. Section 13.2 The Church-Turing Thesis The Church-Turing Thesis: Anything that is intuitively computable can be be computed by a Turing machine. It is a thesis rather than a theorem because it relates the

More information

Math 171 Proficiency Packet on Integers

Math 171 Proficiency Packet on Integers Math 171 Proficiency Packet on Integers Section 1: Integers For many of man's purposes the set of whole numbers W = { 0, 1, 2, } is inadequate. It became necessary to invent negative numbers and extend

More information

Calculus I Review Handout 1.3 Introduction to Calculus - Limits. by Kevin M. Chevalier

Calculus I Review Handout 1.3 Introduction to Calculus - Limits. by Kevin M. Chevalier Calculus I Review Handout 1.3 Introduction to Calculus - Limits by Kevin M. Chevalier We are now going to dive into Calculus I as we take a look at the it process. While precalculus covered more static

More information

Recursive Function Theory

Recursive Function Theory The Initial Functions The Building Operations Composition Primitive Recursion Minimization Summary Recursive Function Theory Peter Suber, Philosophy Department, Earlham College Recursive function theory,

More information

CIS 500 Software Foundations Fall September 25

CIS 500 Software Foundations Fall September 25 CIS 500 Software Foundations Fall 2006 September 25 The Lambda Calculus The lambda-calculus If our previous language of arithmetic expressions was the simplest nontrivial programming language, then the

More information

14.1 Encoding for different models of computation

14.1 Encoding for different models of computation Lecture 14 Decidable languages In the previous lecture we discussed some examples of encoding schemes, through which various objects can be represented by strings over a given alphabet. We will begin this

More information

1 Scope, Bound and Free Occurrences, Closed Terms

1 Scope, Bound and Free Occurrences, Closed Terms CS 6110 S18 Lecture 2 The λ-calculus Last time we introduced the λ-calculus, a mathematical system for studying the interaction of functional abstraction and functional application. We discussed the syntax

More information

9. Elementary Algebraic and Transcendental Scalar Functions

9. Elementary Algebraic and Transcendental Scalar Functions Scalar Functions Summary. Introduction 2. Constants 2a. Numeric Constants 2b. Character Constants 2c. Symbol Constants 2d. Nested Constants 3. Scalar Functions 4. Arithmetic Scalar Functions 5. Operators

More information

CHAPTER 4. COMPUTABILITY AND DECIDABILITY

CHAPTER 4. COMPUTABILITY AND DECIDABILITY CHAPTER 4. COMPUTABILITY AND DECIDABILITY 1. Introduction By definition, an n-ary function F on N assigns to every n-tuple k 1,...,k n of elements of N a unique l N which is the value of F at k 1,...,k

More information

Lagrange Multipliers. Lagrange Multipliers. Lagrange Multipliers. Lagrange Multipliers. Lagrange Multipliers. Lagrange Multipliers

Lagrange Multipliers. Lagrange Multipliers. Lagrange Multipliers. Lagrange Multipliers. Lagrange Multipliers. Lagrange Multipliers In this section we present Lagrange s method for maximizing or minimizing a general function f(x, y, z) subject to a constraint (or side condition) of the form g(x, y, z) = k. Figure 1 shows this curve

More information

Math 340 Fall 2014, Victor Matveev. Binary system, round-off errors, loss of significance, and double precision accuracy.

Math 340 Fall 2014, Victor Matveev. Binary system, round-off errors, loss of significance, and double precision accuracy. Math 340 Fall 2014, Victor Matveev Binary system, round-off errors, loss of significance, and double precision accuracy. 1. Bits and the binary number system A bit is one digit in a binary representation

More information

Statistics Case Study 2000 M. J. Clancy and M. C. Linn

Statistics Case Study 2000 M. J. Clancy and M. C. Linn Statistics Case Study 2000 M. J. Clancy and M. C. Linn Problem Write and test functions to compute the following statistics for a nonempty list of numeric values: The mean, or average value, is computed

More information

Topic 1: What is HoTT and why?

Topic 1: What is HoTT and why? Topic 1: What is HoTT and why? May 5, 2014 Introduction Homotopy type theory (HoTT) is a newly emerging field of mathematics which is currently being developed as a foundation of mathematics which is in

More information

The eighth scene in a series of articles on elementary mathematics. written by Eugene Maier designed and illustrated by Tyson Smith. equals me.

The eighth scene in a series of articles on elementary mathematics. written by Eugene Maier designed and illustrated by Tyson Smith. equals me. me. multiplied by me. equals me. The eighth scene in a series of articles on elementary mathematics. written by Eugene Maier designed and illustrated by Tyson Smith The array model, with edge pieces used

More information

Bits, Words, and Integers

Bits, Words, and Integers Computer Science 52 Bits, Words, and Integers Spring Semester, 2017 In this document, we look at how bits are organized into meaningful data. In particular, we will see the details of how integers are

More information

The Lambda Calculus. 27 September. Fall Software Foundations CIS 500. The lambda-calculus. Announcements

The Lambda Calculus. 27 September. Fall Software Foundations CIS 500. The lambda-calculus. Announcements CIS 500 Software Foundations Fall 2004 27 September IS 500, 27 September 1 The Lambda Calculus IS 500, 27 September 3 Announcements Homework 1 is graded. Pick it up from Cheryl Hickey (Levine 502). We

More information

Does this program exist? Limits of computability. Does this program exist? A helper function. For example, if the string program is

Does this program exist? Limits of computability. Does this program exist? A helper function. For example, if the string program is Does this program exist? For example, if the string program is Limits of computability public void abc(string s) { if( s == "abc" ) { print "Hello world!"; } else { print "Whatever"; }} then test called

More information

Lecture 5: The Halting Problem. Michael Beeson

Lecture 5: The Halting Problem. Michael Beeson Lecture 5: The Halting Problem Michael Beeson Historical situation in 1930 The diagonal method appears to offer a way to extend just about any definition of computable. It appeared in the 1920s that it

More information

Programming Languages Third Edition

Programming Languages Third Edition Programming Languages Third Edition Chapter 12 Formal Semantics Objectives Become familiar with a sample small language for the purpose of semantic specification Understand operational semantics Understand

More information

ZIG-ZAG INVOLUTES, UP-DOWN PERMUTATIONS, AND SECANT AND TANGENT

ZIG-ZAG INVOLUTES, UP-DOWN PERMUTATIONS, AND SECANT AND TANGENT ZIG-ZAG INVOLUTES, U-DOWN ERMUTATIONS, AND SECANT AND TANGENT B.D.S.MCCONNELL In [2], Leo Gurin presents a delightful construction attributed to Y.S.Chaikovsky that exposes the geometric meaning of every

More information

Formally-Proven Kosaraju s algorithm

Formally-Proven Kosaraju s algorithm Formally-Proven Kosaraju s algorithm Laurent Théry Laurent.Thery@sophia.inria.fr Abstract This notes explains how the Kosaraju s algorithm that computes the strong-connected components of a directed graph

More information

6.001 Notes: Section 6.1

6.001 Notes: Section 6.1 6.001 Notes: Section 6.1 Slide 6.1.1 When we first starting talking about Scheme expressions, you may recall we said that (almost) every Scheme expression had three components, a syntax (legal ways of

More information

Lecture 2: Big-Step Semantics

Lecture 2: Big-Step Semantics Lecture 2: Big-Step Semantics 1 Representing Abstract Syntax These are examples of arithmetic expressions: 2 * 4 1 + 2 + 3 5 * 4 * 2 1 + 2 * 3 We all know how to evaluate these expressions in our heads.

More information

An Interesting Way to Combine Numbers

An Interesting Way to Combine Numbers An Interesting Way to Combine Numbers Joshua Zucker and Tom Davis October 12, 2016 Abstract This exercise can be used for middle school students and older. The original problem seems almost impossibly

More information

Modular Arithmetic. is just the set of remainders we can get when we divide integers by n

Modular Arithmetic. is just the set of remainders we can get when we divide integers by n 20181004 Modular Arithmetic We are accustomed to performing arithmetic on infinite sets of numbers. But sometimes we need to perform arithmetic on a finite set, and we need it to make sense and be consistent

More information

COP4020 Programming Languages. Functional Programming Prof. Robert van Engelen

COP4020 Programming Languages. Functional Programming Prof. Robert van Engelen COP4020 Programming Languages Functional Programming Prof. Robert van Engelen Overview What is functional programming? Historical origins of functional programming Functional programming today Concepts

More information

1 Recursion. 2 Recursive Algorithms. 2.1 Example: The Dictionary Search Problem. CSci 235 Software Design and Analysis II Introduction to Recursion

1 Recursion. 2 Recursive Algorithms. 2.1 Example: The Dictionary Search Problem. CSci 235 Software Design and Analysis II Introduction to Recursion 1 Recursion Recursion is a powerful tool for solving certain kinds of problems. Recursion breaks a problem into smaller problems that are identical to the original, in such a way that solving the smaller

More information

Lecture 1 Contracts. 1 A Mysterious Program : Principles of Imperative Computation (Spring 2018) Frank Pfenning

Lecture 1 Contracts. 1 A Mysterious Program : Principles of Imperative Computation (Spring 2018) Frank Pfenning Lecture 1 Contracts 15-122: Principles of Imperative Computation (Spring 2018) Frank Pfenning In these notes we review contracts, which we use to collectively denote function contracts, loop invariants,

More information

Introduction to the λ-calculus

Introduction to the λ-calculus Announcements Prelim #2 issues: o Problem 5 grading guide out shortly o Problem 3 (hashing) issues Will be on final! Friday RDZ office hours are 11-12 not 1:30-2:30 1 Introduction to the λ-calculus Today

More information

Congruence Arithmetic

Congruence Arithmetic Module 4 Congruence Arithmetic Popper 4 Introduction to what is like Modulus choices Partitions by modulus Mod 5 Mod 7 Mod 30 Modular Arithmetic Addition Subtraction Multiplication INTEGERS! Mod 12 Cayley

More information

Linear and quadratic Taylor polynomials for functions of several variables.

Linear and quadratic Taylor polynomials for functions of several variables. ams/econ 11b supplementary notes ucsc Linear quadratic Taylor polynomials for functions of several variables. c 016, Yonatan Katznelson Finding the extreme (minimum or maximum) values of a function, is

More information

CS152: Programming Languages. Lecture 11 STLC Extensions and Related Topics. Dan Grossman Spring 2011

CS152: Programming Languages. Lecture 11 STLC Extensions and Related Topics. Dan Grossman Spring 2011 CS152: Programming Languages Lecture 11 STLC Extensions and Related Topics Dan Grossman Spring 2011 Review e ::= λx. e x e e c v ::= λx. e c τ ::= int τ τ Γ ::= Γ, x : τ (λx. e) v e[v/x] e 1 e 1 e 1 e

More information

Table : IEEE Single Format ± a a 2 a 3 :::a 8 b b 2 b 3 :::b 23 If exponent bitstring a :::a 8 is Then numerical value represented is ( ) 2 = (

Table : IEEE Single Format ± a a 2 a 3 :::a 8 b b 2 b 3 :::b 23 If exponent bitstring a :::a 8 is Then numerical value represented is ( ) 2 = ( Floating Point Numbers in Java by Michael L. Overton Virtually all modern computers follow the IEEE 2 floating point standard in their representation of floating point numbers. The Java programming language

More information

CS 6110 S14 Lecture 1 Introduction 24 January 2014

CS 6110 S14 Lecture 1 Introduction 24 January 2014 CS 6110 S14 Lecture 1 Introduction 24 January 2014 1 Introduction What is a program? Is it just something that tells the computer what to do? Yes, but there is much more to it than that. The basic expressions

More information

Handout 9: Imperative Programs and State

Handout 9: Imperative Programs and State 06-02552 Princ. of Progr. Languages (and Extended ) The University of Birmingham Spring Semester 2016-17 School of Computer Science c Uday Reddy2016-17 Handout 9: Imperative Programs and State Imperative

More information

Catalan Numbers. Table 1: Balanced Parentheses

Catalan Numbers. Table 1: Balanced Parentheses Catalan Numbers Tom Davis tomrdavis@earthlink.net http://www.geometer.org/mathcircles November, 00 We begin with a set of problems that will be shown to be completely equivalent. The solution to each problem

More information

Information Theory and Coding Prof. S. N. Merchant Department of Electrical Engineering Indian Institute of Technology, Bombay

Information Theory and Coding Prof. S. N. Merchant Department of Electrical Engineering Indian Institute of Technology, Bombay Information Theory and Coding Prof. S. N. Merchant Department of Electrical Engineering Indian Institute of Technology, Bombay Lecture - 11 Coding Strategies and Introduction to Huffman Coding The Fundamental

More information

English for Computer Science

English for Computer Science English for Computer Science Mohammad Farshi Department of Computer Science, Yazd University 1388-1389 (CS Dept. Yazd U.) Yazd Univ. English4CS 1388-1389 1 / 15 Azmoone 1389(CS) Azmoone 1389(CS) (CS Dept.

More information

3.2 Recursions One-term recursion, searching for a first occurrence, two-term recursion. 2 sin.

3.2 Recursions One-term recursion, searching for a first occurrence, two-term recursion. 2 sin. Chapter 3 Sequences 3.1 Summation Nested loops, while-loops with compound termination criteria 3.2 Recursions One-term recursion, searching for a first occurrence, two-term recursion. In Chapter 2 we played

More information

Denotational semantics

Denotational semantics 1 Denotational semantics 2 What we're doing today We're looking at how to reason about the effect of a program by mapping it into mathematical objects Specifically, answering the question which function

More information

Type Systems Winter Semester 2006

Type Systems Winter Semester 2006 Type Systems Winter Semester 2006 Week 4 November 8 November 15, 2006 - version 1.1 The Lambda Calculus The lambda-calculus If our previous language of arithmetic expressions was the simplest nontrivial

More information

Recursion. Tjark Weber. Functional Programming 1. Based on notes by Sven-Olof Nyström. Tjark Weber (UU) Recursion 1 / 37

Recursion. Tjark Weber. Functional Programming 1. Based on notes by Sven-Olof Nyström. Tjark Weber (UU) Recursion 1 / 37 Tjark Weber Functional Programming 1 Based on notes by Sven-Olof Nyström Tjark Weber (UU) Recursion 1 / 37 Background FP I / Advanced FP FP I / Advanced FP This course (Functional Programming I) (5 hp,

More information

function at the given point. Thus, for our previous example we would find that lim f(x) = 0

function at the given point. Thus, for our previous example we would find that lim f(x) = 0 Limits In order to introduce the notion of the it, we will consider the following situation. Suppose you are given a function, defined on some interval, except at a single point in the interval. What,

More information

CMSC 330: Organization of Programming Languages

CMSC 330: Organization of Programming Languages CMSC 330: Organization of Programming Languages Operational Semantics CMSC 330 Summer 2018 1 Formal Semantics of a Prog. Lang. Mathematical description of the meaning of programs written in that language

More information

P1 Engineering Computation

P1 Engineering Computation 1EC 2001 1 / 1 P1 Engineering Computation David Murray david.murray@eng.ox.ac.uk www.robots.ox.ac.uk/ dwm/courses/1ec Hilary 2001 1EC 2001 2 / 1 Algorithms: Design, Constructs and Correctness 1EC 2001

More information

Mathematically Rigorous Software Design Review of mathematical prerequisites

Mathematically Rigorous Software Design Review of mathematical prerequisites Mathematically Rigorous Software Design 2002 September 27 Part 1: Boolean algebra 1. Define the Boolean functions and, or, not, implication ( ), equivalence ( ) and equals (=) by truth tables. 2. In an

More information

One of the most important areas where quantifier logic is used is formal specification of computer programs.

One of the most important areas where quantifier logic is used is formal specification of computer programs. Section 5.2 Formal specification of computer programs One of the most important areas where quantifier logic is used is formal specification of computer programs. Specification takes place on several levels

More information

1.3. Conditional expressions To express case distinctions like

1.3. Conditional expressions To express case distinctions like Introduction Much of the theory developed in the underlying course Logic II can be implemented in a proof assistant. In the present setting this is interesting, since we can then machine extract from a

More information

Lecture 1 Contracts : Principles of Imperative Computation (Fall 2018) Frank Pfenning

Lecture 1 Contracts : Principles of Imperative Computation (Fall 2018) Frank Pfenning Lecture 1 Contracts 15-122: Principles of Imperative Computation (Fall 2018) Frank Pfenning In these notes we review contracts, which we use to collectively denote function contracts, loop invariants,

More information

Chapter 1. Math review. 1.1 Some sets

Chapter 1. Math review. 1.1 Some sets Chapter 1 Math review This book assumes that you understood precalculus when you took it. So you used to know how to do things like factoring polynomials, solving high school geometry problems, using trigonometric

More information

T ::=Nat T T. zero : Nat. This rule can be instantiated for any type T, so it is actually a family of rules, one for each type.

T ::=Nat T T. zero : Nat. This rule can be instantiated for any type T, so it is actually a family of rules, one for each type. V Capretta 46 G54FOP 2018 Chapter 6 System T We have seen that the simple types of λ allow us to define only a limited class of operations. We can program addition and multiplication but not exponentiation.

More information

Functional abstraction. What is abstraction? Eating apples. Readings: HtDP, sections Language level: Intermediate Student With Lambda

Functional abstraction. What is abstraction? Eating apples. Readings: HtDP, sections Language level: Intermediate Student With Lambda Functional abstraction Readings: HtDP, sections 19-24. Language level: Intermediate Student With Lambda different order used in lecture section 24 material introduced much earlier sections 22, 23 not covered

More information

Functional abstraction

Functional abstraction Functional abstraction Readings: HtDP, sections 19-24. Language level: Intermediate Student With Lambda different order used in lecture section 24 material introduced much earlier sections 22, 23 not covered

More information

Recursion. Lars-Henrik Eriksson. Functional Programming 1. Based on a presentation by Tjark Weber and notes by Sven-Olof Nyström

Recursion. Lars-Henrik Eriksson. Functional Programming 1. Based on a presentation by Tjark Weber and notes by Sven-Olof Nyström Lars-Henrik Eriksson Functional Programming 1 Based on a presentation by Tjark Weber and notes by Sven-Olof Nyström Tjark Weber (UU) Recursion 1 / 41 Comparison: Imperative/Functional Programming Comparison:

More information

Notes on Turing s Theorem and Computability

Notes on Turing s Theorem and Computability Notes on Turing s Theorem and Computability Walter Neumann About 60 years ago there was a revolution in mathematics and philosophy. First Gödel and then Turing showed that there are impossible problems

More information

Fundamental Concepts. Chapter 1

Fundamental Concepts. Chapter 1 Chapter 1 Fundamental Concepts This book is about the mathematical foundations of programming, with a special attention on computing with infinite objects. How can mathematics help in programming? There

More information

BOOLEAN ALGEBRA AND CIRCUITS

BOOLEAN ALGEBRA AND CIRCUITS UNIT 3 Structure BOOLEAN ALGEBRA AND CIRCUITS Boolean Algebra and 3. Introduction 3. Objectives 3.2 Boolean Algebras 3.3 Logic 3.4 Boolean Functions 3.5 Summary 3.6 Solutions/ Answers 3. INTRODUCTION This

More information

ELEMENTARY NUMBER THEORY AND METHODS OF PROOF

ELEMENTARY NUMBER THEORY AND METHODS OF PROOF CHAPTER 4 ELEMENTARY NUMBER THEORY AND METHODS OF PROOF Copyright Cengage Learning. All rights reserved. SECTION 4.2 Direct Proof and Counterexample II: Rational Numbers Copyright Cengage Learning. All

More information

Boolean algebra. June 17, Howard Huang 1

Boolean algebra. June 17, Howard Huang 1 Boolean algebra Yesterday we talked about how analog voltages can represent the logical values true and false. We introduced the basic Boolean operations AND, OR and NOT, which can be implemented in hardware

More information

Lecture 7: Primitive Recursion is Turing Computable. Michael Beeson

Lecture 7: Primitive Recursion is Turing Computable. Michael Beeson Lecture 7: Primitive Recursion is Turing Computable Michael Beeson Closure under composition Let f and g be Turing computable. Let h(x) = f(g(x)). Then h is Turing computable. Similarly if h(x) = f(g 1

More information

Fundamentals of the J Programming Language

Fundamentals of the J Programming Language 2 Fundamentals of the J Programming Language In this chapter, we present the basic concepts of J. We introduce some of J s built-in functions and show how they can be applied to data objects. The pricinpals

More information

This chapter covers recursive definition, including finding closed forms.

This chapter covers recursive definition, including finding closed forms. Chapter 12 Recursive Definition This chapter covers recursive definition, including finding closed forms. 12.1 Recursive definitions Thus far, we have defined objects of variable length using semi-formal

More information

Basic Properties The Definition of Catalan Numbers

Basic Properties The Definition of Catalan Numbers 1 Basic Properties 1.1. The Definition of Catalan Numbers There are many equivalent ways to define Catalan numbers. In fact, the main focus of this monograph is the myriad combinatorial interpretations

More information

1. Let n be a positive number. a. When we divide a decimal number, n, by 10, how are the numeral and the quotient related?

1. Let n be a positive number. a. When we divide a decimal number, n, by 10, how are the numeral and the quotient related? Black Converting between Fractions and Decimals Unit Number Patterns and Fractions. Let n be a positive number. When we divide a decimal number, n, by 0, how are the numeral and the quotient related?.

More information

Lecture Notes on Induction and Recursion

Lecture Notes on Induction and Recursion Lecture Notes on Induction and Recursion 15-317: Constructive Logic Frank Pfenning Lecture 7 September 19, 2017 1 Introduction At this point in the course we have developed a good formal understanding

More information

Time Complexity of an Algorithm

Time Complexity of an Algorithm CPSC 211 Data Structures & Implementations (c) Texas A&M University [ 335] Time Complexity of an Algorithm Time complexity of an algorithm: the function T (n) that describes the (worst-case) running time

More information

Topic 3: Propositions as types

Topic 3: Propositions as types Topic 3: Propositions as types May 18, 2014 Propositions as types We have seen that the main mathematical objects in a type theory are types. But remember that in conventional foundations, as based on

More information

(Refer Slide Time: 1:27)

(Refer Slide Time: 1:27) Data Structures and Algorithms Dr. Naveen Garg Department of Computer Science and Engineering Indian Institute of Technology, Delhi Lecture 1 Introduction to Data Structures and Algorithms Welcome to data

More information

Discrete Mathematics for CS Spring 2008 David Wagner Note 13. An Introduction to Graphs

Discrete Mathematics for CS Spring 2008 David Wagner Note 13. An Introduction to Graphs CS 70 Discrete Mathematics for CS Spring 2008 David Wagner Note 13 An Introduction to Graphs Formulating a simple, precise specification of a computational problem is often a prerequisite to writing a

More information

A point is pictured by a dot. While a dot must have some size, the point it represents has no size. Points are named by capital letters..

A point is pictured by a dot. While a dot must have some size, the point it represents has no size. Points are named by capital letters.. Chapter 1 Points, Lines & Planes s we begin any new topic, we have to familiarize ourselves with the language and notation to be successful. My guess that you might already be pretty familiar with many

More information

LECTURE 16. Functional Programming

LECTURE 16. Functional Programming LECTURE 16 Functional Programming WHAT IS FUNCTIONAL PROGRAMMING? Functional programming defines the outputs of a program as a mathematical function of the inputs. Functional programming is a declarative

More information

Lecture 5 - Axiomatic semantics

Lecture 5 - Axiomatic semantics Program Verification March 2014 Lecture 5 - Axiomatic semantics Lecturer: Noam Rinetzky Scribes by: Nir Hemed 1.1 Axiomatic semantics The development of the theory is contributed to Robert Floyd, C.A.R

More information

Resources matter. Orders of Growth of Processes. R(n)= (n 2 ) Orders of growth of processes. Partial trace for (ifact 4) Partial trace for (fact 4)

Resources matter. Orders of Growth of Processes. R(n)= (n 2 ) Orders of growth of processes. Partial trace for (ifact 4) Partial trace for (fact 4) Orders of Growth of Processes Today s topics Resources used by a program to solve a problem of size n Time Space Define order of growth Visualizing resources utilization using our model of evaluation Relating

More information

Recitation 4: Elimination algorithm, reconstituted graph, triangulation

Recitation 4: Elimination algorithm, reconstituted graph, triangulation Massachusetts Institute of Technology Department of Electrical Engineering and Computer Science 6.438 Algorithms For Inference Fall 2014 Recitation 4: Elimination algorithm, reconstituted graph, triangulation

More information

Course notes for Data Compression - 2 Kolmogorov complexity Fall 2005

Course notes for Data Compression - 2 Kolmogorov complexity Fall 2005 Course notes for Data Compression - 2 Kolmogorov complexity Fall 2005 Peter Bro Miltersen September 29, 2005 Version 2.0 1 Kolmogorov Complexity In this section, we present the concept of Kolmogorov Complexity

More information

PROGRAMMING IN HASKELL. CS Chapter 6 - Recursive Functions

PROGRAMMING IN HASKELL. CS Chapter 6 - Recursive Functions PROGRAMMING IN HASKELL CS-205 - Chapter 6 - Recursive Functions 0 Introduction As we have seen, many functions can naturally be defined in terms of other functions. factorial :: Int Int factorial n product

More information

Elementary Recursive Function Theory

Elementary Recursive Function Theory Chapter 6 Elementary Recursive Function Theory 6.1 Acceptable Indexings In a previous Section, we have exhibited a specific indexing of the partial recursive functions by encoding the RAM programs. Using

More information

Algorithm Analysis and Design

Algorithm Analysis and Design Algorithm Analysis and Design Dr. Truong Tuan Anh Faculty of Computer Science and Engineering Ho Chi Minh City University of Technology VNU- Ho Chi Minh City 1 References [1] Cormen, T. H., Leiserson,

More information

AXIOMS FOR THE INTEGERS

AXIOMS FOR THE INTEGERS AXIOMS FOR THE INTEGERS BRIAN OSSERMAN We describe the set of axioms for the integers which we will use in the class. The axioms are almost the same as what is presented in Appendix A of the textbook,

More information

Functional Programming

Functional Programming Functional Programming CS331 Chapter 14 Functional Programming Original functional language is LISP LISt Processing The list is the fundamental data structure Developed by John McCarthy in the 60 s Used

More information

Chapter 4. Number Theory. 4.1 Factors and multiples

Chapter 4. Number Theory. 4.1 Factors and multiples Chapter 4 Number Theory We ve now covered most of the basic techniques for writing proofs. So we re going to start applying them to specific topics in mathematics, starting with number theory. Number theory

More information

Lambda Calculus. CS 550 Programming Languages Jeremy Johnson

Lambda Calculus. CS 550 Programming Languages Jeremy Johnson Lambda Calculus CS 550 Programming Languages Jeremy Johnson 1 Lambda Calculus The semantics of a pure functional programming language can be mathematically described by a substitution process that mimics

More information

TAFL 1 (ECS-403) Unit- V. 5.1 Turing Machine. 5.2 TM as computer of Integer Function

TAFL 1 (ECS-403) Unit- V. 5.1 Turing Machine. 5.2 TM as computer of Integer Function TAFL 1 (ECS-403) Unit- V 5.1 Turing Machine 5.2 TM as computer of Integer Function 5.2.1 Simulating Turing Machine by Computer 5.2.2 Simulating Computer by Turing Machine 5.3 Universal Turing Machine 5.4

More information

9/23/2014. Why study? Lambda calculus. Church Rosser theorem Completeness of Lambda Calculus: Turing Complete

9/23/2014. Why study? Lambda calculus. Church Rosser theorem Completeness of Lambda Calculus: Turing Complete Dr A Sahu Dept of Computer Science & Engineering IIT Guwahati Why study? Lambda calculus Syntax Evaluation Relationship to programming languages Church Rosser theorem Completeness of Lambda Calculus: Turing

More information