CS220/MATH320 Applied Discrete Math Fall 2018 Instructor: Marc Pomplun. Assignment #3. Sample Solutions

Similar documents
Chapter 2 (Part 3): The Fundamentals: Algorithms, the Integers & Matrices. Integers & Algorithms (2.5)

CS 320L Applied Discrete Mathematics Spring 2018 Instructor: Marc Pomplun. Assignment #2

Fall 2017 Test II review problems

The 2nd Texas A&M at Galveston Mathematics Olympiad. September 24, Problems & Solutions

MATH Dr. Halimah Alshehri Dr. Halimah Alshehri

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

Week No. 06: Numbering Systems

Definition: Let f(x) be a function of one variable with continuous derivatives of all orders at a the point x 0, then the series.

Problem Points Score Total 100

Grade 5 Large Numbers

Lab on Taylor Polynomials. This Lab is accompanied by an Answer Sheet that you are to complete and turn in to your instructor.

Decimal Addition: Remember to line up the decimals before adding. Bring the decimal straight down in your answer.

Remainders. We learned how to multiply and divide in elementary

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

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

RATIONAL FUNCTIONS. Finding Asymptotes..347 The Domain Finding Intercepts Graphing Rational Functions

Homework #2 solutions Due: June 15, 2012

Exam 2 Review Chapters 4-5

Part I, Number Systems. CS131 Mathematics for Computer Scientists II Note 1 INTEGERS

2.5 정수와알고리즘 (Integers and Algorithms)

PROBLEM SET 1 SOLUTIONS 1287 = , 403 = , 78 = 13 6.

Base-b representations of integers. (b 진법표현 ) Algorithms for computer arithmetic: Euclidean algorithm for finding GCD s.

then the hard copy will not be correct whenever your instructor modifies the assignments.

Grade 10 Arithmetic Progressions

The Euclidean Algorithm

cse 311: foundations of computing Fall 2015 Lecture 12: Primes, GCD, applications

CSE 20 DISCRETE MATH. Winter

Review of Prerequisite Skills for Unit # 2 (Derivatives) U2L2: Sec.2.1 The Derivative Function

! " k x 2k$1 # $ k x 2k. " # p $ 1! px! p " p 1 # !"#$%&'"()'*"+$",&-('./&-/. !"#$%&'()"*#%+!'",' -./#")'.,&'+.0#.1)2,'!%)2%! !"#$%&'"%(")*$+&#,*$,#

ENGIN 112 Intro to Electrical and Computer Engineering

COT 3100 Applications of Discrete Structures Dr. Michael P. Frank

Discrete Mathematics GCD, LCM, RSA Algorithm

Quantitative Aptitude

1 Computing System 2. 2 Data Representation Number Systems 22

Computer Science B Homework #2 Due Monday February 9, 2004, 13:30

3 The fundamentals: Algorithms, the integers, and matrices

SEVENTH EDITION and EXPANDED SEVENTH EDITION

A Faster Randomized Algorithm for Root Counting in Prime Power Rings

Summer Math Packet for Students Entering 6th Grade. Please have your student complete this packet and return it to school on Tuesday, September 4.

Numerical Methods - Lecture 2. Numerical Methods. Lecture 2. Analysis of errors in numerical methods

Conversions between Decimal and Binary

Assignment #1 Sample Solutions

Exercises Exercises. 2. Determine whether each of these integers is prime. a) 21. b) 29. c) 71. d) 97. e) 111. f) 143. a) 19. b) 27. c) 93.

The Real Number System

Differentiation. The main problem of differential calculus deals with finding the slope of the tangent line at a point on a curve.

Discrete Structures, Final Exam

Function Operations. I. Ever since basic math, you have been combining numbers by using addition, subtraction, multiplication, and division.

4. Number Theory (Part 2)

Chapter 5. Number Theory. 5.1 Base b representations

CSE 311: Foundations of Computing. Lecture 12: Two s Complement, Primes, GCD

CS1800 Discrete Structures Fall 2016 Profs. Gold & Schnyder April 25, CS1800 Discrete Structures Final

Finding Divisors, Number of Divisors and Summation of Divisors. Jane Alam Jan

CSE 20 DISCRETE MATH. Fall

4 Number Theory and Cryptography

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

Calculators are NOT permitted.

CS1800 Discrete Structures Final Version A

Number Theory: Representations of Integers

Taylor Series and the Mean Value Theorem of Derivatives

Theorem Let J and f be as in the previous theorem. Then for any w 0 Int(J), f(z) (z w 0 ) n+1

2. ETA EVALUATIONS USING WEBER FUNCTIONS. Introduction

CSEN102 Introduction to Computer Science

( x) f = where P and Q are polynomials.

CS1800 Discrete Structures Spring 2018 February CS1800 Discrete Structures Midterm Version A

Math 2412 Activity 1(Due by EOC Sep. 17)

Computer Number Systems

Homework 7 Solutions, Math 55

Applied Cryptography and Computer Security CSE 664 Spring 2017

Recursive Definitions

CS1800 Discrete Structures Fall 2017 October, CS1800 Discrete Structures Midterm Version A

Recurrence Relations and Recursion: MATH 180

a the relation arb is defined if and only if = 2 k, k

Announcements. CSE332: Data Abstractions Lecture 2: Math Review; Algorithm Analysis. Today. Mathematical induction. Dan Grossman Spring 2010

Lecture 12 : Recurrences DRAFT

Class 4 Decimals. Answer t he quest ions. Choose correct answer(s) f rom given choice. For more such worksheets visit

Discrete Mathematics (CS503)

Grade 8 Rational Numbers

Ma 4121: Introduction to Lebesgue Integration Solutions to Homework Assignment 6

cse 311: foundations of computing Spring 2015 Lecture 12: Primes, GCD, applications

Objectives. By the time the student is finished with this section of the workbook, he/she should be able

MATH 420 FINAL EXAM J. Beachy, 5/7/97

Algorithms CMSC Basic algorithms in Number Theory: Euclid s algorithm and multiplicative inverse

Number Theory. CSS322: Security and Cryptography. Sirindhorn International Institute of Technology Thammasat University CSS322. Number Theory.

CSC 125 :: Final Exam December 14, 2011

Special types of Riemann sums

Curve Sketching. The process of curve sketching can be performed in the following steps:

Discrete Mathematics & Mathematical Reasoning Chapter 6: Counting

CSE373: Data Structures and Algorithms Lecture 2: Math Review; Algorithm Analysis. Hunter Zahn Summer 2016

Notes on Systems of Linear Congruences

Supplementary material for Continuous-action planning for discounted infinite-horizon nonlinear optimal control with Lipschitz values

Mesa College Math SAMPLES

Lecture 6: Introducing Complexity

Intermediate Math Circles February 14, 2018 Contest Prep: Number Theory

Encryption: The RSA Public Key Cipher

Introduction to Number Theory. The study of the integers

Discrete Structures CRN Test 3 Version 1 CMSC 2123 Autumn 2013

SEQUENCES, MATHEMATICAL INDUCTION, AND RECURSION

Figure 1: Bayesian network for problem 1. P (A = t) = 0.3 (1) P (C = t) = 0.6 (2) Table 1: CPTs for problem 1. (c) P (E B) C P (D = t) f 0.9 t 0.

Chapter 6 Reliability-based design and code developments

On a Closed Formula for the Derivatives of e f(x) and Related Financial Applications

Transcription:

CS22/MATH2 Applied Discrete Math Fall 28 Instructor: Marc Pomplun Assignment # Sample Solutions Question : The Boston Powerlower Botanists at UMass Boston recently discovered a new local lower species that they named the Boston powerlower. It has beautiul, blue blossoms, and each plant lives or only one summer. During that time, each plant produces ten seeds. Two o these seeds will turn into plants in the ollowing year, and the remaining eight seeds will turn into lowers the year ater. As the name powerlower suggests, these seeds always turn into lower plants; there is no ailure ever. During the year o this discovery (let us call it year one), the scientists ound two powerlowers on the UMass campus, and in the ollowing year, there were already our o them. a) Devise a recurrence relation or the number o lower plants n in year n, and speciy the initial conditions. Recurrence relation: n 2n- +8n-2 Initial conditions: 2, 2 b) Use the above recurrence relation to predict the number o plants on the UMass campus in years,, 5, and 6. 22 +8 8 + 6 2 2 +82 8 + 2 8 5 2 +8 6 + 92 52 6 25 +8 7 + 6 c) Find an explicit ormula or computing the number o plants in any given year without requiring iteration, i.e., repeated application o a ormula. You should (but do not have to) check the correctness o your ormulas using some o the results you obtained in (b).

Characteristic equation: r 2 2r 8 Roots: r, r2-2 General solution: n α n + α2 (-2) n Given the initial conditions: I: 2 α - 2α2 II: 2 6α + α2 Computing 2 I + II: 8 2α α / Inserting into I: 2 / - 2α2 2α2 / - 2 α2 -/ Speciic solution: n n n n n Testing: 2 8 5 5 5 52 6 6 6 Well, looks good so ar

Question 2: Hilarious Numbers Let us deine that a positive integer is called hilarious i it has exactly three unique prime actors. For example, is hilarious, because its prime actors are 2,, and 5. Furthermore, 8 is also hilarious, because 8 2 2 7 and thus its unique prime actors are 2,, and 7. a) Write a program in Java, C, C++, Python, or pseudocode that inds the irst ive hilarious numbers. Attach a printout o your program to your assignment. Here is an example solution in C: int ishilarious(int n) int divisor, actors ; while (n > ) divisor 2; while (n % divisor! ) divisor++; while (n % divisor ) n / divisor; actors++; return (actors ); int main() int n 2, hilariouscount ; while (hilariouscount < 5) i (ishilarious(n)) print("%d\n", n); hilariouscount++; n++; return ; b) What are the irst ive hilarious numbers as discovered by your program? I you used pseudocode, you need to ind these numbers by hand. They are, 2, 6, 66, and 7.

Question : Prime Factor Examples Write down the prime actorization (in ascending order) o each o the ollowing integers (Example: 72 2 2 5). a) 677726 2 2 b) c) 255 5 7 d) 2 5 Question : Euclidean Algorithm Use the Euclidean algorithm to determine the ollowing greatest common divisors. Write down every step in your calculation. a) gcd(22, 22) 22 22 + 789 22 5 789 + 77 789 77 + 2 77 2 + 229 2 229 + 8 229 2 8 + 6 8 6 + 2 6 2 + 2 6 + 2 2 + 2 2 + gcd(22, 22) b) gcd(755, 855) 755 2 855 + 5 855 9 5 + gcd(755, 855) 5 c) gcd(62525, 625) 62525 625 + 25 625 25 25 + gcd(62525, 625) 25

Question 5: Induction Use mathematical induction to show that the ollowing equation is true or all natural numbers n: 2 + 2 + 2 2 + + 2 n 2 n+ - Basis step: For n we get 2 2 - true! Inductive step: Add 2 n+ to both sides: 2 + 2 + 2 2 + + 2 n + 2 n+ 2 n+ + 2 n+ 2 + 2 + 2 2 + + 2 n + 2 n+ 2 2 n+ 2 + 2 + 2 2 + + 2 n + 2 n+ 2 n+2 Thereore, the equation is true or all natural numbers n. Question 6: Counting How many o the ollowing things exist? Explain why. a) Strings o three hexadecimal digits, i digits can be repeated There are 6 choices or picking each digit, and we need to pick the digits one ater another to build the string, so according to the product rule there are 6 96 strings b) Strings o our octal digits, i digits cannot be repeated Here we are picking -permutations rom the set o 8 digits: P(8, ) 8!/! 8 7 6 5 68 c) Bit strings o length our with no substring (use tree diagram) There are 2 such strings:

d) Passwords consisting o two distinct English letters and three distinct decimal digits, where the letters are either in the irst two or the last two positions o the password. There are 26 distinct letters and distinct digits. Let us irst consider the case that the letters are in the irst two positions. Since we are looking or distinct letters and digits, the choices n or our ive picks are: n 26 25 9 8 68, In the case that the two letters occur in the last positions, the number n2 o choices is actually the same as n: n2 9 8 26 25 68, Since these two cases cannot occur at the same time, we can apply the sum rule: n n + n2 96,