Homework Five Solution CSE 355

Size: px
Start display at page:

Download "Homework Five Solution CSE 355"

Transcription

1 Homework Five Solution CSE 355 Due: 17 April 01 Please note that there is more than one way to answer most of these questions. The following only represents a sample solution. Problem 1: Linz and : Show that the language L = {w {a, b, c} : n a (w) + n b (w) = n c (w)} is context-free, but not linear. In order to show that the language is context-free, we will give the machine definition of the corresponding npda and by Theorem 7., we know that there exists a CFL for the npda. Define M = ({q 0, q 1 }, Σ, {a, c, z}, δ, q 0, z, {q 1 }) with δ(q 0, a, z) = {(q 0, az)}, δ(q 0, a, a) = {(q 0, aa)}, δ(q 0, a, c) = {(q 0, λ)}, δ(q 0, b, z) = {(q 0, az)}, δ(q 0, b, a) = {(q 0, aa)}, δ(q 0, b, c) = {(q 0, λ)}, δ(q 0, c, z) = {(q 0, cz)}, δ(q 0, c, a) = {(q 0, λ)}, δ(q 0, c, c) = {(q 0, cc)}, δ(q 0, λ, z) = {(q 1, λ)}. Then M accepts L since it keeps count of how many as and bs are read with the stack symbol a and how many cs with the symbol c. For each a and b seen it will cancel a c if that is on the top of the stack or add an a. Similarly, for each c seen, it will add a c to the stack or cancel an a if it is on top of the stack. Finally, we only accept if the number of cs is the same as the number of as and bs combined, that is they all cancel each other on the stack. In order to show that the language is not linear, we will use the pumping lemma from Theorem 8.. Assume that the language is linear and apply the Theorem 8. to the string w = a m c m b m. Inequality (8.5) uvyz m shows that in this case the strings u, v must both consist entirely of a s, that is v = a k and y, z must both consist entirely of b s, that is y = b l. If we pump this string once, we get a m+k c m b m+l, with either k 1 or l 1 due to inequality (8.6), a result that is not in L. This contradiction of Theorem 8. proves that the language is not linear. 8..7: Show that the family of context-free languages is not closed under difference in general, but is closed under regular difference, that is, if L 1 is context-free and L is regular, then L 1 L is context-free. To show that context free languages are not closed under difference in general, we will give two context free languages whose difference is no longer context free. Let L 1 = {a n b n c m : m, n 0} and L = {a m b n c n : m, n 0}. L 1 and L are both context free languages (in fact determinstic context free languages), but L 1 L = L 1 L = {a n b n c m : m, n 0} {a m b n c n : m, n 0} = {a n b n c m : 1

2 m, n 0} {a m b n c n : m, n 0} = {a n b n c n : n 0} which is not context free by Example 8.1 in Linz. Thus, the family of context free languages is not closed under difference. Next, we will show that the class of context free languages is closed under regular difference. Let L 1 be any context free langauge and L be any regular language. We know from Theorm 4.1 that regular languages are closed under complement, therefore L is a regular language. From Theorem 8.5 of Linz we also know that context free languages are closed under regular intersection. Thus, L = L 1 L = L 1 L is a result of a regular intersection and is therefore a context free language. Problem : Linz and : Design Turing machines to compute the following functions for x and y positive integers represented in unary. For each of these problems let u(x) = 1 x where 1 x is 1 written x times. u(0) = λ and will be represented by the tape having only blanks on it. We will assume that (a) f(x) = 3x. The input to our tape will be u(x) and the output will be u(3x). Our strategy follows Example 9.10 of Linz. We will first mark all the 1s and then for every marked 1 we see we will write two 1s at the end of the string, thus tripling the string. Q = {q 0, q 1, q, q 3, q f }, where q 0 is the start state and q f the only final state, Σ = {1}, Γ = {1, 1, } where is the blank tape symbol, and δ(q 0, 1) = (q 0, 1, R), δ(q 0, ) = (q 1,, L), these two transitions mark all the 1s on the tape. δ(q 1, 1) = (q 1, 1, L), go left until a marked 1 is seen, δ(q 1, 1) = (q, 1, R), unmark it δ(q, 1) = (q, 1, R), go to the end of the tape δ(q, ) = (q 3, 1, R), δ(q 3, ) = (q 1, 1, L), write two 1s and repeat looking for the next marked 1. δ(q 1, ) = (q f,, R), if no marked 1 is found, we are done and halt. (b) f(x, y) = x y if x > y; and f(x, y) = 0 otherwise. The input to our tape will be u(x) u(y) and the output will be u(x y) if x > y and the blank tape otherwise. Our strategy will be to remove a 1 from the end of the string (the y portion) and then remove a corresponding 1 from the front of the string (the x portion). We continue until either we are out of 1s in the y portion, in which case we have u(x y) on the tape, or we are out of 1s in the x portion in which case x y, so we clear the tape and halt with the blank tape.

3 Q = {q 0, q 1, q, q 3, q 4, q 5, q f }, where q 0 is the start state and q f the only final state, Σ = {1, }, Γ = {1,, } where is the blank tape symbol, and δ(q 0, 1) = (q 0, 1, R), δ(q 0, ) = (q 0,, R), δ(q 0, ) = (q 1,, L), moved to the end of the input δ(q 1, 1) = (q,, L), we delete the end 1 δ(q, 1) = (q, 1, L), δ(q, ) = (q,, L), δ(q, ) = (q 3,, R), moved to the start of the input δ(q 3, 1) = (q 0,, R), and delete the first one, essentially substracting one of the sybmols in y from x. We then repeat moving to the end of the string. δ(q 1, ) = (q 4,, L), if out of input with y first (x y), clear the minus and δ(q 4, 1) = (q 4, 1, L), move back to the beginning δ(q 4, ) = (q f,, R), and halt δ(q 3, ) = (q 5,, R), if no 1 in the x portion to match to a 1 in the y portion (y > x) δ(q 5, 1) = (q 5,, R), clear the tape δ(q 5, ) = (q f,, R), and halt (c) f(x, y) = x + 3y. The input to our tape will be u(x) + u(y) and the output will be u(x + 3y). Our strategy follows Examples 9.9 and 9.10 of Linz. We will first mark all the 1s before the plus with one dot and then change the plus to a one with two dots and continue marking every one after it with two dots. We will remove the last 1 as extra to the sum. Then for every 1 with two dots seen we will write two 1s and the end of the string and for every 1 with one dot we will write one 1 and the end of the string, yielding the required total. Q = {q 0, q 1, q, q 3, q 4, q f }, where q 0 is the start state and q f the only final state, Σ = {1, +}, Γ = {1, +, 1, 1, } where is the blank tape symbol, and δ(q 0, 1) = (q 0, 1, R), replace every 1 before the + with a single dot δ(q 0, +) = (q 1, 1, R), δ(q 1, 1) = (q 1, 1, R), replace the + and every 1 after it with two dots 3

4 δ(q 1, ) = (q 1,, L), until we reach the end of the input δ(q 1, 1) = (q,, L), remove the last one (its place was taken by the +) δ(q, 1) = (q, 1, L), search for the next marked one δ(q, 1) = (q 3, 1, R), if the 1 has two marks δ(q 3, 1) = (q 3, 1, R), go to the end of the string δ(q 3, ) = (q 4, 1, R), δ(q 4, ) = (q, 1, L), and write two 1s. Repeat scanning the string for the next mark δ(q, 1) = (q 5, 1, R), if the 1 has one mark δ(q 4, 1) = (q 4, 1, R), go to the end of the string, where we would write a single 1 at the blank (as above for q 4 ) δ(q, ) = (q f,, R), If no mark is found, we have transformed the string, and so we halt. (d) f(x) = x, or f(x) = x if x is even and f(x) = x+1 if x is odd. The input to our tape will be u(x) and the output will be u( x ). Our strategy is to mark a 1 at the start of the string and remove a corresponding one at the end of the string. We will repeat marking the next unmarked 1 at the beginning and removing another 1 at the end. We will continue until there is no unmarked 1 left (x was even) and we cut the output in half, or there is no one left to remove at the end (x was odd) and the output is the fraction rounded up. Then we clear all marks and halt. Q = {q 0, q 1, q, q 3, q f }, where q 0 is the start state and q f the only final state, Σ = {1}, Γ = {1, 1, } where is the blank tape symbol, and δ(q 0, 1) = (q 1, 1, R), Mark the first one δ(q 1, 1) = (q 1, 1, R), δ(q 1, ) = (q,, L), move to the end of the string δ(q, 1) = (q 3,, L), remove the last 1 δ(q 3, 1) = (q 3, 1, L), δ(q 3, 1) = (q 0, 1, R), move back to the first unmarked 1 in the string and repeat from the start δ(q 0, ) = (q,, L), If there are no unmarked 1s remaining to mark (x was even) δ(q, 1) = (q, 1, L), clear the marks moving to the start of the string (This also takes care of the case when x was odd since if there are no unmarked 1s and the end of the string to remove after marking a 1, q will start on a marked 1 and we have to remove the marks). δ(q, ) = (q f,, R), and halt 4

5 (e) f(x) = x mod 5. The input to our tape will be u(x) and the output will be u(x mod 5). Our strategy is to mark all the 1s as we scan to the right using our states to remember how many 1s we have seen mod 5. Then we will remove the marks from that many 1s and scan back to the left over the remaining marked 1s. Then we will delete all the marked ones and halt with x mod 5 on the tape. Q = {q 0, q 1, q, q 3, q 4, q 5, q f }, where q 0 is the start state and q f the only final state, Σ = {1}, Γ = {1, 1, } where is the blank tape symbol, and δ(q 0, 1) = (q 1, 1, R), Mark a one and move to the state of 1 mod 5 δ(q 1, 1) = (q, 1, R), Mark a one and move to the state of mod 5 δ(q, 1) = (q, 1, R), Mark a one and move to the state of 3 mod 5 δ(q 3, 1) = (q 4, 1, R), Mark a one and move to the state of 4 mod 5 δ(q 4, 1) = (q 0, 1, R), Mark a one and move to the state of 0 mod 5, repeating until the end δ(q 4, ) = (q 4,, L), δ(q 3, ) = (q 3,, L), δ(q, ) = (q,, L), δ(q 1, ) = (q 1,, L), δ(q 0, ) = (q 0,, L), whichever state we ended in we remember δ(q 4, 1) = (q 3, 1, L), δ(q 3, 1) = (q, 1, L), δ(q, 1) = (q 1, 1, L), δ(q 1, 1) = (q 0, 1, L), and unmark that many 1s (this will be our answer) δ(q 0, 1) = (q 0, 1, L), We then scan back to the beginning δ(q 0, ) = (q 5,, R), δ(q 5, 1) = (q 5,, R), and remove the marked 1s δ(q 5, 1) = (q 5, 1, L), until we find an unmarked one δ(q 5, ) = (q f,, R), and then halt. (f) f(x) = x, or f(x) = x if x is even and f(x) = x 1 if x is odd. The input to our tape will be u(x) and the output will be u( x ). Our strategy is similar to part (e) above, but now if we don t find an unmarked 1 at the end of the tape to match with a marked one at the front of the tape, we remove the last marked one before clearing the marks and halting. 5

6 Q = {q 0, q 1, q, q 3, q 4, q f }, where q 0 is the start state and q f the only final state, Σ = {1}, Γ = {1, 1, } where is the blank tape symbol, and δ(q 0, 1) = (q 1, 1, R), Mark the first one δ(q 1, 1) = (q 1, 1, R), δ(q 1, ) = (q,, L), move to the end of the string δ(q, 1) = (q 3,, L), remove the last 1 δ(q 3, 1) = (q 3, 1, L), δ(q 3, 1) = (q 0, 1, R), move back to the first unmarked 1 in the string and repeat from the start δ(q 0, ) = (q 4,, L), If there are no unmarked 1s remaining to mark (x was even) δ(q 4, 1) = (q 4, 1, L), clear the marks moving to the start of the string δ(q 4, ) = (q f,, R), and halt δ(q, 1) = (q 4,, L), If no unmarked 1s to match at the end of the string (x was odd), remove the last marked 1 and go to the state to clear the marks 9..7: Sketch the construction of a Turing machine that can perform the addition and multiplication of positive integers x and y given in the usual decimal notation. For decimal addition f(x, y) = x + y. We will start with x + y on the tape and end with the sum on the tape. The idea is to decrement y and increment x, until y becomes 0. First we decrement y with the following TM: Move to the rightmost digit in y. Repeat the following steps until done. If the current symbol under the tape head is +, then clear y and go to the start of x and stop (the addition is complete). If the current symbol is any digit is anything other than a 0, decrement the current digit under tape head by 1 (replace the digit with the next lower digit) and proceed to increment x by one. The decrementing is done. If the current symbol under tape is 0, replace it with 9 and move the tape head to the left. Continue from Repeat. Then we increment x with the following TM: Move to the rightmost digit in x. Repeat the following steps until done. If the symbol under the tape head is a blank, write a 1. 6

7 If the symbol under the tape head is any digit other than 9, increment the current digit under tape head by 1 (replace the digit with the next higher digit) and proceed to decrement y. We have finished the increment. If the current digit under tape head is 9, replace it with 0 and move the tape head to the left. Continue from Repeat. For decimal multiplication f(x, y) = xy, we start with x y on the tape and stop with the product. The idea is to decrement y until it becomes 0 and for each decrement of y, add x to a running sum. Decrementing y can be done using the decrement module mentioned above. To keep adding x to x we first copy x to another part of the tape and keep a running sum on that part. We then use the adding module above on the copy of x and the running sum. After the sum is complete we decrement y again and repeat. Problem 3: Linz : Let L be a deterministic context-free language and define a new language L 1 = {w : aw L, a Σ}. Is it necessarily true that L 1 is a deterministic contextfree language? No! We will use a variation of Example 7.11 to give a counter-example. Let L = {ca n b n : n 0} {da n b n : n 0}, then L is a deterministic context-free language, if we start with a c we follow a branch where we accept or if we read an a we push one extra a on the stack and then pop one a for each b read, accepting only if the stack is empty. If we start with a d, then we follow another branch where we accept or if we read an a we push two extra as on the stack and then for each b read we pop one a, accepting only if the stack is empty. In every configuration we can only move to one other configuration, meeting the criteria for determinism. However, then L 1 = {a n b n : n 0} {a n b n : n 0} (removing the first symbol from every string in L), which is the language in Example 7.11 which was shown in the example to be nondeterministic. Problem 4: Linz : Provide a high-level description for Turing machines that accept the following languages on {a, b}. For each problem, define a set of appropriate macroinstructions that you feel are reasonably easy to implement. Then use them for the solution. (a) L = {ww R }. We have to match the first input symbol with the last input symbol on the tape, then proceed to match the second input symbol and second last input symbol, and so on until we reach the middle of the string. On input w {a, b} : 1. Repeat the following steps until the input string contains no more a s or b s. Move to the leftmost a or b on the tape. At this stage, if it cannot find a a or b, go to. 7

8 If the symbol on the tape head is an a: Replace it with another symbol 0. Then, scan to a 0 or 1 or blank. If the symbol to the left of it is an a then change it to a 0 and continue from step 1. If the symbol before it is not an a, computation of the TM halts there in a non-accepting state. If the symbol on the tape head is a b: Replace it with another symbol 1. Then, scan to a 0 or 1 or blank. If the symbol to the left of it is b then change it to a 1 and continue from step 1. If the symbol before it is not an b, computation of the TM halts there in a non-accepting state.. Replace all 0s with as and 1s with bs and halt in an accepting state. (b) L = {w 1 w : w 1 w : w 1 = w }. We have to match the length of the first half of the string with the second half of the string and ensure that the first-half substring is not the same as the second-half substring. On input w {a, b} : 1. Repeat the following steps until the input string contains no more a s or b s (This part checks if the string has even length). Move to the leftmost a or b on the tape. At this stage, if it cannot find an a or b, move to the left end of the tape (until it finds a blank symbol) and go to step. If the current symbol is an a, replace it with another symbol 0. If the current symbol is a b, replace it with another symbol 1. Then scan to the first 0, 1, or blank and move left. If the currenty symbol is an a replace it with a 0 and move left. If it is a b replace it with a 1 and move left. If an a or a b is not found at this stage, reject the string (it doesn t have an even length). If the current symbol is a 0, replace it with a #0. If it is a 1, replace it with a #1. (This marks the last symbol of w 1 in the string). Repeat from step 1.. Repeat the following steps until there are no more 0s or 1s on the tape (This part checks if the two halves are equal): Move to the leftmost 0 or 1 on the tape. If a 0 or 1 cannot be found reject and halt. (The strings were identical). If the next symbol is a 0: Replace it with another symbol a. Then, move to the first 0 or 1 after the #. If that symbol is a 1, accept (Different input at this position, so not equal). If it is a 0, replace it with an a. Repeat from. If the next symbol in the input is a 1: 8

9 Replace it with another symbol b. Then, move to the first 0 or 1 after the #. If that symbol is a 0, accept (Different input at this position, so not equal). If it is a 1, replace it with a b. Repeat from. (c) The complement of the language in part (a). The solution to part (a) has explicitly stated the transitions to accepting and non-accepting states. If the TM in part (a) accepts, reject. If the TM in part (a) rejects, accept. Such a TM will essentially represent the complement of the language in part (a). (d) L = {a n b m : m = n, n 1}. The idea here is to remove n bs for each a seen. This is done with the following TM: On input w {a, b} : 1. Make sure the string is in L(a b ). If it is continue. Otherwise, halt and reject. (This can be done by scanning to the left over the as until a b or blank. If any as are seen after the first b reject.). Mark the first unmarked a. If there are no unmarked as go to Scan to the end of the string and remove n bs. (This can be accomplished by zigzagging between the as and bs giving the as a second mark and deleting bs). If there are not enough bs to remove, then halt and reject (fewer than n bs). 4. Scan to the start of the string and repeat from. 5. If the first symbol after the marked as is a b (more than n bs), halt and reject. If the first symbol is a blank, halt and accept. (e) L = {a n : n is a prime number}. The idea here is to check if there is an 1 < i < n such that n mod i = 0. If there is then n is not prime. We implement this as follows: On input w {a, b} : 1. Make sure the string is in L(a + ). If it is continue. Otherwise, halt and reject. (This can be done by scanning to the left over any as. If a b is seen before the end blank, reject).. If there is exactly one a on the tape, halt and reject (1 is not prime). If there are exactly two as on the tape, halt and accept ( is a prime number). Otherwise, continue. (Those were the base cases). 3. For every a on the tape write an x on another part of the tape. 4. Delete the first x (we only want to check divisibility up to n 1) and replace the next x with a y. 5. Find the next x on the tape and replace it with a y. If there are no more xs halt and accept (n was not divisible by any number smaller than itself and so is prime). 9

10 6. Then for the number of ys on the tape, call it i, check if n mod i = 0. If it is halt and reject. If it is not continue from 5. (This can be done using a modified version of our answer to Problem (e) above, where we zigzag between ys and as placing new marks on them. After we finish the ys we remove the marks on them and start the matching over from the first y. We continue to do so until we run out of as to match (this does the mod ). If we reach the end of the as and ys at the same time, then n is divisible by i and hence not prime; whence, we reject). Problem 5: Linz Write a simple program for a nondeterministic Turing machine that accepts the language L = {xww R y : x, y, w {a, b} +, x y }. How would you solve this problem deterministically? Nondeterminism: We will use the following nondeterministic TM: On input z {a, b} + : 1. Scan to the right and nondeterministically mark any two symbols in the string.. Check if there are at least as many symbols to the left of (and including) the first marked symbol as there are to the right of (and including) the last marked symbol. If there are continue. Otherwise, halt in a nonaccepting state. 3. Check if there is any sybmols between the two marks. If not reject. If there are check if the symbols between the marks are of the form ww R (this can be done by zigzagging from front to the end matching symbols). If it is accept and halt. Otherwise reject. This machine marks two symbols, which breaks the string up into a possible x, y and ww R portions. It does this nondeterministically, meaning that for any way to split the string there is a branch of computation where that split was checked. If at least one of the splits is of the correct form then we accept. Determinism: Here we have to keep updating the marks and check the corresponding split until all possible ways to split are tried. The following TM implements this algorithm: On input z {a, b} + : 1. Mark the first and last symbol in z.. If the inside part of the two marks is not empty and can be expressed as ww R, accept and halt. 3. If the first mark is not on the next to last symbol, continue. Otherwise go to Move the first mark one to the right. 5. Place the last mark on the last symbol. 6. If the middle part of the two marks is not empty and can be expressed as ww R, accept and halt. 10

11 7. If there are more symbols to the left of the first mark than to the right of the second mark and there is an unmarked symbol between the two marks, move the second mark left and repeat from 6. Otherwise repeat from Halt in a non-accepting state (we have tried all possible ways to split the string and none of them produced a string in L). 11

Automata and Computability. Solutions to Exercises

Automata and Computability. Solutions to Exercises Automata and Computability Solutions to Exercises Fall 25 Alexis Maciel Department of Computer Science Clarkson University Copyright c 25 Alexis Maciel ii Contents Preface vii Introduction 2 Finite Automata

More information

Turing Machines: An Introduction

Turing Machines: An Introduction CIT 596 Theory of Computation 1 We have seen several abstract models of computing devices: Deterministic Finite Automata, Nondeterministic Finite Automata, Nondeterministic Finite Automata with ɛ-transitions,

More information

Pushdown Automata. place the input head on the leftmost input symbol. while symbol read = b and pile contains discs advance head remove disc from pile

Pushdown Automata. place the input head on the leftmost input symbol. while symbol read = b and pile contains discs advance head remove disc from pile Pushdown Automata In the last section we found that restricting the computational power of computing devices produced solvable decision problems for the class of sets accepted by finite automata. But along

More information

(IALC, Chapters 8 and 9) Introduction to Turing s life, Turing machines, universal machines, unsolvable problems.

(IALC, Chapters 8 and 9) Introduction to Turing s life, Turing machines, universal machines, unsolvable problems. 3130CIT: Theory of Computation Turing machines and undecidability (IALC, Chapters 8 and 9) Introduction to Turing s life, Turing machines, universal machines, unsolvable problems. An undecidable problem

More information

Formal Languages and Automata Theory - Regular Expressions and Finite Automata -

Formal Languages and Automata Theory - Regular Expressions and Finite Automata - Formal Languages and Automata Theory - Regular Expressions and Finite Automata - Samarjit Chakraborty Computer Engineering and Networks Laboratory Swiss Federal Institute of Technology (ETH) Zürich March

More information

3515ICT Theory of Computation Turing Machines

3515ICT Theory of Computation Turing Machines Griffith University 3515ICT Theory of Computation Turing Machines (Based loosely on slides by Harald Søndergaard of The University of Melbourne) 9-0 Overview Turing machines: a general model of computation

More information

CS154. Turing Machines. Turing Machine. Turing Machines versus DFAs FINITE STATE CONTROL AI N P U T INFINITE TAPE. read write move.

CS154. Turing Machines. Turing Machine. Turing Machines versus DFAs FINITE STATE CONTROL AI N P U T INFINITE TAPE. read write move. CS54 Turing Machines Turing Machine q 0 AI N P U T IN TAPE read write move read write move Language = {0} q This Turing machine recognizes the language {0} Turing Machines versus DFAs TM can both write

More information

Notes on Complexity Theory Last updated: August, 2011. Lecture 1

Notes on Complexity Theory Last updated: August, 2011. Lecture 1 Notes on Complexity Theory Last updated: August, 2011 Jonathan Katz Lecture 1 1 Turing Machines I assume that most students have encountered Turing machines before. (Students who have not may want to look

More information

Chapter 7 Uncomputability

Chapter 7 Uncomputability Chapter 7 Uncomputability 190 7.1 Introduction Undecidability of concrete problems. First undecidable problem obtained by diagonalisation. Other undecidable problems obtained by means of the reduction

More information

Pushdown automata. Informatics 2A: Lecture 9. Alex Simpson. 3 October, 2014. School of Informatics University of Edinburgh als@inf.ed.ac.

Pushdown automata. Informatics 2A: Lecture 9. Alex Simpson. 3 October, 2014. School of Informatics University of Edinburgh als@inf.ed.ac. Pushdown automata Informatics 2A: Lecture 9 Alex Simpson School of Informatics University of Edinburgh als@inf.ed.ac.uk 3 October, 2014 1 / 17 Recap of lecture 8 Context-free languages are defined by context-free

More information

The Halting Problem is Undecidable

The Halting Problem is Undecidable 185 Corollary G = { M, w w L(M) } is not Turing-recognizable. Proof. = ERR, where ERR is the easy to decide language: ERR = { x { 0, 1 }* x does not have a prefix that is a valid code for a Turing machine

More information

Computability Theory

Computability Theory CSC 438F/2404F Notes (S. Cook and T. Pitassi) Fall, 2014 Computability Theory This section is partly inspired by the material in A Course in Mathematical Logic by Bell and Machover, Chap 6, sections 1-10.

More information

1 Definition of a Turing machine

1 Definition of a Turing machine Introduction to Algorithms Notes on Turing Machines CS 4820, Spring 2012 April 2-16, 2012 1 Definition of a Turing machine Turing machines are an abstract model of computation. They provide a precise,

More information

CSE 135: Introduction to Theory of Computation Decidability and Recognizability

CSE 135: Introduction to Theory of Computation Decidability and Recognizability CSE 135: Introduction to Theory of Computation Decidability and Recognizability Sungjin Im University of California, Merced 04-28, 30-2014 High-Level Descriptions of Computation Instead of giving a Turing

More information

CS 3719 (Theory of Computation and Algorithms) Lecture 4

CS 3719 (Theory of Computation and Algorithms) Lecture 4 CS 3719 (Theory of Computation and Algorithms) Lecture 4 Antonina Kolokolova January 18, 2012 1 Undecidable languages 1.1 Church-Turing thesis Let s recap how it all started. In 1990, Hilbert stated a

More information

Lecture 2: Universality

Lecture 2: Universality CS 710: Complexity Theory 1/21/2010 Lecture 2: Universality Instructor: Dieter van Melkebeek Scribe: Tyson Williams In this lecture, we introduce the notion of a universal machine, develop efficient universal

More information

Turing Machines, Part I

Turing Machines, Part I Turing Machines, Part I Languages The $64,000 Question What is a language? What is a class of languages? Computer Science Theory 2 1 Now our picture looks like Context Free Languages Deterministic Context

More information

Computational Models Lecture 8, Spring 2009

Computational Models Lecture 8, Spring 2009 Slides modified by Benny Chor, based on original slides by Maurice Herlihy, Brown Univ. p. 1 Computational Models Lecture 8, Spring 2009 Encoding of TMs Universal Turing Machines The Halting/Acceptance

More information

Elementary Number Theory and Methods of Proof. CSE 215, Foundations of Computer Science Stony Brook University http://www.cs.stonybrook.

Elementary Number Theory and Methods of Proof. CSE 215, Foundations of Computer Science Stony Brook University http://www.cs.stonybrook. Elementary Number Theory and Methods of Proof CSE 215, Foundations of Computer Science Stony Brook University http://www.cs.stonybrook.edu/~cse215 1 Number theory Properties: 2 Properties of integers (whole

More information

6.045: Automata, Computability, and Complexity Or, Great Ideas in Theoretical Computer Science Spring, 2010. Class 4 Nancy Lynch

6.045: Automata, Computability, and Complexity Or, Great Ideas in Theoretical Computer Science Spring, 2010. Class 4 Nancy Lynch 6.045: Automata, Computability, and Complexity Or, Great Ideas in Theoretical Computer Science Spring, 2010 Class 4 Nancy Lynch Today Two more models of computation: Nondeterministic Finite Automata (NFAs)

More information

Increasing Interaction and Support in the Formal Languages and Automata Theory Course

Increasing Interaction and Support in the Formal Languages and Automata Theory Course Increasing Interaction and Support in the Formal Languages and Automata Theory Course [Extended Abstract] Susan H. Rodger rodger@cs.duke.edu Jinghui Lim Stephen Reading ABSTRACT The introduction of educational

More information

CAs and Turing Machines. The Basis for Universal Computation

CAs and Turing Machines. The Basis for Universal Computation CAs and Turing Machines The Basis for Universal Computation What We Mean By Universal When we claim universal computation we mean that the CA is capable of calculating anything that could possibly be calculated*.

More information

2) Write in detail the issues in the design of code generator.

2) Write in detail the issues in the design of code generator. COMPUTER SCIENCE AND ENGINEERING VI SEM CSE Principles of Compiler Design Unit-IV Question and answers UNIT IV CODE GENERATION 9 Issues in the design of code generator The target machine Runtime Storage

More information

Introduction to Automata Theory. Reading: Chapter 1

Introduction to Automata Theory. Reading: Chapter 1 Introduction to Automata Theory Reading: Chapter 1 1 What is Automata Theory? Study of abstract computing devices, or machines Automaton = an abstract computing device Note: A device need not even be a

More information

Automata and Formal Languages

Automata and Formal Languages Automata and Formal Languages Winter 2009-2010 Yacov Hel-Or 1 What this course is all about This course is about mathematical models of computation We ll study different machine models (finite automata,

More information

Introduction to Turing Machines

Introduction to Turing Machines Automata Theory, Languages and Computation - Mírian Halfeld-Ferrari p. 1/2 Introduction to Turing Machines SITE : http://www.sir.blois.univ-tours.fr/ mirian/ Automata Theory, Languages and Computation

More information

Regular Expressions and Automata using Haskell

Regular Expressions and Automata using Haskell Regular Expressions and Automata using Haskell Simon Thompson Computing Laboratory University of Kent at Canterbury January 2000 Contents 1 Introduction 2 2 Regular Expressions 2 3 Matching regular expressions

More information

Model 2.4 Faculty member + student

Model 2.4 Faculty member + student Model 2.4 Faculty member + student Course syllabus for Formal languages and Automata Theory. Faculty member information: Name of faculty member responsible for the course Office Hours Office Number Email

More information

Year 9 set 1 Mathematics notes, to accompany the 9H book.

Year 9 set 1 Mathematics notes, to accompany the 9H book. Part 1: Year 9 set 1 Mathematics notes, to accompany the 9H book. equations 1. (p.1), 1.6 (p. 44), 4.6 (p.196) sequences 3. (p.115) Pupils use the Elmwood Press Essential Maths book by David Raymer (9H

More information

24 Uses of Turing Machines

24 Uses of Turing Machines Formal Language and Automata Theory: CS2004 24 Uses of Turing Machines 24 Introduction We have previously covered the application of Turing Machine as a recognizer and decider In this lecture we will discuss

More information

CPS 140 - Mathematical Foundations of CS Dr. S. Rodger Section: Properties of Context-Free Languages èhandoutè Section 3.5 Which of the following languages are CFL? æ L=fa n b n c j j 0 énçjg æ L=fa n

More information

Reading 13 : Finite State Automata and Regular Expressions

Reading 13 : Finite State Automata and Regular Expressions CS/Math 24: Introduction to Discrete Mathematics Fall 25 Reading 3 : Finite State Automata and Regular Expressions Instructors: Beck Hasti, Gautam Prakriya In this reading we study a mathematical model

More information

LEARNING OBJECTIVES FOR THIS CHAPTER

LEARNING OBJECTIVES FOR THIS CHAPTER CHAPTER 2 American mathematician Paul Halmos (1916 2006), who in 1942 published the first modern linear algebra book. The title of Halmos s book was the same as the title of this chapter. Finite-Dimensional

More information

Row Echelon Form and Reduced Row Echelon Form

Row Echelon Form and Reduced Row Echelon Form These notes closely follow the presentation of the material given in David C Lay s textbook Linear Algebra and its Applications (3rd edition) These notes are intended primarily for in-class presentation

More information

The Chinese Remainder Theorem

The Chinese Remainder Theorem The Chinese Remainder Theorem Evan Chen evanchen@mit.edu February 3, 2015 The Chinese Remainder Theorem is a theorem only in that it is useful and requires proof. When you ask a capable 15-year-old why

More information

3. Mathematical Induction

3. Mathematical Induction 3. MATHEMATICAL INDUCTION 83 3. Mathematical Induction 3.1. First Principle of Mathematical Induction. Let P (n) be a predicate with domain of discourse (over) the natural numbers N = {0, 1,,...}. If (1)

More information

ÖVNINGSUPPGIFTER I SAMMANHANGSFRIA SPRÅK. 15 april 2003. Master Edition

ÖVNINGSUPPGIFTER I SAMMANHANGSFRIA SPRÅK. 15 april 2003. Master Edition ÖVNINGSUPPGIFTER I SAMMANHANGSFRIA SPRÅK 5 april 23 Master Edition CONTEXT FREE LANGUAGES & PUSH-DOWN AUTOMATA CONTEXT-FREE GRAMMARS, CFG Problems Sudkamp Problem. (3.2.) Which language generates the grammar

More information

How To Understand The Theory Of Computer Science

How To Understand The Theory Of Computer Science Theory of Computation Lecture Notes Abhijat Vichare August 2005 Contents 1 Introduction 2 What is Computation? 3 The λ Calculus 3.1 Conversions: 3.2 The calculus in use 3.3 Few Important Theorems 3.4 Worked

More information

COMP 250 Fall 2012 lecture 2 binary representations Sept. 11, 2012

COMP 250 Fall 2012 lecture 2 binary representations Sept. 11, 2012 Binary numbers The reason humans represent numbers using decimal (the ten digits from 0,1,... 9) is that we have ten fingers. There is no other reason than that. There is nothing special otherwise about

More information

8 Divisibility and prime numbers

8 Divisibility and prime numbers 8 Divisibility and prime numbers 8.1 Divisibility In this short section we extend the concept of a multiple from the natural numbers to the integers. We also summarize several other terms that express

More information

Mathematical Induction

Mathematical Induction Mathematical Induction (Handout March 8, 01) The Principle of Mathematical Induction provides a means to prove infinitely many statements all at once The principle is logical rather than strictly mathematical,

More information

a 11 x 1 + a 12 x 2 + + a 1n x n = b 1 a 21 x 1 + a 22 x 2 + + a 2n x n = b 2.

a 11 x 1 + a 12 x 2 + + a 1n x n = b 1 a 21 x 1 + a 22 x 2 + + a 2n x n = b 2. Chapter 1 LINEAR EQUATIONS 1.1 Introduction to linear equations A linear equation in n unknowns x 1, x,, x n is an equation of the form a 1 x 1 + a x + + a n x n = b, where a 1, a,..., a n, b are given

More information

I. GROUPS: BASIC DEFINITIONS AND EXAMPLES

I. GROUPS: BASIC DEFINITIONS AND EXAMPLES I GROUPS: BASIC DEFINITIONS AND EXAMPLES Definition 1: An operation on a set G is a function : G G G Definition 2: A group is a set G which is equipped with an operation and a special element e G, called

More information

Solutions for Practice problems on proofs

Solutions for Practice problems on proofs Solutions for Practice problems on proofs Definition: (even) An integer n Z is even if and only if n = 2m for some number m Z. Definition: (odd) An integer n Z is odd if and only if n = 2m + 1 for some

More information

6.080/6.089 GITCS Feb 12, 2008. Lecture 3

6.080/6.089 GITCS Feb 12, 2008. Lecture 3 6.8/6.89 GITCS Feb 2, 28 Lecturer: Scott Aaronson Lecture 3 Scribe: Adam Rogal Administrivia. Scribe notes The purpose of scribe notes is to transcribe our lectures. Although I have formal notes of my

More information

Computer Architecture Syllabus of Qualifying Examination

Computer Architecture Syllabus of Qualifying Examination Computer Architecture Syllabus of Qualifying Examination PhD in Engineering with a focus in Computer Science Reference course: CS 5200 Computer Architecture, College of EAS, UCCS Created by Prof. Xiaobo

More information

Decimal form. Fw.d Exponential form Ew.d Ew.dEe Scientific form ESw.d ESw.dEe Engineering form ENw.d ENw.dEe Lw. Horizontal

Decimal form. Fw.d Exponential form Ew.d Ew.dEe Scientific form ESw.d ESw.dEe Engineering form ENw.d ENw.dEe Lw. Horizontal Fortran Formats The tedious part of using Fortran format is to master many format edit descriptors. Each edit descriptor tells the system how to handle certain type of values or activity. Each value requires

More information

Pigeonhole Principle Solutions

Pigeonhole Principle Solutions Pigeonhole Principle Solutions 1. Show that if we take n + 1 numbers from the set {1, 2,..., 2n}, then some pair of numbers will have no factors in common. Solution: Note that consecutive numbers (such

More information

NP-Completeness and Cook s Theorem

NP-Completeness and Cook s Theorem NP-Completeness and Cook s Theorem Lecture notes for COM3412 Logic and Computation 15th January 2002 1 NP decision problems The decision problem D L for a formal language L Σ is the computational task:

More information

Increasing Interaction and Support in the Formal Languages and Automata Theory Course

Increasing Interaction and Support in the Formal Languages and Automata Theory Course Increasing Interaction and Support in the Formal Languages and Automata Theory Course Susan H. Rodger Duke University ITiCSE 2007 June 25, 2007 Supported by NSF Grant DUE 0442513. Outline Overview of JFLAP

More information

Answer: The relationship cannot be determined.

Answer: The relationship cannot be determined. Question 1 Test 2, Second QR Section (version 3) In City X, the range of the daily low temperatures during... QA: The range of the daily low temperatures in City X... QB: 30 Fahrenheit Arithmetic: Ranges

More information

Homework until Test #2

Homework until Test #2 MATH31: Number Theory Homework until Test # Philipp BRAUN Section 3.1 page 43, 1. It has been conjectured that there are infinitely many primes of the form n. Exhibit five such primes. Solution. Five such

More information

Honors Class (Foundations of) Informatics. Tom Verhoeff. Department of Mathematics & Computer Science Software Engineering & Technology

Honors Class (Foundations of) Informatics. Tom Verhoeff. Department of Mathematics & Computer Science Software Engineering & Technology Honors Class (Foundations of) Informatics Tom Verhoeff Department of Mathematics & Computer Science Software Engineering & Technology www.win.tue.nl/~wstomv/edu/hci c 2011, T. Verhoeff @ TUE.NL 1/20 Information

More information

How To Compare A Markov Algorithm To A Turing Machine

How To Compare A Markov Algorithm To A Turing Machine Markov Algorithm CHEN Yuanmi December 18, 2007 1 Abstract Markov Algorithm can be understood as a priority string rewriting system. In this short paper we give the definition of Markov algorithm and also

More information

Using Hands-On Visualizations to Teach Computer Science from Beginning Courses to Advanced Courses

Using Hands-On Visualizations to Teach Computer Science from Beginning Courses to Advanced Courses Using Hands-On Visualizations to Teach Computer Science from Beginning Courses to Advanced Courses Susan H. Rodger Department of Computer Science Duke University Durham, NC 27705 rodger@cs.duke.edu Abstract

More information

Theory of Computation Chapter 2: Turing Machines

Theory of Computation Chapter 2: Turing Machines Theory of Computation Chapter 2: Turing Machines Guan-Shieng Huang Feb. 24, 2003 Feb. 19, 2006 0-0 Turing Machine δ K 0111000a 01bb 1 Definition of TMs A Turing Machine is a quadruple M = (K, Σ, δ, s),

More information

CONTINUED FRACTIONS AND PELL S EQUATION. Contents 1. Continued Fractions 1 2. Solution to Pell s Equation 9 References 12

CONTINUED FRACTIONS AND PELL S EQUATION. Contents 1. Continued Fractions 1 2. Solution to Pell s Equation 9 References 12 CONTINUED FRACTIONS AND PELL S EQUATION SEUNG HYUN YANG Abstract. In this REU paper, I will use some important characteristics of continued fractions to give the complete set of solutions to Pell s equation.

More information

Clock Arithmetic and Modular Systems Clock Arithmetic The introduction to Chapter 4 described a mathematical system

Clock Arithmetic and Modular Systems Clock Arithmetic The introduction to Chapter 4 described a mathematical system CHAPTER Number Theory FIGURE FIGURE FIGURE Plus hours Plus hours Plus hours + = + = + = FIGURE. Clock Arithmetic and Modular Systems Clock Arithmetic The introduction to Chapter described a mathematical

More information

CS5236 Advanced Automata Theory

CS5236 Advanced Automata Theory CS5236 Advanced Automata Theory Frank Stephan Semester I, Academic Year 2012-2013 Advanced Automata Theory is a lecture which will first review the basics of formal languages and automata theory and then

More information

Implementation of Recursively Enumerable Languages using Universal Turing Machine in JFLAP

Implementation of Recursively Enumerable Languages using Universal Turing Machine in JFLAP International Journal of Information and Computation Technology. ISSN 0974-2239 Volume 4, Number 1 (2014), pp. 79-84 International Research Publications House http://www. irphouse.com /ijict.htm Implementation

More information

Discrete Mathematics and Probability Theory Fall 2009 Satish Rao, David Tse Note 2

Discrete Mathematics and Probability Theory Fall 2009 Satish Rao, David Tse Note 2 CS 70 Discrete Mathematics and Probability Theory Fall 2009 Satish Rao, David Tse Note 2 Proofs Intuitively, the concept of proof should already be familiar We all like to assert things, and few of us

More information

Diagonalization. Ahto Buldas. Lecture 3 of Complexity Theory October 8, 2009. Slides based on S.Aurora, B.Barak. Complexity Theory: A Modern Approach.

Diagonalization. Ahto Buldas. Lecture 3 of Complexity Theory October 8, 2009. Slides based on S.Aurora, B.Barak. Complexity Theory: A Modern Approach. Diagonalization Slides based on S.Aurora, B.Barak. Complexity Theory: A Modern Approach. Ahto Buldas Ahto.Buldas@ut.ee Background One basic goal in complexity theory is to separate interesting complexity

More information

Name: Class: Date: 9. The compiler ignores all comments they are there strictly for the convenience of anyone reading the program.

Name: Class: Date: 9. The compiler ignores all comments they are there strictly for the convenience of anyone reading the program. Name: Class: Date: Exam #1 - Prep True/False Indicate whether the statement is true or false. 1. Programming is the process of writing a computer program in a language that the computer can respond to

More information

Two-dimensional Languages

Two-dimensional Languages Charles University Faculty of Mathematics and Physics Mgr. Daniel Průša Two-dimensional Languages Doctoral Thesis Supervisor: Martin Plátek, CSc. Prague, 2004 Acknowledgements The results presented in

More information

k, then n = p2α 1 1 pα k

k, then n = p2α 1 1 pα k Powers of Integers An integer n is a perfect square if n = m for some integer m. Taking into account the prime factorization, if m = p α 1 1 pα k k, then n = pα 1 1 p α k k. That is, n is a perfect square

More information

Applications of Fermat s Little Theorem and Congruences

Applications of Fermat s Little Theorem and Congruences Applications of Fermat s Little Theorem and Congruences Definition: Let m be a positive integer. Then integers a and b are congruent modulo m, denoted by a b mod m, if m (a b). Example: 3 1 mod 2, 6 4

More information

Logic in Computer Science: Logic Gates

Logic in Computer Science: Logic Gates Logic in Computer Science: Logic Gates Lila Kari The University of Western Ontario Logic in Computer Science: Logic Gates CS2209, Applied Logic for Computer Science 1 / 49 Logic and bit operations Computers

More information

Working with whole numbers

Working with whole numbers 1 CHAPTER 1 Working with whole numbers In this chapter you will revise earlier work on: addition and subtraction without a calculator multiplication and division without a calculator using positive and

More information

1.4 Compound Inequalities

1.4 Compound Inequalities Section 1.4 Compound Inequalities 53 1.4 Compound Inequalities This section discusses a technique that is used to solve compound inequalities, which is a phrase that usually refers to a pair of inequalities

More information

Calculate Highest Common Factors(HCFs) & Least Common Multiples(LCMs) NA1

Calculate Highest Common Factors(HCFs) & Least Common Multiples(LCMs) NA1 Calculate Highest Common Factors(HCFs) & Least Common Multiples(LCMs) NA1 What are the multiples of 5? The multiples are in the five times table What are the factors of 90? Each of these is a pair of factors.

More information

Formal Grammars and Languages

Formal Grammars and Languages Formal Grammars and Languages Tao Jiang Department of Computer Science McMaster University Hamilton, Ontario L8S 4K1, Canada Bala Ravikumar Department of Computer Science University of Rhode Island Kingston,

More information

MATRIX ALGEBRA AND SYSTEMS OF EQUATIONS. + + x 2. x n. a 11 a 12 a 1n b 1 a 21 a 22 a 2n b 2 a 31 a 32 a 3n b 3. a m1 a m2 a mn b m

MATRIX ALGEBRA AND SYSTEMS OF EQUATIONS. + + x 2. x n. a 11 a 12 a 1n b 1 a 21 a 22 a 2n b 2 a 31 a 32 a 3n b 3. a m1 a m2 a mn b m MATRIX ALGEBRA AND SYSTEMS OF EQUATIONS 1. SYSTEMS OF EQUATIONS AND MATRICES 1.1. Representation of a linear system. The general system of m equations in n unknowns can be written a 11 x 1 + a 12 x 2 +

More information

Homework #2 Solutions

Homework #2 Solutions MAT Spring Problems Section.:, 8,, 4, 8 Section.5:,,, 4,, 6 Extra Problem # Homework # Solutions... Sketch likely solution curves through the given slope field for dy dx = x + y...8. Sketch likely solution

More information

Computer Science 281 Binary and Hexadecimal Review

Computer Science 281 Binary and Hexadecimal Review Computer Science 281 Binary and Hexadecimal Review 1 The Binary Number System Computers store everything, both instructions and data, by using many, many transistors, each of which can be in one of two

More information

Math Workshop October 2010 Fractions and Repeating Decimals

Math Workshop October 2010 Fractions and Repeating Decimals Math Workshop October 2010 Fractions and Repeating Decimals This evening we will investigate the patterns that arise when converting fractions to decimals. As an example of what we will be looking at,

More information

Today. Binary addition Representing negative numbers. Andrew H. Fagg: Embedded Real- Time Systems: Binary Arithmetic

Today. Binary addition Representing negative numbers. Andrew H. Fagg: Embedded Real- Time Systems: Binary Arithmetic Today Binary addition Representing negative numbers 2 Binary Addition Consider the following binary numbers: 0 0 1 0 0 1 1 0 0 0 1 0 1 0 1 1 How do we add these numbers? 3 Binary Addition 0 0 1 0 0 1 1

More information

0.8 Rational Expressions and Equations

0.8 Rational Expressions and Equations 96 Prerequisites 0.8 Rational Expressions and Equations We now turn our attention to rational expressions - that is, algebraic fractions - and equations which contain them. The reader is encouraged to

More information

Basic Proof Techniques

Basic Proof Techniques Basic Proof Techniques David Ferry dsf43@truman.edu September 13, 010 1 Four Fundamental Proof Techniques When one wishes to prove the statement P Q there are four fundamental approaches. This document

More information

CHAPTER 5. Number Theory. 1. Integers and Division. Discussion

CHAPTER 5. Number Theory. 1. Integers and Division. Discussion CHAPTER 5 Number Theory 1. Integers and Division 1.1. Divisibility. Definition 1.1.1. Given two integers a and b we say a divides b if there is an integer c such that b = ac. If a divides b, we write a

More information

Chapter 9. Systems of Linear Equations

Chapter 9. Systems of Linear Equations Chapter 9. Systems of Linear Equations 9.1. Solve Systems of Linear Equations by Graphing KYOTE Standards: CR 21; CA 13 In this section we discuss how to solve systems of two linear equations in two variables

More information

Composability of Infinite-State Activity Automata*

Composability of Infinite-State Activity Automata* Composability of Infinite-State Activity Automata* Zhe Dang 1, Oscar H. Ibarra 2, Jianwen Su 2 1 Washington State University, Pullman 2 University of California, Santa Barbara Presented by Prof. Hsu-Chun

More information

Chapter 3. Cartesian Products and Relations. 3.1 Cartesian Products

Chapter 3. Cartesian Products and Relations. 3.1 Cartesian Products Chapter 3 Cartesian Products and Relations The material in this chapter is the first real encounter with abstraction. Relations are very general thing they are a special type of subset. After introducing

More information

Linear Programming Notes V Problem Transformations

Linear Programming Notes V Problem Transformations Linear Programming Notes V Problem Transformations 1 Introduction Any linear programming problem can be rewritten in either of two standard forms. In the first form, the objective is to maximize, the material

More information

Properties of Stabilizing Computations

Properties of Stabilizing Computations Theory and Applications of Mathematics & Computer Science 5 (1) (2015) 71 93 Properties of Stabilizing Computations Mark Burgin a a University of California, Los Angeles 405 Hilgard Ave. Los Angeles, CA

More information

We can express this in decimal notation (in contrast to the underline notation we have been using) as follows: 9081 + 900b + 90c = 9001 + 100c + 10b

We can express this in decimal notation (in contrast to the underline notation we have been using) as follows: 9081 + 900b + 90c = 9001 + 100c + 10b In this session, we ll learn how to solve problems related to place value. This is one of the fundamental concepts in arithmetic, something every elementary and middle school mathematics teacher should

More information

PYTHAGOREAN TRIPLES KEITH CONRAD

PYTHAGOREAN TRIPLES KEITH CONRAD PYTHAGOREAN TRIPLES KEITH CONRAD 1. Introduction A Pythagorean triple is a triple of positive integers (a, b, c) where a + b = c. Examples include (3, 4, 5), (5, 1, 13), and (8, 15, 17). Below is an ancient

More information

. 0 1 10 2 100 11 1000 3 20 1 2 3 4 5 6 7 8 9

. 0 1 10 2 100 11 1000 3 20 1 2 3 4 5 6 7 8 9 Introduction The purpose of this note is to find and study a method for determining and counting all the positive integer divisors of a positive integer Let N be a given positive integer We say d is a

More information

Computing exponents modulo a number: Repeated squaring

Computing exponents modulo a number: Repeated squaring Computing exponents modulo a number: Repeated squaring How do you compute (1415) 13 mod 2537 = 2182 using just a calculator? Or how do you check that 2 340 mod 341 = 1? You can do this using the method

More information

Math 4310 Handout - Quotient Vector Spaces

Math 4310 Handout - Quotient Vector Spaces Math 4310 Handout - Quotient Vector Spaces Dan Collins The textbook defines a subspace of a vector space in Chapter 4, but it avoids ever discussing the notion of a quotient space. This is understandable

More information

NUMBER SYSTEMS. William Stallings

NUMBER SYSTEMS. William Stallings NUMBER SYSTEMS William Stallings The Decimal System... The Binary System...3 Converting between Binary and Decimal...3 Integers...4 Fractions...5 Hexadecimal Notation...6 This document available at WilliamStallings.com/StudentSupport.html

More information

The last three chapters introduced three major proof techniques: direct,

The last three chapters introduced three major proof techniques: direct, CHAPTER 7 Proving Non-Conditional Statements The last three chapters introduced three major proof techniques: direct, contrapositive and contradiction. These three techniques are used to prove statements

More information

4. How many integers between 2004 and 4002 are perfect squares?

4. How many integers between 2004 and 4002 are perfect squares? 5 is 0% of what number? What is the value of + 3 4 + 99 00? (alternating signs) 3 A frog is at the bottom of a well 0 feet deep It climbs up 3 feet every day, but slides back feet each night If it started

More information

FACTORS, PRIME NUMBERS, H.C.F. AND L.C.M.

FACTORS, PRIME NUMBERS, H.C.F. AND L.C.M. Mathematics Revision Guides Factors, Prime Numbers, H.C.F. and L.C.M. Page 1 of 16 M.K. HOME TUITION Mathematics Revision Guides Level: GCSE Higher Tier FACTORS, PRIME NUMBERS, H.C.F. AND L.C.M. Version:

More information

Settling a Question about Pythagorean Triples

Settling a Question about Pythagorean Triples Settling a Question about Pythagorean Triples TOM VERHOEFF Department of Mathematics and Computing Science Eindhoven University of Technology P.O. Box 513, 5600 MB Eindhoven, The Netherlands E-Mail address:

More information

WRITING PROOFS. Christopher Heil Georgia Institute of Technology

WRITING PROOFS. Christopher Heil Georgia Institute of Technology WRITING PROOFS Christopher Heil Georgia Institute of Technology A theorem is just a statement of fact A proof of the theorem is a logical explanation of why the theorem is true Many theorems have this

More information

1. Nondeterministically guess a solution (called a certificate) 2. Check whether the solution solves the problem (called verification)

1. Nondeterministically guess a solution (called a certificate) 2. Check whether the solution solves the problem (called verification) Some N P problems Computer scientists have studied many N P problems, that is, problems that can be solved nondeterministically in polynomial time. Traditionally complexity question are studied as languages:

More information

Solving Quadratic Equations

Solving Quadratic Equations 9.3 Solving Quadratic Equations by Using the Quadratic Formula 9.3 OBJECTIVES 1. Solve a quadratic equation by using the quadratic formula 2. Determine the nature of the solutions of a quadratic equation

More information

Fast nondeterministic recognition of context-free languages using two queues

Fast nondeterministic recognition of context-free languages using two queues Fast nondeterministic recognition of context-free languages using two queues Burton Rosenberg University of Miami Abstract We show how to accept a context-free language nondeterministically in O( n log

More information

Positional Numbering System

Positional Numbering System APPENDIX B Positional Numbering System A positional numbering system uses a set of symbols. The value that each symbol represents, however, depends on its face value and its place value, the value associated

More information

Solutions of Linear Equations in One Variable

Solutions of Linear Equations in One Variable 2. Solutions of Linear Equations in One Variable 2. OBJECTIVES. Identify a linear equation 2. Combine like terms to solve an equation We begin this chapter by considering one of the most important tools

More information