D I S C R E T E M AT H E M AT I C S H O M E W O R K

Similar documents
Notation Index. gcd(a, b) (greatest common divisor) NT-16

CSE 1400 Applied Discrete Mathematics Definitions

1. Consider the conditional E = p q r. Use de Morgan s laws to write simplified versions of the following : The negation of E : 5 points

CSC 125 :: Final Exam December 14, 2011

Math 230 Final Exam, Spring 2009

CSE 1400 Applied Discrete Mathematics Proofs

Review 3. Andreas Klappenecker

Lecture Notes on DISCRETE MATHEMATICS. Eusebius Doedel

CSCE 222 Discrete Structures for Computing. Review for the Final. Hyunyoung Lee

CS 250/251 Discrete Structures I and II Section 005 Fall/Winter Professor York

REVIEW QUESTIONS. Chapter 1: Foundations: Sets, Logic, and Algorithms

Review 1. Andreas Klappenecker

Propositional Logic, Predicates, and Equivalence

Math 230 Final Exam, Spring 2008

Packet #2: Set Theory & Predicate Calculus. Applied Discrete Mathematics

Undergraduate Notes in Mathematics. Arkansas Tech University Department of Mathematics. Introductory Notes in Discrete Mathematics Solution Guide

DISCRETE STRUCTURES AMIN WITNO

LECTURE NOTES DISCRETE MATHEMATICS. Eusebius Doedel

Foundations of Mathematics MATH 220 FALL 2017 Lecture Notes

MTH 299 In Class and Recitation Problems SUMMER 2016

Department of Computer Science University at Albany, State University of New York Solutions to Sample Discrete Mathematics Examination II (Fall 2007)

CMSC Discrete Mathematics SOLUTIONS TO FIRST MIDTERM EXAM October 18, 2005 posted Nov 2, 2005

Lecture Notes 1 Basic Concepts of Mathematics MATH 352

Discrete Structures CRN Test 3 Version 1 CMSC 2123 Autumn 2013

CS1800 Discrete Structures Final Version A

0 Sets and Induction. Sets

Discrete Structures CRN Test 3 Version 1 CMSC 2123 Spring 2011

Notes for Math 290 using Introduction to Mathematical Proofs by Charles E. Roberts, Jr.

1. Given the public RSA encryption key (e, n) = (5, 35), find the corresponding decryption key (d, n).

CSCE 222 Discrete Structures for Computing. Review for Exam 1. Dr. Hyunyoung Lee !!!

WUCT121. Discrete Mathematics. Logic. Tutorial Exercises

LECTURE NOTES DISCRETE MATHEMATICS. Eusebius Doedel

McGill University Faculty of Science. Solutions to Practice Final Examination Math 240 Discrete Structures 1. Time: 3 hours Marked out of 60

7.11 A proof involving composition Variation in terminology... 88

Packet #1: Logic & Proofs. Applied Discrete Mathematics

CSE 321 Solutions to Practice Problems

586 Index. vertex, 369 disjoint, 236 pairwise, 272, 395 disjoint sets, 236 disjunction, 33, 36 distributive laws

8. Given a rational number r, prove that there exist coprime integers p and q, with q 0, so that r = p q. . For all n N, f n = an b n 2

COMP1002 exam study sheet

CMSC Discrete Mathematics SOLUTIONS TO SECOND MIDTERM EXAM November, 2005

Math 324 Summer 2012 Elementary Number Theory Notes on Mathematical Induction

Sets. We discuss an informal (naive) set theory as needed in Computer Science. It was introduced by G. Cantor in the second half of the nineteenth

MATH 2200 Final LC Review

Discrete Math Notes. Contents. William Farmer. April 8, Overview 3

Logic. Facts (with proofs) CHAPTER 1. Definitions

All numbered readings are from Beck and Geoghegan s The art of proof.

UNIVERSITY OF CALICUT SCHOOL OF DISTANCE EDUCATION B Sc (MATHEMATICS) I Semester Core Course. FOUNDATIONS OF MATHEMATICS (MODULE I & ii) QUESTION BANK

MATH1240 Definitions and Theorems

HW MATH425/525 Lecture Notes 1

Preparing for the CS 173 (A) Fall 2018 Midterm 1

Glossary Common Core Curriculum Maps Math/Grade 9 Grade 12

Know the Well-ordering principle: Any set of positive integers which has at least one element contains a smallest element.

CSC 125 :: Final Exam May 3 & 5, 2010

Algorithms: Background

cse303 ELEMENTS OF THE THEORY OF COMPUTATION Professor Anita Wasilewska

Introduction to Number Theory

MATH 2200 Final Review

Discrete Mathematical Structures: Theory and Applications

Executive Assessment. Executive Assessment Math Review. Section 1.0, Arithmetic, includes the following topics:

Discrete Mathematics Exam File Spring Exam #1

Basic Proof Examples

Topics in Logic and Proofs

WA State Common Core Standards - Mathematics

Every subset of {1, 2,...,n 1} can be extended to a subset of {1, 2, 3,...,n} by either adding or not adding the element n.

CS Discrete Mathematics Dr. D. Manivannan (Mani)

Discrete Structures Homework 1

Problem 1: Suppose A, B, C and D are finite sets such that A B = C D and C = D. Prove or disprove: A = B.

Department of Computer Science University at Albany, State University of New York Solutions to Sample Discrete Mathematics Examination I (Spring 2008)

MATH 324 Summer 2011 Elementary Number Theory. Notes on Mathematical Induction. Recall the following axiom for the set of integers.

MATH 114 Fall 2004 Solutions to practice problems for Final Exam

MATH 363: Discrete Mathematics

Fall 2014 CMSC250/250H Midterm II

PUTNAM TRAINING NUMBER THEORY. Exercises 1. Show that the sum of two consecutive primes is never twice a prime.

Chapter 8 Sequences, Series, and Probability

Chapter 1 : The language of mathematics.

Announcements. Read Section 2.1 (Sets), 2.2 (Set Operations) and 5.1 (Mathematical Induction) Existence Proofs. Non-constructive

Sample Problems for all sections of CMSC250, Midterm 1 Fall 2014

MTH202 Discrete Mathematics

Math is Cool Championships

Copyright 2016 Pearson Education, Inc. or its affiliates. All rights reserved. NES, the NES logo, Pearson, the Pearson logo, and National Evaluation

Name (please print) Mathematics Final Examination December 14, 2005 I. (4)

Binomial Coefficient Identities/Complements

CA320 - Computability & Complexity

How well do I know the content? (scale 1 5)

Practice Midterm Exam Solutions

A Semester Course in Basic Abstract Algebra

Part IA Numbers and Sets

Part IA. Numbers and Sets. Year

West Windsor-Plainsboro Regional School District Algebra Grade 8

Informal Statement Calculus

Mat Week 8. Week 8. gcd() Mat Bases. Integers & Computers. Linear Combos. Week 8. Induction Proofs. Fall 2013

AMSCO Algebra 2. Number and Quantity. The Real Number System

Student Responsibilities Week 8. Mat Section 3.6 Integers and Algorithms. Algorithm to Find gcd()

CSE 2001: Introduction to Theory of Computation Fall Suprakash Datta

Automata Theory and Formal Grammars: Lecture 1

Module 1. Probability

AMTH140 Trimester Question 1. [8 marks] Answer

CSE 20 Discrete Math. Algebraic Rules for Propositional Formulas. Summer, July 11 (Day 2) Number Systems/Computer Arithmetic Predicate Logic

Discrete Mathematics: Midterm Test with Answers. Professor Callahan, section (A or B): Name: NetID: 30 multiple choice, 3 points each:

Generating Functions (Revised Edition)

Transcription:

D E PA R T M E N T O F C O M P U T E R S C I E N C E S C O L L E G E O F E N G I N E E R I N G F L O R I D A T E C H D I S C R E T E M AT H E M AT I C S H O M E W O R K W I L L I A M S H O A F F S P R I N G 2 0 1 3

Problems Sets 1. Boolean Logic 7 2. Sets 9 3. Predicate Logic 11 4. Sequences 13 5. Recursion 15 6. Mathematical Induction 17 7. Relations 19 8. Functions 23 9. Naming Systems 27 10. Number Systems 29 11. Number Theory 33 12. Proofs 35

4 department of computer sciences college of engineering florida tech Homework Submission Information Submit your homework using Angel drop boxes found under the Course Material tab. Homework can be submitted before the due date. Late submissions will not be accepted unless you have a written, verifiable excuse that is acceptable to the instructor. Grading Legend Problems labeled are problems that you must be able to solve to pass the course with a C or better.! are important and will be graded. are harder and cover interesting advanced material. They will not be graded. Class Calendar and Due Dates Daily Schedule Subject to Change Section 1: Monday, Wednesday and Friday class meets in Crawford 230 from 2:00 p.m. to 2:50 p.m. in Crawford 402 Monday Wednesday Friday Jan 7th 1 Introduction 9th 2 Boolean Logic 11th 3 Boolean Logic 14th 4 Boolean Logic 21st Martin Luther King Jr. Day Holiday 28th 9 Sets HW 2 Due 4th 12 Sequences Quiz 2 11th 15 Recursion 16th 5 Boolean Logic 23rd 7 Sets 30th 10 Predicate Logic 6th 13 Sequences HW 3 Due 13th 16 Recursion HW 4 Due 18th 6 Sets HW 1 Due 25th 8 Sets Quiz 1 Feb 1st 11 Predicate Logic 8th 14 Recursion 15th 17 Recursion Quiz 3

discrete mathematics homework 5 18th Presidents Day Monday Wednesday Friday 20th 18 22nd 19 Induction Induction HW 5 Due 25th 20 Induction 4th Spring Break 27th 21 Induction 6th Spring Break Mar 1st 22 Induction HW 6 Due Midterm 8th Spring Break 11th 23 Relations 13th 24 Functions 15th Last Day to Withdraw 18th 25 Functions 25th 28 Functions Quiz 4 Apr 1st 31 Numbers 8th 34 Numbers Quiz 5 15th 37 Number Theory 22nd 40 Proofs 29th 42 Review 20th 26 Relations HW 7 Due 27th 29 Functions 3rd 32 Numbers HW 8 Due 10th 35 Number Theory HW 9 Due 17th 38 Number Theory HW 10 Due 24th 41 Proofs HW 11 Due May 1st Final Exam 8:00-10:00 a.m. 22nd 27 Functions 29th 30 Naming Systems 5th 33 Numbers 12th 36 Number Theory 19th 39 Proofs Quiz 6 26th Study Day 3rd 43

1. Boolean Logic Boolean logic is the study of propositions that are True or False but not both. 1. How many truth assignments are there from n Boolean variables to {True, False}? 2. State both of DeMorgan s laws and use them to re-write the Boolean conditions below. (a) ((n = 0) (a < b)) (b) (x > 2) (y = 1) 3. Prove that modus ponens is valid (a tautology). That is, prove p (p q) q is always True. 4. Prove that (p q) p is satisfiable (a contingency). That is, prove there is a truth assignment for p and q that makes the expression True. 5. Prove that (p q r) (p q) (q r) (r p) ( p q r) is unsatisfiable (a contradiction). That is, prove there is no truth assignment for p, q, and r that makes the expression True. 6. Construct a truth table for the Boolean expression ((p q) r) (p (q r))

8 discrete mathematics homework Is the equivalence True or False? Explain your answer. Replacing (p q) r with p (q r) is called Currying after Haskell Curry. 7. There are two Boolean expressions with no variables: True and False. (a) List four different one-variable Boolean expressions. (b) List sixteen different two-variable Boolean expressions. Truth tables is one way to list the 16 Boolean expressions. 8. Make a conjecture about how many Boolean formulas can be constructed using T ( ), AND ( ), and OR ( ) operations on n Boolean variables.

2. Sets A set is an unordered collection of objects that satisfy a well-defined predicate statement. 1. Draw diagrams for the following sets. (Note you should shade in the indicated set) (a) A (b) A (c) A B (d) A B (e) A B (f) A B (g) (C A) B 2. Draw diagrams that represent the following conditions. (Note you should shade in the indicated set) (a) A B = (b) A B = (c) A B (d) (A B) (C B = ) (A C = ) 3. List all subsets of the following sets. (a) (b) {0} (c) {0, 1} (d) {0, 1, 2} 4. How many subsets are there of a set with n elements? 5. Evaluate the following binomial coefficients. (a) ( 7 3 )

10 discrete mathematics homework (b) ( 9 5 ) 6. With respect to sets and subsets, what is the meaning of the binomial coefficient ( n k )? 7.! Make a hypothesis about the maximum number of sets that can be constructed using complement, intersection and union on a collection of n sets all lying in a universal set U.

3. Predicate Logic Predicate (first order) logic is the study of the truth of statements that involve variables. Predicate statements are usually quantified: ( x)(p(x)) for all x, p(x) (is True) ( x)(p(x)) for some x, p(x) (is True) (!x)(p(x)) for exactly one x, p(x) (is True) 1. A function f from X to Y is a subset of order pairs (x, y) such that x X and y Y subject to the following condition: for every x in X there is exactly one element y in Y such that the ordered pair (x, y) is contained in the subset defining the function f. Write the quoted statement using the quantifiers of predicate logic. 2. A function f (x) = y is one-to-one if for every y there is at most one x such that f (x) = y. Write the quoted statement using the quantifiers of predicate logic. 3. A function f (x) = y is onto if for every y there is an x such that f (x) = y. Write the quoted statement using the symbols quantifiers of predicate logic. 4. Let x < y be the predicate statement that x is less than y for integers x and y. The two quantified statements below have different meanings. Explain why they are different. (a) ( x)( y)(x < y) (b) ( y)( x)(x < y) 5. Let Answers(s, q) be the predicate statement.

12 discrete mathematics homework student s answers question q correctly The two quantified statements below have different meanings. Explain why they are different. (a) ( q)( s)(answers(s, q)) (b) ( s)( q)(answers(s, q)) 6.! Let f and g be functions on the natural numbers. Write the statement there exists a positive constant c and a natural number N such that f (n) is less than or equal to c times g(n) for all n greater than or equal to N. This is the definition of the statement that f is big-o of g. 7.! Write the statement if for every number ɛ > 0, there exists a corresponding number δ > 0 such that for all x = x 0 within a distance δ of x 0 the value of the function f at x is within a distance ɛ of L. This is the definition of the calculus concept that the limit of f as x approaches x 0 is L. lim f (x) = L x x 0

4. Sequences A sequence is an ordered collection of objects. 1. In arithmetic sequences successive terms are incremented by a constant value. (a) The sequence of natural numbers, N = 0, 1, 2, 3, 4,..., is the prototypical arithmetic sequence. What function enumerates the terms in N? (b) The sequence A = 3, 2, 7, 12, 17,... is also arithmetic. What function enumerates the terms in A? (c) If the terms of a sequence are given by the function f (n) = mn + b for n = 0, 1, 2, 3,... show the sequence is arithmetic, that is, successive term are incremented by a constant. What is that constant? 2. In geometric sequences successive terms are multiplied by a constant value. (a) The sequence of powers of 2, 2 = 1, 2, 4, 8, 16,..., is the prototypical geometric sequence. What function enumerates the terms in 2? (b) The sequence G = 3, 6, 12, 24, 48,... is also geometric. What function enumerates the terms in G? (c) If the terms of a sequence are given by the function f (n) = ar n, r = 1 for n = 0, 1, 2, 3,... show the sequence is geometric, that is, successive term are multiplied by a constant. What is that constant? 3. The sequence of partial sums of arithmetic and geometric sequences are also important. (a) What sequence is generated by the sum 0 + 1 + 2 +... + (n 1) for n = 1, 2, 3,...?

14 discrete mathematics homework That is, what name is given to the sequence and what is a function that enumerates terms in this sequence of partial sums (or what recurrence equation and initial condition enumerates the partial sums?) (b)! What sequence is generated by the sum b + (m + b) + (2m + b) +... + ((n 1)m + b) for n = 1, 2, 3,...? That is, what is a function that enumerates terms in this sequence of partial sums (or what recurrence equation and initial condition enumerates the partial sums?) (c) What sequence is generated by the sum 1 + 2 + 2 2... + 2 n 1 for n = 1, 2, 3,...? That is, what name is given to the sequence and what is a function that enumerates terms in this sequence of partial sums (or what recurrence equation and initial condition enumerates the partial sums?) (d)! What sequence is generated by the sum a + ar + ar 2 +... + ar n 1 for r = 1 and n = 1, 2, 3,...? That is, what is a function that enumerates terms in this sequence of partial sums (or what recurrence equation and initial condition enumerates the partial sums?) 4.! Define the Tribonacci numbers by T 0 = 0, T 1 = 1, T 2 = 1 and the recurrence equation T n = T n 1 + T n 2 + T n 3 for n 3. (a) Use the recurrence equation to compute T 3, T 4, T 5, and T 6. (b) What initial conditions and recurrence equation define the Tetranacci numbers?

5. Recursion 1. The ability to sum natural numbers and sum of powers of 2 are basic. (a) Show that the triangular numbers t(n) = n(n 1)/2 = ( n 2 ) satisfy the recurrence equation t n = t n 1 + (n 1) and initial condition t 0 = 0 (b) Show that the Mersenne numbers m(n) = 2 n 1 satisfy the recurrence equation m n = 2m n 1 + 1 and initial condition m 0 = 0 2. Let A = a0, a 1, a 2,..., a n 1,... be a sequence. Let n 1 S = 0, a 0, a 0 + a 1, a 0 + a 1 + a 2,..., a k,... k=0 = s 0, s 1, s 2,..., s n 1,... be the sequence of partial sums of terms in A: s0 is the sum of no terms of A, s1 is the sum of the first term of A, s2 is the sum of the first 2 terms of A, etc. Show that terms in S satisfy the recurrence equation s k = s k 1 + a k 1, k 1 with initial condition s 0 = 0. 3.! Let F = 0, 1, 1, 2, 3, 5,..., Fn,... be the Fibonacci sequence. Show that a n recurrence equation = F n + 2 n solves the a n = 3a n 1 a n 2 2a n 3, n 3

16 discrete mathematics homework 4.! A partition of a positive integer n is a collection of positive integers whose sum is n. The integers in a partition are called parts. Denote by p(n, k) the number of partitions of n into exactly k parts. For example, p(5, 1) = 1 (5) p(5, 2) = 2 (4 + 1, 3 + 2) p(5, 3) = 2 (3 + 1 + 1, 2 + 2 + 1) p(5, 4) = 1 (2 + 1 + 1 + 1) p(5, 5) = 1 (1 + 1 + 1 + 1 + 1) The order of the parts is unimportant. A recursion formula for p(n, k) is p(1, 1) = 1 p(n, k) = 0 when n < k or k = 0 p(n, k) = p(n 1, k 1) + p(n k, k) when n 2 and 1 k n Use the recursion formula to fill in the row 0 through 9 of the partition triangle. 0 0 1 0 2 0 3 0 n 4 0 5 0 6 0 7 0 8 0 9 0 Partition numbers p(n, k) k 0 1 2 3 4 5 6 7 8 9

6. Mathematical Induction The Ideas Behind Mathematical Induction Let S(n) be a predicate statement about an integer n. Pretend you can prove 1. S(m) is True for some integer m 2. If S(m) is True for some integer m, then S(m + 1) is also True The principle of mathematical induction allow you to conclude that S(n) is True for all integers n m Problems 1. Show that the sum of the first n natural numbers equals n(n 1)/2, that is, n 1 n(n 1) k = 2 k=0 2.! An arithmetic sequence has the form b, m + b, m + b, 2m + b, 3m + b,..., (n 1)m + b,... where b is the y-intercept and m is the slope. Prove that the sum of the first n terms of an arithmetic sequence is n times the average of the first and last terms, that is, prove n 1 k=0 (km + b) = n b + [(n 1)m + b] 2 3. Show that the sum of the first n powers of 2 equals 2 n 1, that is, n 1 2 k = 2 n 1 k=0

18 discrete mathematics homework 4.! A geometric sequence has the form b, br, br 2, br 3, br 4,..., br n 1,... where b is the y-intercept and r = 1 is the growth factor. Prove that the sum of the first n terms of an geometric sequence is r times the last term minus the first term, all divided by r 1, that is, prove n 1 br k = brn b r 1 k=0 5. Show that the sum of binomial coefficients in row labeled n in Pascal s triangle is equal to 2 n. 6.! If you invest (pay) a dollars every period (month) for n periods and earn (pay) r percent each period, how long will it take to earn (pay off) P dollars? 7.! Show that the number of possible totals formed by rolling n 1 dice is 5n + 1. A die is a cube with six faces with 1, 2, 3, 4, 5, or 6 dots on a face.

7. Relations A (binary) relation is a set of ordered pairs {(x, y) : x y} where is a relational symbol. Some common relations are Equals (x = y) Less than (x < y) divides (x y) congruence mod n (x y (mod n)) equivalence (p q) subset (X Y) Two important types of relations are equivalences and partial orders: Equivalence relations are reflexive ( x)(x x), symmetric ( x, y)(x y y x), and transitive ( x, y, z)((x y) (y z) x z). Partial orders are reflexive, transitive, and antisymmetric or by contraposition ( x, y)((x y) (y x) x = y) ( x, y)(x = y (x y) (y x)) 1. Prove that congruence mod n is an equivalence relation on the integers. 2. Let B be the set of Boolean formulas on the Boolean variables p, q, and r. Prove that equivalence on formulas in B is an equivalence relation.

20 discrete mathematics homework 3. Prove that divides is a partial order on the natural numbers. 4.! Consider the punctured plane R R {(0, 0)} = {(x, y) : x R, y R (x, y) = (0, 0)} Say two points (a, b) and (c, d) are projectionally related if ad = bc. Show that this is an an equivalence relation. 5.! A candy machine takes nickels, dimes and quarters. When 50 is deposited a candy bar is dispensed along with change if necessary. The diagram below shows the transitions from state-tostate as money is put in the machine. (a, b) (c, d) The punctured plane with two related points. 25 25 25 0 5 5 10 5 10 10 5 10 15 5 20 10 5 10 25 5 30 10 10 5 25 5 35 25 40 10 5 25 10 25 45 5 10 25 50 25 25 (a) Say that two paths p 0 and p 1 in the transition graph are path equivalent they start in the same state and end in the same state. For example, path p 0 = 0 10 20 is equivalent to path p 1 = 0 5 10 15 20: Both start in state 0 and both end in state 20. Prove path equivalence is an equivalence relation. (b) Say state s precedes state t if there is a path from s to t. (Include trivial paths from a state to itself, so that state s precedes itself). Prove precedes this is a partial order. 6.! Let F = : N N be the set of function from the natural numbers to the natural numbers. For f, g F write f = O(g) if there exists a positive constant c and a natural number N such that f (n) cg(n) n N This is called the big-o relation. Show that big-o is reflexive and transitive.

7.! With respect to partitions, what is the meaning of the Stirling number of the second kind { n k }? 7. relations 21

8. Functions Functions are deterministic relations: Given an input value the output value is uniquely determined. f : X Y is a function if ( x X)(!y Y)( f (x) = y) Basic Problems on Functions 1. Let f : R R be a function from the real numbers to the real numbers. Which of the following functions f are onto? (a) f (x) = 3x + 1 (b) f (x) = x 2 x 1 2. Let f : X Y be a function. Write a quantified predicate statement that says f is onto. 3. Let f : R R be a function from the real numbers to the real numbers. Which of the following functions f are one-to-one? (a) f (x) = 3x + 1 (b) f (x) = x 2 x 1 4. Let f : X Y be a function. Write a quantified predicate statement that says f is one-to-one. 5. Compute the inverse function f 1 (x) for the following functions or explain why the inverse does not exist. (a) f (x) = 3x + 1 (b) f (x) = x 2 x 1 6. Let f (x) = 3x + 1 and g(x) = x 2 x 1. What is the composite function below? (a) f (g(x)) (b) g( f (x))

24 discrete mathematics homework Problems on Polynomials Polynomials are an important class of functions. One reason for their importance is that every continuous function on a closed bounded interval can be approximated arbitrarily well by a polynomial. 1. What are the roots (zeros) of the following polynomial equations. (a) x 2 x 1 = 0 (b) 3x 2 7x + 2 = 0 2. Use mathematical induction to show that (x 1)(x n 1 + x n 2 + + x 2 + x + 1) = x n 1 3. Use Horner s rule to evaluate the following polynomials at the given value of x. (a) p(x) = 3x 4 5x 2 16x 4 at x = 3. (b) p(x) = 2x 4 3x 3 + 2x 2 + 4x 3 at x = 3. (c) p(x) = x 5 2x 3 + 3x 2 1 at x = 2. Problems on Logarithms 1.! The information content I(x) of an event x that occurs with probability 0 < p 1 is defined to be I(x) = lg 1/p = lg p bits. The average information content, or entropy, of a sequence S of events x 0, x 1, x 2,..., x n 1 with corresponding probabilities p 0, p 1, p 2,..., p n 1 is defined to be n 1 H( S) = p k lg p k k=0 (a) When flipping a fair coin the probability of heads is p H = 0.5 and probability of a tails is p T = 0.5. What is the information content of flipping a single heads? What is the entropy of flipping the sequence heads, tails, heads?

8. functions 25 (b) When tossing a pair of fair dice the probability of rolling a total of 2 is p 2 = 1/36, and the probability of rolling a total of 7 is p 7 = 6/36 = 1/6, and the probability of rolling a total of 11 is p 11 = 2/36 = 1/18. What is the information content of rolling a total of 2? A 7? An 11? What is the entropy of rolling the sequence of totals 2, 7, 11? Problems on Integer Functions Some integer function maps a real number to an integer; others map integers to integers. 1. The floor and ceiling functions compute the integers that bound a read number. Compute the following floors and ceilings. (a) π (b) π (c) e (d) e (e) ϕ e 2.718281, Euler s or Napier s constant. ϕ is the golden ratio (1 + 5)/2. ϕ = (1 5)/2 is the conjugate of ϕ. 2. The mod n function maps an integer to Z n = {0, 1,..., (n 1)}. Compute following values. (a) 73 mod 37 (b) 73 mod 37 (c) 37 mod 17 (d) 37 mod 17 3.! Prove the following. (a) x = x (b) x = x Problems on Permutations To permute is to arrange. A permutation is a function that arranges (or rearranges) the elements of a set. 1. How many permutations are there on the following number of distinct objects.

26 discrete mathematics homework (a) 5 (b) n 2. Using cyclic notation write the permutation of 1, 2, 3, 4, 5, 6, 7, 8, 9 that produces the sequence 2, 4, 6, 8, 1, 3, 5, 7, 9. 3. What permutation of 1, 2, 3, 4, 5, 6, 7, 8, 9 is described by the cyclic notation [1, 2, 3][4, 5, 6][7][8, 9]? 4.! With respect to permutations, what is the meaning of the Stirling number of the first kind [ n k ]?

9. Naming Systems And out of the ground the Lord God formed every beast of the field, and every fowl of the air; and brought them unto Adam to see what he would call them: and whatsoever Adam called every living creature, that was the name thereof. Genesis 2:19, King James Version of the Bible 1. Consider the following alphabets (a) Lower case English letters (b) Deoxyribonucleic acids (c) Proteins E = {a, b, c,..., z} DNA = {A, C, G, T} PRO = {A, C, D, E, F, G, H, I, K, L, M, N, P, Q, R, S, T, V, W, Y, B, Z, X} For each alphabet answer the following questions. (a) How many strings of length 0 are there? (b) How many strings of length 8 are there? (c) How many strings of length 0 or 1 or 2 or... n 1 are there? 2. What is the function that maps the cardinality of the alphabet and the length of strings to the number of strings. That is, what is the formula for f (a, n) = m where a = A is the size of the alphabet A, n is length of strings, and m is the number of strings of length n over A? 3. For the given alphabet, how long must strings be in order to name the given number of objects. (a) The alphabet is B and the string lengths are 7, 8, 63, 64, and m objects.

28 discrete mathematics homework (b) The alphabet is D and the string lengths are 9, 10, 50, 101, and m objects. (c) The alphabet is H and the string lengthe are 15, 16, 255, 256, and m objects. 4. What is the function that maps the cardinality of the alphabet and the number of objects to be named to length of strings needed to name these objects. That is, what is the formula for g(a, m) = n where a = A is the size of the alphabet A, m number of objects to be named, and n is the length of strings used to name these m objects.

10. Number Systems Problems on Unsigned Integers (Natural Numbers) 1. Use repeated remaindering to convert the following unsigned decimal numbers into the indicated base. (a) 73 to binary (b) 173 to binary (c) 173 to hexadecimal (d) 173 to octal 2. Use Horner s rule to convert the following unsigned numbers, written in the indicated base, to decimal notation (a) (1001 1001) 2 (b) (0101 1111) 2 (c) (1101 1011) 2 (d) (0001 1011) 2 3. I got this one from Click & Clack. Given $1000 ins $1 dollar bills and 10 envelops, distribute the money among the envelops so that you can make any amount from $1 to $1000. Problems on Signed Integers Signed integers can be represented in many ways: Signed-magnitude, one s complement, two s complement, and biased notation are a few possibilities. Two s complement and biased notation are useful in computing.

30 discrete mathematics homework Problems on Complement Notation 1. Write the following signed decimal numbers in two s complement notation. (a) 73 (b) 73 (c) 64 (d) 64 (e) 173 (f) 173 2. Write the following two s complement numbers in signed decimal notation. (a) (1001 1001) 2c (b) (0101 1111) 2c (c) (1101 1011) 2c (d) (0001 1011) 2c Problems on Biased Notation 1. Convert the following signed integers from decimal to biased notation. (a) 13 with bias b = 32. (b) 134 with bias b = 256. (c) 145 with bias b = 256. (d) 257 with bias b = 512. 2. Convert the following biased numbers to decimal signed integers. (a) (18) bias=16 (b) (7) bias=16 (c) (45) bias=32 (d) (45) bias=128

10. number systems 31 Problems on Floating Point Numbers 1. The following binary strings are normalized floating point numbers where the first (leftmost) bit is the sign bit, the next 5 bits are exponent bits written in biased notation with bias b = 16, and the last 6 bits are fraction bits. What decimal values do these floating point numbers represent? (a) 1 00100 100001 (b) 0 10100 111000 2. Using 1 sign bit, 3 exponent bits, and 4 fraction bits to write normalized floating point numbers explain why 17/128 is the smallest positive floating point number and why 1/8 = 16/128 is not.

11. Number Theory (This set of problems in incomplete) Problems on Prime Numbers Sheldon Cooper says 73 is the best prime number. It is the 21 st prime. It s reverse 37 is the 12 th prime. The prime factors of 21 are 7 and 3. Written in binary, 73 is the palindrome 1001001. 1. List the prime numbers that are less than or equal to 73. 2. 3. Prove that there are infinitely many prime numbers p such that p + 2 is also prime. Prove that every even integer greater than 4 is the sum of two odd prime numbers. Problems on the Integers Mod n 1. Let a b (mod n) and c d (mod n). Prove that a + c b + d (mod n) and ac bd (mod n). 2. Let g = gcd(59, 135). Use the Euclidean algorithm to compute g, then express g as a linear combination of 59 and 135. 3. Solve the linear congruence equation 59x 3 (mod 135) 4. Let g = gcd(826, 1890). Use the Euclidean algorithm to compute g, then express g as a linear combination of 826 and 1890.

34 discrete mathematics homework 5.! Solve the linear congruence equation 6. 826x 3 (mod 1890) (Fermat s Little Theorem) Prove that if p is a prime and a an integer relatively prime to p, then a p 1 1 (mod p)

12. Proofs (This set of problems in incomplete) Trivial and Vacuous Proofs 1. Prove that the empty set is a subset of any set. 2. Prove that the any set A is a subset of the univeral set. Direct Proofs 1. Let a be an integer. Prove that if a 2 is a multiple of 3 then a is multiple of 3. Proofs by Contradiction 1. Prove that 3 is irrational.