CSC 2510 Test 3 1. Give the names of the formula or rule that provides the answer for each of the following problems. Do not try to solve the problems!

Slides:



Advertisements
Similar presentations
5.1 Rules for Exponents Review of Bases and Exponents Zero Exponents
Advertisements

Opening Objective By the end of this PowerPoint you should be able to:
Chapter 8 Introduction to Number Theory. 2 Contents Prime Numbers Fermats and Eulers Theorems.
Analysis of Algorithms II
Chapter 2 Fractions.
McGraw-Hill/Irwin ©2008 The McGraw-Hill Companies, All Rights Reserved Chapter 1 Whole Numbers: How to Dissect and Solve Problems.
Warm Up Lesson Presentation Lesson Quiz
Math 6 SOL Review Pt Released Test 26. Which solid could not have two parallel faces? A. A. Cube B. B. Rectangular prism C. C. Pyramid D. D.
MULTIPLICATION EQUATIONS 1. SOLVE FOR X 3. WHAT EVER YOU DO TO ONE SIDE YOU HAVE TO DO TO THE OTHER 2. DIVIDE BY THE NUMBER IN FRONT OF THE VARIABLE.
Order of Operations Lesson
Chapter 1 Linear Equations and Graphs
1 Combination Symbols A supplement to Greenleafs QR Text Compiled by Samuel Marateck ©2009.
Factoring Quadratics — ax² + bx + c Topic
Monika Gope Lecturer IICT, KUET
1 Basics of Counting CS/APMA 202 Epp sections 6.2 & 6.3 Aaron Bloomfield.
Digital Lessons on Factoring
DIVISIBILITY, FACTORS & MULTIPLES
9.5 Counting Subsets of a Set: Combinations
Counting. Counting in Algorithms How many comparisons are needed to sort n numbers? How many steps to compute the GCD of two numbers ? How many steps.
1 Combinations & Counting II Samuel Marateck © 2009.
Basic Permutations and Combinations
Binary Values and Number Systems
Presented by: Tutorial Services The Math Center
Some problems produce equations that have variables on both sides of the equal sign.
4.5 Generalized Permutations and Combinations
Adding and Subtracting Integers
Chapter 1: Expressions, Equations, & Inequalities
Basic Math Terms.
WU # y +1 < 19 5y +2 -y > 8 -7y  -14 4y – 7y -7 < y y + 6  21 y < 2 y  - 3 y > -4 y  2.
Factors Terminology: 3  4 =12
1 Let’s Recapitulate. 2 Regular Languages DFAs NFAs Regular Expressions Regular Grammars.
The Pigeonhole Principle Alan Kaylor Cline. The Pigeonhole Principle Statement Children’s Version: “If k > n, you can’t stuff k pigeons in n holes without.
Chapter 5 Relations and Functions
The Logic of Compound Statements
Counting Chapter 6 With Question/Answer Animations.
DATA REPRESENTATION CONVERSION.
Study Guides Quantitative - Arithmetic - Numbers, Divisibility Test, HCF and LCM Mycatstudy.com.
Binary Addition Rules Adding Binary Numbers = = 1
CSE115/ENGR160 Discrete Mathematics 04/17/12
1 Section 2.5 Integers and Algorithms. 2 Euclidean algorithm for finding gcd Where L is a larger number, and S is a smaller number, to find gcd(L,S):
Chapter Chapter Goals Know the different types of numbers Describe positional notation.
Recursive Definitions Rosen, 3.4 Recursive (or inductive) Definitions Sometimes easier to define an object in terms of itself. This process is called.
Climbing an Infinite Ladder
Real Numbers and the Decimal Number System
Applied Discrete Mathematics Week 9: Relations
Quantitative - Arithmetic - Numbers, Divisibility Test, HCF and LCM
Lecture for Week Spring.  Numbers can be represented in many ways. We are familiar with the decimal system since it is most widely used in everyday.
Numbering systems.
© by Kenneth H. Rosen, Discrete Mathematics & its Applications, Sixth Edition, Mc Graw-Hill, 2007 Chapter 3 (Part 3): The Fundamentals: Algorithms, the.
Chapter The Basics of Counting 5.2 The Pigeonhole Principle
Generalized Permutations and Combinations
Chapter 6 With Question/Answer Animations 1. Chapter Summary The Basics of Counting The Pigeonhole Principle Permutations and Combinations Binomial Coefficients.
WIKIPEDIA HAS MANY MORE DIVISIBILITY RULES. EXAMPLE Since 52=13(4) is divisible by 4, is divisible by 4 Since 452=56(8)+4 is not divisible.
Section 2.6 Representation of numbers. Decimal representation (base 10) Given a positive integer X, the decimal representation of X is a string of digits.
The Pigeonhole Principle. The pigeonhole principle Suppose a flock of pigeons fly into a set of pigeonholes to roost If there are more pigeons than pigeonholes,
Number Systems & Operations
Introduction To Number Systems Binary System M. AL-Towaileb1.
Greatest Common Divisors & Least Common Multiples  Definition 4 Let a and b be integers, not both zero. The largest integer d such that d|a and d|b is.
Quiz 7 The way I expected it.. How to do it! 1. Let P(n) be the statement that n 2 = n(n + 1)(2n + 1)/6 for the positive integer n. Be.
ECE DIGITAL LOGIC LECTURE 2: DIGITAL COMPUTER AND NUMBER SYSTEMS Assistant Prof. Fareena Saqib Florida Institute of Technology Fall 2016, 01/14/2016.
The Hexadecimal System is base 16. It is a shorthand method for representing the 8-bit bytes that are stored in the computer system. This system was chosen.
Section The Product Rule  Example: How many different license plates can be made if each plate contains a sequence of three uppercase English letters.
COUNTING Discrete Math Team KS MATEMATIKA DISKRIT (DISCRETE MATHEMATICS ) 1.
Section 6.3. Section Summary Permutations Combinations.
Introduction To Number Systems
COMPUTING FUNDAMENTALS
Number System conversions
Quiz 6 The way I expected it..
Introduction To Number Systems
Presentation transcript:

CSC 2510 Test 3 1. Give the names of the formula or rule that provides the answer for each of the following problems. Do not try to solve the problems!

1.a. How many cards must be selected from a standard deck of 52 cards to guarantee that at least three cards of the same suit are chosen? Givens: Standard deck = 4 suits Find: max(suit1 + suit1 + suit1 + suit1) ≤ 3 + 1

1.a. max(2 + 2 + 2 + 2) ≤ 3 Answer: Sum rule (Pigeon hole accepted also) max(2 + 2 + 2 + 2) ≤ 3 + 1 = 9 (You can chose 2 (indistinguishable) from each group before the next card will ensure that you have three of a suit)

1.b. How many bit strings of length eight either start with a 1 bit or end with the two bits 10? There are 28 strings = 256 possible strings. 1/2 of the strings begin with 1 for 128 strings 1/4 of the strings end in 10 for 1/4 * 28 = 64 strings But 1/2 of the 1/4 * 28 for 32 strings also start with 1 so they must be subtracted out again. 128 + 64 - 32 = 160.

1.b. Subtraction rule.

1.c. How many bit strings of length n are there? Given: bit strings = 2 choices length = n (or repeated n times) bits are indistinguishable each choice is either a 0 or a 1

2n (two choices for each bit - choicestimes)

1.d. How many ways can you solve a task if the task can be done in one of n1 ways or in one of n2 ways? Given: n1 ways + n2 ways Answer: Sum rule

2.a. Convert the octal value 7016 to binary. 70168 = 111 000 001 110 Convert the octal digits to binary in groups of three using the table. = 1110000011102

Convert the octal value 7016 to hex. 2.b. Convert the octal value 7016 to hex. 70168 = 111 000 001 110 Convert the octal digits to binary in groups of three using the table. 1110000011102 Then regroup into groups of 4 start from right: 1110 0000 11102 Then convert to hex using table (you should learn the conversion: 1110 0000 11102 = E0E16

2.c. Convert the octal value 7016 to decimal. 70168 = 7 * 83 + 0 *82 + 1 *81 + 6 *80 = 7 * 512 + 0 + 8 + 6 = 3584 + 8 + 6 = 359810

2.d. Convert decimal 17861 to hex. 17861/16 = 1116 mod 5 1116/16 = 69 mod 12 = C 69/16 = 4 mod 5 4/16 = 0 mod 4 = 45C516 (remainder of 0 indicates we are finished)

Convert decimal 1740 to octal.   1740/8 = 217 mod 4 217/8 = 27 mod 1 27/8 = 3 mod 3 3/8 = 0 mod 3 = 33148 (remainder of 0 indicates we are finished)

3. What formula would you use in each of the following cases? Example: permutation: P(n) = n!.

3.a. A procedure has n1 ways to do task 1 and n2 ways to do task 2: n1 * n2 or product rule

A task may use one of group n1 or one of n2 to do a task: 3.b. A task may use one of group n1 or one of n2 to do a task: n1 + n2 or sum rule (no overlap between groups – all tasks are independent)

3.c. An ordered arrangement of r elements: P(n,r) or n!/(n - r)! or n(n-1)(n-2)...(n-r+1) (r ordered elements out of n)

3.d. The number of r-permutations of a set of n objects with repetition: nr (with repetition means that each time you get to choice n items – the amount you can choice never gets smaller than n so that you choice n r times)

3.e. An unordered selection of r elements from a set with n distinct elements: C(n, r) or n!/(r! * (n-r)!) (unordered is a combination and divides r! back out – (the duplicates))

3.f. The number of r-permutations of a set of n objects with repetition: nr (Same question as 3.d.)

or factorial expansion of the above 3.g. The number of ways to select r items from n indistinguishable objects: (Think cookies). (the size of r may be greater than, less than, or equal to the size of n) C(n + r -1, r) or C(n + r - 1, n -1) or factorial expansion of the above C(n + r -1, r) = C(n + r - 1, n -1) because (n+ r-1)/((n+r-1-r)!*r!) = (n+ r-1)/((n-1+(r-r))!*r!) = (n+ r-1)/((n-1)!*r!)

3.h. The number of ways to select r items from n indistinguishable objects and do it until less than r items remains: C(n,r)C(n-r,r)C(n-r-r,r) * (etc.) (Any expression of same.)

4.a. Give the Euclidean Algorithm for greatest common divisor: procedure gcd(a, b: positive integers) x := a y := b while y  0 r := x mod y x := y y := r return x {gcd(a, b) is x}

4.a. or procedure gcd(a, b: positive integers) x := a y := b if y = 0 return x return gcd(y, x mod y) if b = 0 return a return gcd(b, a mod b)

4.b. Showing the steps, find gcd(91, 287): 287/91 = 91 * 3 + 14 91/14 = 14 * 6 + 7 14/7 = 7 * 2 + 0 (remainder of 0 indicates we are finished) = 7

5. Let P(n) be the statement that 12 + 32 + 52+ ... + (2n + 1)2 = (n + 1)(2n + 1)(2n + 3)/3 whenever n is a nonnegative integer. Be sure to use the formal proof that includes Basis Step.

5. Basis step: Show that P(0) is true. Let n = 0. Then (2(0) + 1)2 = ((0) + 1)(2(0) + 1) (2(0) + 3)/3 1 = (1)(1)(3)/3 = 1. Since both sides equal 1, P(0) must be true Induction Hypotheses: 12 + 32 + 52 + ... + (2k + 1)2 = (k + 1)(2k + 1)(2k + 3)/3 Induction Step: Show that 12 + 32 + 52+ ... + (2k + 1)2 + (2(k+1) + 1)2 = ((k + 1) + 1)(2(k + 1) + 1)(2(k + 1) + 3)/3 is true.

5. Proof: 12 + 32 + 52 + ... + (2k + 1)2 + (2(k+1) + 1)2 = ((k + 1) + 1)(2(k + 1) + 1)(2(k + 1) + 3)/3 (k + 1)(2k + 1)(2k + 3)/3 + (2(k+1) + 1)2 = ((k + 1) + 1)(2(k + 1) + 1)(2(k + 1) + 3)/3 (k + 1)(2k + 1)(2k + 3)/3 + 3/3 * (2k + 3)2 = ((k + 2)(2k + 3)(2k + 5)/3 ((k + 1)(2k + 1)(2k + 3) + 3(2k + 3)2)/3 = ((k + 2)(2k + 3)(2k + 5)/3 (k + 1)(2k + 1)(2k + 3) + 3(2k + 3)2 = ((k + 2)(2k + 3)(2k + 5) (k + 1)(2k + 1) + 3(2k + 3) = ((k + 2)(2k + 5) 2k2 + 3k + 1 + 6k + 9 = 2k2 + 9k + 10 2k2 + 9k + 10 = 2k2 + 9k + 10 1 = 1  We have shown that the induction hypotheses is true by showing that the left side equals the right side for k + 1.

6.a. Give a recursive algorithm (in the pseudo format specified in appendix A3)   for computing: ni=0 i. procedure series(n; integer) If n = 0 return 0 return n + series (n-1) {returns the sum of the first n values}

( means product, so each value is multiplied to the previous) 6.b. Show the value of ni=0 i generated at each step from 0 to n = 4.  means sum, so each value is added to the previous ( means product, so each value is multiplied to the previous)

7. Answer the following questions. How many bit strings of length n are there? 2n Same question as 3.d and 3.f. b. How many bit strings of length 16 are there? 216 (two choices for each bit - choicestimes) What is the formula that you used? (Same answer as a.)

8.a.   What rule would you use to compute how many bit strings of length eight either start with a 1 bit or end with the two bits 10?   Subtraction rule (1/2 of 28 plus 1/4 of 28 minus 1/4 of 1/2 of 22) (areas common to both need to be subtracted out)

8.b. How many bit strings of length eight either start with a 1 bit or end with the two bits 10? (1/2 of 28 =) 128 + (1/4 of 28 = ) 64 - (1/4 of 1/2 of 26 = ) 32 = 160  

9.a. A multiple-choice test contains 10 questions. There are 4 possible answers for each question.   In how many ways can a student answer every question (one answer per question)? (4 ways per question, 10 questions) 410 (10 questions with four choices each, - 410, ntimes or waysquestions)

9.b. A multiple-choice test contains 10 questions. There are 4 possible answers for each question. In how many ways can a student answer the question on the test if the student can leave answers blank? (5 ways per question, 10 questions)  510 (10 questions with five choices each, - 510)

10. Given a set with n items;   a. What formula would you chose to select r items in order? P(n, r) or n!/(n-r)! b. How many possibilities would you have with n = 20 and r = 3. P(20, 3) or 20!/(20-3)! or 20*19*18 c. What is that formula called? r-permutations

11. Show formula used reducing factors as much as possible but not necessary to multiply and divide once reduced.

11.a. How many ways are there to distribute hands of 5 cards to each of four players from the standard deck of 52 cards? (Poker hands)   C(52,5)C(47,5)C(42,5)C(37,5) or 52!/((52-5)!5!) * 47!/((47-5)!5!) * 42!/((42-5)!5!) * 37!/((37-5)!5!) = 52! / (47! * 5!) * 47! / (42! * 5!) * 42! / (37! * 5!) * 37! / (32! * 5!) = (52! / (5! * 5! * 5! * 32! * 5! ) = (52! / (5! 5! 5! 5! 32!)

11.b. n1 = 52, r1 = 5 (if in answer, accept) For each hand what is the value of (the first n) n? Of r? n1 = 52, r1 = 5 (if in answer, accept) n2 = 47, r2 = 5, n3 = 42, r3= 5, n4 = 37, r4 = 5.

11.c. Which formula should be used?   C(52,5)C(47,5)C(42,5)C(37,5) or accept the following partial (incorrect) answers If C(52,5) or 52!/((52-5)! * 5!) or 52! / (47! * 5!) is in answer, accept answer.

12. Show formula used reducing factors as much as possible but not necessary to multiply and divide once reduced.

12.a. How many ways are there to distribute hands of 13 cards to each of four players from the standard deck of 52 cards? (Bridge hands)   C(52,13)C(39,13)C(26,13)C(13,13) or 52!/((52-13)! 13!) * 39!/((39-13)! 13!) * 26!/((26-13)! 13!) * 13!/((13-13)!13!) = 52! / (39! 13!) * 39! / (26! 13!) * 26! / (13! 13!) * 13! / (0! 13!) = 52! / (1! 13!) * 1! / 1! 13!) * 1! / (1! 13!) * 1! / (0! 13!) or 52! / (13! 13! 13! 13!)

12.b For each hand what is the value of n? Of r? n1 = 52, r1 =13,   n1 = 52, r1 =13, n2 = 39, r2 =13, n3 = 26, r3 =13, n4 = 13, r4 =13 If C(52,13) or 52!/((52-13)! * 13!) is in answer, accept answer.

If C(52,13) or 52!/((52-13)! * 13!) is in answer, accept answer. Which formula should be used?   r-combinations or C(52,13)C(39,13)C(26,13)C(13,13) If C(52,13) or 52!/((52-13)! * 13!) is in answer, accept answer.