MACM 101 Discrete Mathematics I



Similar documents
Automata and Formal Languages

Today s Topics. Primes & Greatest Common Divisors

SOLUTIONS FOR PROBLEM SET 2

z 0 and y even had the form

Chapter 3. if 2 a i then location: = i. Page 40

Primes. Name Period Number Theory

MATHEMATICAL INDUCTION. Mathematical Induction. This is a powerful method to prove properties of positive integers.

Elementary Number Theory and Methods of Proof. CSE 215, Foundations of Computer Science Stony Brook University

= = 3 4, Now assume that P (k) is true for some fixed k 2. This means that

Positional Numbering System

Math Review. for the Quantitative Reasoning Measure of the GRE revised General Test

Math Workshop October 2010 Fractions and Repeating Decimals

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

Reading 13 : Finite State Automata and Regular Expressions

Number of Divisors. Terms. Factors, prime factorization, exponents, Materials. Transparencies Activity Sheets Calculators

PROBLEM SET 6: POLYNOMIALS

Kevin James. MTHSC 412 Section 2.4 Prime Factors and Greatest Comm

CONTINUED FRACTIONS AND FACTORING. Niels Lauritzen

Continued Fractions and the Euclidean Algorithm

6.1 The Greatest Common Factor; Factoring by Grouping

FACTORING LARGE NUMBERS, A GREAT WAY TO SPEND A BIRTHDAY

8 Divisibility and prime numbers

Warm up. Connect these nine dots with only four straight lines without lifting your pencil from the paper.

Math 55: Discrete Mathematics

FACTORS AND MULTIPLES Answer Key

5-1 NUMBER THEORY: DIVISIBILITY; PRIME & COMPOSITE NUMBERS 210 f8

CS103B Handout 17 Winter 2007 February 26, 2007 Languages and Regular Expressions

Math 319 Problem Set #3 Solution 21 February 2002

Breaking The Code. Ryan Lowe. Ryan Lowe is currently a Ball State senior with a double major in Computer Science and Mathematics and

Computing exponents modulo a number: Repeated squaring

A Prime Investigation with 7, 11, and 13

CS 103X: Discrete Structures Homework Assignment 3 Solutions

GREATEST COMMON DIVISOR

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

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

Homework until Test #2

Pre-Calculus II Factoring and Operations on Polynomials

Number Theory Hungarian Style. Cameron Byerley s interpretation of Csaba Szabó s lectures

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

Section IV.1: Recursive Algorithms and Recursion Trees

How To Know If A Domain Is Unique In An Octempo (Euclidean) Or Not (Ecl)

If A is divided by B the result is 2/3. If B is divided by C the result is 4/7. What is the result if A is divided by C?

CSC4510 AUTOMATA 2.1 Finite Automata: Examples and D efinitions Definitions

11 Ideals Revisiting Z

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

Primes in Sequences. Lee 1. By: Jae Young Lee. Project for MA 341 (Number Theory) Boston University Summer Term I 2009 Instructor: Kalin Kostadinov

WOLLONGONG COLLEGE AUSTRALIA. Diploma in Information Technology

s = s = s =

Previously, you learned the names of the parts of a multiplication problem. 1. a. 6 2 = 12 6 and 2 are the. b. 12 is the

Copy in your notebook: Add an example of each term with the symbols used in algebra 2 if there are any.

Factoring Polynomials

6.2 Permutations continued

Lecture 8: Binary Multiplication & Division

The Euclidean Algorithm

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

Math 55: Discrete Mathematics

Some facts about polynomials modulo m (Full proof of the Fingerprinting Theorem)

Regular Languages and Finite State Machines

8 Primes and Modular Arithmetic

Some Polynomial Theorems. John Kennedy Mathematics Department Santa Monica College 1900 Pico Blvd. Santa Monica, CA

Welcome to Math Video Lessons. Stanley Ocken. Department of Mathematics The City College of New York Fall 2013

Discrete Mathematics, Chapter 4: Number Theory and Cryptography

Grade 6 Math Circles March 10/11, 2015 Prime Time Solutions

3. Convert a number from one number system to another

SUBGROUPS OF CYCLIC GROUPS. 1. Introduction In a group G, we denote the (cyclic) group of powers of some g G by

Mathematics for Computer Science/Software Engineering. Notes for the course MSM1F3 Dr. R. A. Wilson

THEORY of COMPUTATION

Chapter 4, Arithmetic in F [x] Polynomial arithmetic and the division algorithm.

CMPSCI 250: Introduction to Computation. Lecture #19: Regular Expressions and Their Languages David Mix Barrington 11 April 2013

Number Theory. Proof. Suppose otherwise. Then there would be a finite number n of primes, which we may

PROPERTIES OF ELLIPTIC CURVES AND THEIR USE IN FACTORING LARGE NUMBERS

Prime Factorization, Greatest Common Factor (GCF), and Least Common Multiple (LCM)

Lecture 13 - Basic Number Theory.

Automata Theory. Şubat 2006 Tuğrul Yılmaz Ankara Üniversitesi

U.C. Berkeley CS276: Cryptography Handout 0.1 Luca Trevisan January, Notes on Algebra

Computer and Network Security

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

Grade 6 Math Circles. Binary and Beyond

ALGEBRAIC APPROACH TO COMPOSITE INTEGER FACTORIZATION

On the generation of elliptic curves with 16 rational torsion points by Pythagorean triples

The Mathematics of the RSA Public-Key Cryptosystem

An Efficient RNS to Binary Converter Using the Moduli Set {2n + 1, 2n, 2n 1}

The Factor Theorem and a corollary of the Fundamental Theorem of Algebra

FACTORING OUT COMMON FACTORS

Factoring & Primality

Combinatorial Proofs

How To Compare A Markov Algorithm To A Turing Machine

Sequential Skills. Strands and Major Topics

Working with whole numbers

Multiplying and Dividing Fractions

An Introductory Course in Elementary Number Theory. Wissam Raji

Chapter 4 -- Decimals

SQUARE-SQUARE ROOT AND CUBE-CUBE ROOT

AIP Factoring Practice/Help

Grade 7 & 8 Math Circles October 19, 2011 Prime Numbers

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

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

A Second Course in Mathematics Concepts for Elementary Teachers: Theory, Problems, and Solutions

MATH 22. THE FUNDAMENTAL THEOREM of ARITHMETIC. Lecture R: 10/30/2003

Computer Science 281 Binary and Hexadecimal Review

Transcription:

MACM 101 Discrete Mathematics I Exercises on Combinatorics, Probability, Languages and Integers. Due: Tuesday, November 2th (at the beginning of the class) Reminder: the work you submit must be your own. Any collaboration and consulting outside resourses must be explicitely mentioned on your submission. Please, use a pen. 30 points will be taken off for pencil written work. 1. How many bit strings of length 10 contain at least three 1s and at least three 0s. s A string contains less than 3 ones if it contains no ones (1 string), exactly one 1 (10 strings) and exactly 2 ones ( ( ) 10 2 = 10 9/2 strings). There is the same number of strings that contain less than 3 zeros. There are 2 10 strings of length 10. So the answer is 2 10 2(10 9/2 + 10 + 1). 2. A five-card poker hand is a collection of five different cards that are selected from all 2 cards. 1) What is the probability that a five-card poker hand contains exactly one ace? 2) What is the probability that a five-card poker hand contains at least one ace? 1) We pick and ace and then other cards so there are: ( ) 8 1

poker hands like that. Thus probability to get such hand is (8 ) ( 2 ). 2) There are ( ) 8 hands NOT like that. So the probability is ( 8 ) 1 ( 2 ). 3. Let L 1 = {aaaa}, L 2 = {a, b}{a, b}{a, b}{a, b}{a, b}{a, b}, and L 3 = L 2. Describe strings in the language L 1 L 3. A string is in L 1 if it consists of as and its length is divisible by. A string is in L 2 if its length is divisible by 6. Thus a string is in L 1 L 3 if it consists of as and its length is divisible by both 6 and. We know that the latter is the case if the length is divisible by lcm(6, ) = 12. Thus L 1 L 3 = {aaaaaaaaaaaa}.. Give a regular expression that represents the language of strings over {a, b, c}, in which the number of a s is divisible by four. ({b, c} a)({b, c} a)({b, c} a)({b, c} a){b, c}.. A palindrome is a string that reads the same backward as it does forward, that is, a string w where w = w R, where w R is reversal of the string w. Find a grammar that generates the set of all palindromes over the alphabet {0, 1}. The grammar is similar to the grammar generating the language of properly placed parentheses: 2

S 0S0 S 1S1 S 0 S 1 S λ. Any string that can be obtained from S is a palindrome (possibly containing S in the middle). Proof by induction: Base step: S is a palindrome. Done. Inductive step: If we apply any of the rules the string remains a palindrome. QED. 6. Build a finite automaton that accepts the language of all strings over {1, 2, 3} such that the sum of all digits is divisible by seven. The automaton has seven states s 0,..., s 6. The only accepting state is s 0. The transition function works as follows: v(s k, d) = s r, where r is the remainder of division of k + d by 7. After reading string w the automaton is at state s r, where r is the remainder of the division of sum of the digits in w by 7. Proof by induction: Base step: Initially it s in s 0 and the sum of the digits in the empty string is 0. Inductive step: Let w = wd. Once the automaton has read w it s in the state s r. Then after reading w it will be in the state s r mod7 where r is the remainder of division of r + d by 7. Let x be the sum of the digits in w, the sum of the digits in w equals x + d = 7q + r + d = 7q + 7q + r = 7(q + q ) + r, and thus r is the remainder of division of x + d by 7. QED. Therefore the automaton accepts the word w if and only if the sum of digits in w is divisible by 7 with remainder 0, i.e. just divisible by 7. 3

7. Prove that for every positive n, there are n consecutive composite integers. Consider (n + 1)! + k, where k {2,..., n, n + 1}. (n + 1)! is divisible by k and k is divisible by k, thus (n + 1)! + k is divisible by k. So for any n numbers {n! + 2,..., (n + 1)! + n + 1} are composite. 8. Convert 322 from its decimal expansion to its hexadicimal expansion. Dividing 232 by 16 with remainder repeatedly we get: 322 = + 16 ( 0 + 16 ( 0 + 16 * 13)). So 322 = D00. 9. Use the Euclidean algorithm to find the greatest common divisor d of 129 and 1038. Find integer numbers u and v such that d = 129u + 1038v. (Note and use the fact that when you divide r k by r k+1 with remainder you get u and v such that r k+2 = u r k + v r k+1.) 1308 = 129 9 + 7 129 = 7 2 + 3 7 = 3 + 112 3 = 3 112 + 99 112 = 99 + 13 99 = 13 7 + 8 13 = 8 + 8 = + 3 = 3 + 2 3 = 2 + 1

Thus the least common divisor is 1 and we have: 1 = 3 2 = 2 3 = 2 8 3 = 8 3 13 = 99 38 13 = 3 99 38 113 = 3 3 167 112 = 210 3 167 7 = 210 129 87 7 = 93 129 87 1308. 10. Find the prime factorization of numbers 92928 and 1232, and their least common multiple. Trying to divide these numbers by small primes we luckily get: 92928 = 2 8 3 11 2, 1232 = 2 3 3 11 13. Thus the least common multiple is 2 8 3 3 11 2 13.