Math Foundations of CS

Réussis tes devoirs et examens dès maintenant avec Quizwiz!

3. How many permutations of{a,b,c,d,e,f,g}end with a?

P(6,6) = 6!

14. How many bit strings of length n, where n is a positive integer, start and end with 1s?

2^(n-2)

2. Show that if there are 30 students in a class, then at least two have last names that begin with the same letter.

ceiling(30/26) = 2

In how many ways can a photographer at a wedding arrange6peopleinarowfromagroupof10people,where thebrideandthegroomareamongthese10people,if a) the bride must be in the picture? b) both the bride and groom must be in the picture? c) exactly one of the bride and the groom is in the picture?

(9*8*7*6*5)*6 ((8*7*6*5)*6)*5 (part a - part b) *2

4. Let S ={ 1,2,3,4,5}. a) List all the 3-permutations of S. b) List all the 3-combinations of S.

10 combinations 60 permutations

6. Let d be a positive integer. Show that among any group of d +1(not necessarily consecutive)integers there are two with exactly the same remainder when they are divided by d.

0

56. The name of a variable in the C programming language is a string that can contain uppercase letters, lowercase letters, digits, or underscores. Further, the first character in the string must be a letter, either uppercase or lowercase, or an underscore. If the name of a variable is determined by its first eight characters, how many different variables can be named in C?(Note that the name of a variable may contain fewer than eight characters.)

53 + 53*63 + 53*63^2 + 53*63^3...

5. Find the value of each of these quantities. a) P(6,3) b) P(6,5) c) P(8,1) d) P(8,5) e) P(8,8) f) P(10,9)

6!/(6-3)! 6!/(6-5)!...

14. a) Show that if seven integers are selected from the first 10 positive integers, there must be at least two pairs of these integers with the sum 11. b) Is the conclusion in part (a) true if six integers are selected rather than seven?

7 NO

16. How many subsets with an odd number of elements does a set with 10 elements have?

C(10,1) + c(10,3) + c(10,5) + c(10,7) + c(10,9)

20. How many bit strings of length 10 have a) exactly three 0s? b) more 0s than 1s? c) at least seven 1s? d) at least three 1s?

C(10,3) C(10,6) + C(10,7) + C(10,8) + C(10,9) + C(10,10) 2^10 - (C(10,2) + C(10,1) + C(10,0))

30. Seven women and nine men are on the faculty in the mathematics department at a school. a) How many ways are there to select a committee of five members of the department if at least one woman must be on the committee? b) How many ways are there to select a committee of five members of the department if at least one woman and at least one man must be on the committee?

C(16,5)-C(9,5) C(16,5)-C(9,5)-C(7,5)

15. In how many ways can a set of five letters be selected from the English alphabet?

C(26,5)

28. A professor writes 40 discrete mathematics true/false questions. Of the statements in these questions, 17 are true. If the questions can be positioned in any order, how many different answer keys are possible?

C(40,17)

38. How many ways are there to select 12 countries in the United Nations to serve on a council if 3 are selected fromablockof45,4areselectedfromablockof57,and the others are selected from the remaining 69 countries?

C(45,3)*C(57,4)*C(69,5)

36. How many bit strings contain exactly five 0s and 14 1s if every 0 must be immediately followed by two 1s?

C(9,4) or C(9,5)

26. How many strings of four decimal digits a) do not contain the same digit twice? b) end with an even digit? c) have exactly three digits that are 9s?

10*9*8*7 10*10*10*5 exactly three 9s, 4 positions to place the 'not 9' digit (4 options) and can chose that digit from rest '9 digits'. So 4*9

17. How many strings of five ASCII characters contain the character @ ("at" sign) at least once? [Note: There are 128 different ASCII characters.

128^5-127^5

8. How many different three-letter initials with none of the letters repeated can people have?

26*25*24

16. How many strings are there of four lowercase letters that have the letter x in them?

26^4-25^4

32. How many strings of six lowercase letters from the English alphabet contain a) the letter a? b) the letters a and b? c) the letters a and b in consecutive positions with a preceding b, with all the letters distinct? d) the letters a and b, where a is somewhere to the left of b in the string, with all the letters distinct?

26^6-25^6 26^6-24^6 C(5,1) = 24*23*22*21 C(1,1) + C(2,1) + C(3,1) + C(4,1) + C(5,1)

12. How many bit strings are there of length six or less, not counting the empty string?

2^0+2^1+2^2+2^3+2^4+2^5+2^6+2^ 2^7-1

18. A coin is flipped eight times where each flip comes up either heads or tails. How many possible outcomes a) are there in total? b) contain exactly three heads? c) contain at least three heads? d) contain the same number of heads and tails?

2^8 C(8,3) 2^8 - (C(8,0) + C(8,1) + C(8,2)) C(8,4)

52. Every student in a discrete mathematics class is either a computer science or a mathematics major or is a joint major in these two subjects. How many students are in theclassifthereare38computersciencemajors(includingjointmajors),23mathematicsmajors(includingjoint majors), and 7 joint majors?

38+23-7

3. A multiple-choice test contains 10 questions. There are four possible answers for each question. a) In how many ways can a student answer the questions on the test if the student answers every question?

4^10 5^10

16. How many numbers must be selected from the set {1,3,5,7,9,11,13,15}to guarantee that at least one pair of these numbers add up to 16?

5

4. A bowl contains 10 red balls and 10 blue balls. A woman selects balls at random without looking at them. a) How many balls must she select to be sure of having at least three balls of the same color? b) How many balls must she select to be sure of having at least three blue balls?

5 13

6. Find the value of each of these quantities. a) C(5,1) b) C(5,3) c) C(8,4) d) C(8,8) e) C(8,0) f) C(12,6)

5!/1!*(5-1)! 5!/3!(5-3)! ...

8. In how many different orders can five runners finish a race if no ties are allowed?

5*4*3*2*1 = 5!

17. A company stores products in a warehouse. Storage bins in this warehouse are specified by their aisle, location in the aisle, and shelf. There are 50 aisles, 85 horizontal locationsineachaisle,and5shelvesthroughoutthewarehouse.Whatistheleastnumberofproductsthecompany can have so that at least two products must be stored in the same bin?

50*85*5+1

9. What is the minimum number of students, each of whom comesfromoneofthe50states,whomustbeenrolledin a university to guarantee that there are at least 100 who come from the same state?

N = 50 ( 100-1) + 1

18. Suppose that there are nine students in a discrete mathematics class at a small college. a) Show that the class must have at least five male students or at least five female students. b) Show that the class must have at least three male students or at least seven female students.

Negation of statement female <= 4 male <= 4 total <= 8 which is not true female <=2 male <= 6 total <= 8 which is not true

24. How many ways are there for 10 women and six men to stand in a line so that no two men stand next to each other? [Hint: First position the women and then consider possible positions for the men.]

P(10,10) * P(11,6)

22. How many permutations of the letters ABCDEFGH contain a) the string ED? c) the strings BA and FGH? f) the strings BCA and ABF?

P(7,7) = 7! P(5,5) = 5! no permutation since B cannot be followed by both C and F at the same time

12. How many bit strings of length 12 contain a) exactly three 1s? b) at most three 1s? c) at least three 1s? d) an equal number of 0s and 1s?

c(12,3) c(12,3) + c(12,2) + c(12,1) + c(12,0) 2^12 - (c(12,2) + c(12,1) + c(12,0))


Ensembles d'études connexes

Medical Acronyms for Metabolic Syndrome & Related Conditions

View Set

Lecture 3: European Patent Convention

View Set

PET Writing Part 1: Sentence Transformations - too / enough, so / such a

View Set

Adnormal Psychology - Ch. 2: Theories & Treatment of Adnormality

View Set