week 6 - ics 6d

¡Supera tus tareas y exámenes ahora con Quizwiz!

Suppose that there are three employees in a start-up. They rent an office space with 8 offices, anticipating growth. The office space comes with four desks. Each person can select an office and a desk. The selection is done in the order that the participants joined the company with the founder going first. How many ways are there for the selection to be done?

(8⋅4)⋅(7⋅3)⋅(6⋅2)

Let X = {1, 2, 3, 4}. Define the function f from P(X) to {0, 1}^4 to means that X's digits correpond to places of 1's in the 4-bit strings. 1) What is f({1,4})? 2) Which element is not in f-1(1101)? 3) How many elements are in the set f-1(0000)?

1) 1001 2) 3 (The only 0 in the string 1101 is in the third location. Therefore 3 ∉ f-1(1101).) 3) 0

License plate numbers in a certain state consists of seven characters. The first character is a digit (0 through 9). The next four characters are capital letters (A through Z) and the last two characters are digits. Therefore, a license plate number in this state can be any string of the form: Digit-Letter-Letter-Letter-Letter-Digit-Digit *How many license plate numbers are possible if no digit or letter appears more than once?*

10*9*8*26*25*24*23 10⋅9⋅8⋅26⋅25⋅24⋅23 There are 10⋅9⋅8 ways to fill in the digit locations with no repetitions. There are 26⋅25⋅24⋅23 ways to fill in the letter locations with no repetitions. Using the product rule, there are 10⋅9⋅8⋅26⋅25⋅24⋅23 ways to fill in all seven locations with no repeated digits or letters.

License plate numbers in a certain state consists of seven characters. The first character is a digit (0 through 9). The next four characters are capital letters (A through Z) and the last two characters are digits. Therefore, a license plate number in this state can be any string of the form: Digit-Letter-Letter-Letter-Letter-Digit-Digit *How many different license plate numbers are possible?*

10^3⋅26^4 There are 10 ways to fill in each of the digit locations and 26 ways to fill in each of the letter locations. Using the product rule, there are 10^3⋅26^4 ways to fill in all seven locations.

what is the number of possible choices for a pin number of 4 digits?

10^4

what is the number of possible choices for a pin number of 4 digits, with no repeats?

10·9·8·7

A Chinese restaurant offers 10 different lunch specials. Each weekday for one week, Fiona goes to the restaurant and selects a lunch special. How many different ways are there for her to select her lunches for the week? Note that which lunch she orders on which day matters, so the following two selections are considered different. One possible selection: Mon: Kung pao chicken Tues: Beef with broccoli Wed: Kung pao chicken Thurs: Moo shu pork Fri: Beef with broccoli A different selection: Mon: Beef with broccoli Tues: Kung pao chicken Wed: Kung pao chicken Thurs: Moo shu pork Fri: Beef with broccoli

10⁵ because there are ten options for a meal and she chooses something every weekday for a week. Where c is the set of meal choices (whose cardinality we know to be 10), |{c} x {c} x {c} x {c} x {c}| = 10⁵.

Each character in a password is either a digit [0-9] or lowercase letter [a-z]. How many valid passwords are there with the given restriction(s)? *Length is 14 or 20 and must start with a digit*

10⋅36^13 + 10⋅36^19

A red, blue, and green die are thrown. Each die has six possible outcomes. How many outcomes are there for the three dice in which they are all different?

120 or P(6,3) or 6·5·4 6 possible outcomes for the red die. Since the blue die must be different from the red die, 5 possibilities for the blue die. Since the green die must be different from the red and blue dice, 4 possibilities for the green die. P(6, 3) = 6 × 5 × 4 = 120

In the following question, a club with 10 students elects a president, vice president, secretary and treasurer. No student can hold more than one position. *Again suppose that there are five girls and five boys in the club. How many ways are there to elect the officers if the president is a girl and the VP is a boy?*

1400 5 girls to choose from for Pres. 5 boys to choose from for VP. After Pres, VP chosen, 8 choices for Treas. After Pres, VP, Treas chosen, 7 choices for Sec. 5 × 5 × 8 × 7 = 1400

How many six bit strings are there that start with "01"?

16 |{0} × {1} × {0, 1}^4| = |{0}| · |{1}| · |{0, 1}|^4 = 1 · 1 · 2 · 2 · 2 · 2 = 24 = 16

A burrito stand sells burritos with different choices of stuffing. The set of choices for each category are: Meats choices = {chicken, beef, pork} Bean choices = {black, pinto} Salsa choices = {mild, medium, hot} *If every burrito has meat, beans, and salsa, then how many possible burrito combinations are there?*

18 A burrito selection is described by a triple of the form: (meat choice, bean choice, salsa choice). The number of selections is: |meat| · |bean| · |salsa| = 3 · 2 · 3 = 18

A girl scout troop with 10 girl scouts and 2 leaders goes on a hike. When the path narrows, they must walk in single file with a leader at the front and a leader at the back. How many ways are there for the entire troop (including the scouts and the leaders) to line up?

2 · 10! · 1 There are two ways to select which leader will go in the front. There are 10! ways to order the 10 scouts in the middle. Once those decisions are made, the leader who goes last is determined. Therefore there are 2 · 10! ways to line up the entire troop.

A wedding party consisting of a bride, a groom, two bridesmaids, and two groomsmen line up for a photo. How many ways are there for the wedding party to line up so that the bride is next to the groom?

2*5! or 240 1. two choices for bride next to groom 2. 5! since bride and groom considered one spot First decide whether the bride is to the left or right of the groom (2 choices). Then glue the bride and groom together and there are 5! ways to permute the five items. By the product rule, the number of line-ups with the bride next to the groom is: 2 · 5! = 240

A Chinese restaurant offers 10 different lunch specials. Each weekday for one week, Fiona goes to the restaurant and selects a lunch special. How many different ways are there for her to select her lunches for the week? Note that which lunch she orders on which day matters, so the following two selections are considered different. Now suppose that in addition to selecting her main course, she also selects between water or tea for her drink. How many ways are there for her to select her lunches?

20⁵ because the sum rule is applied to the drinks option and the product rule is applied to the meals and drinks, and since there are 20 choices for one meal each day, that means that in all the weekdays in a week, there are 20 x 20 x 20 x 20 x 20 choices.

A burrito stand sells burritos with different choices of stuffing. The set of choices for each category are: Meats choices = {chicken, beef, pork} Bean choices = {black, pinto} Salsa choices = {mild, medium, hot} *Suppose that the customer can substitute grilled veggies for the meat. Now how many selections are there?*

24 The set of choices for the filling is now {chicken, beef, pork, veggies}. A burrito selection is described by a triple of the form: (filling choice, bean choice, salsa choice). The number of selections is: |filling| · |bean| · |salsa| = 4 · 2 · 3 = 24

In the following question, a club with 10 students elects a president, vice president, secretary and treasurer. No student can hold more than one position. *Now suppose that there are five girls and five boys in the club. How many ways are there to elect the officers if the president is a girl?*

2520 5 girls to choose from for Pres. After Pres chosen, 9 choices for VP. After Pres, VP chosen, 8 choices for Treas. After Pres, VP, Treas chosen, 7 choices for Sec. 5 × 9 × 8 × 7 = 2520

Each character in a password is either a digit [0-9] or lowercase letter [a-z]. How many valid passwords are there with the given restriction(s)? *Length is 15 and cannot start with a digit.*

26*36^14

License plate numbers in a certain state consists of seven characters. The first character is a digit (0 through 9). The next four characters are capital letters (A through Z) and the last two characters are digits. Therefore, a license plate number in this state can be any string of the form: Digit-Letter-Letter-Letter-Letter-Digit-Digit *How many license plate numbers are possible if no digit appears more than once?*

26^4⋅10⋅9⋅8 10⋅9⋅8⋅264 There are 10⋅9⋅8 ways to fill in the digit locations with no repetitions. There are 26 ways to fill in each of the letter locations. Using the product rule, there are 10⋅9⋅8⋅264 ways to fill in all seven locations with no repeated digits.

Each character in a password is either a digit [0-9] or lowercase letter [a-z]. How many valid passwords are there with the given restriction(s)? *Length is 20 and cannot start nor end with a digit*

26⋅36^18⋅26 Since it can't start with a digit we need to pick one of the 26 letters first and one of the the 26 letters last. We have filled two spaces of our 20 length, leaving us with 18 spaces to fill with either digits or lowercase letters (which together total 36).

How many strings of length 4 are there over the alphabet {a, b, c} that end with the character c?

27 |{a, b, c}3 × {c}| = |{a, b, c}|^3 · |{c}| = 33 · 1 = 27

How many six bits strings are there that *begin and end* with a 1, or start with 00?

2^4 + 2^4 = 32 Begin and end with 1 (1****1): 1 · 2 · 2 · 2 · 2 · 1 = 24 Start with 00 (00****): 1 · 1 · 2 · 2 · 2 · 2 = 24 A string can not start with 0 and 1, so the sets are disjoint. Apply the sum rule: The number of strings that begin and end with 1 OR start with 00 is 24 + 24 = 16 + 16 = 32.

How many strings of length five or six start with a 1?

2^4 + 2^5 Length 5 start with a 1 (1****): 1 · 2 · 2 · 2 · 2 = 24 Length 6 start with a 1 (1*****): 1 · 2 · 2 · 2 · 2 · 2 = 25 A string can not have length 5 and length 6. Apply the sum rule: The number of strings that have length 5 or 6 and begin with a 1 is 24 + 25 = 16 + 32 = 48.

A family of four (2 parents and 2 kids) goes on a hiking trip. The trail is narrow and they must walk single file. How many ways can they walk with a parent in the front and a parent in the rear?

2⋅2⋅1⋅1 The desired sequence is (Parent, Child, Child, Parent). The first person in the sequence can be Mom or Dad. (2 choices.) For each choice for the first person, there are two choices for the second person, Sister or Brother. There are 2⋅2 choices so far. If the second person is Sister, then the third person must be Brother. If the second person is Brother, the third person must be Sister. Only 1 choice exists for the third person. The last person must be the parent who was not chosen to be the first person. Only 1 choice exists for the fourth person. The total number of choices is 2⋅2⋅1⋅1=4.

How many strings are there over the set {a, b, c} that have length 10 in which no two consecutive characters are the same? For example, the string "abcbcbabcb" would count and the strings "abbbcbabcb" and "aacbcbabcb" would not count.

3 * 2⁹ = 1536 There are three choices for the first character. There are two choices in selecting each of the next 9 characters from left to right because each character can be any element from the set {a, b, c}, except the one that was chosen to be the previous character. Putting together all the choices by the generalized product rule, the number of strings of length 10 that do not have two consecutive characters that are the same is 3·2^9.

Laptop customization choices: Screen size = {14in, 15in, 17in} Processor speed = { 2.0 GHz, 2.7 GHz} Storage = Solid State Drive (SSD) or Hard Disk Drive (HDD) SSD choices: { 128G, 256G, 512G } HDD choices: { 256G, 512G }

3 ⋅ 2 (3 + 2) or (3⋅2⋅3)+(3⋅2⋅2) 3 (screen size) ⋅ 2 (processor speed) ⋅ 5 (storage, by sum rule)

Consider the following definitions for sets of characters: Digits = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 } Letters = { a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x, y, z } Special characters = { *, &, $, # } Compute the number of passwords that satisfy the given constraints. *Strings of length 6. Characters can be special characters, digits, or letters, with no repeated characters. The first character can not be a special character.*

36 · 39 · 38 · 37 · 36 · 35 There are 36 characters that are not special characters. Therefore there are 36 choices for the first character. Once the first character is chosen, there are 39 choices for the second character because the second character can be any character, except the character that was chosen to be first. For the next character, there are 38 choices, etc. The total number of length 6 strings with no repetitions in which the first character is not a special character is: 36 · 39 · 38 · 37 · 36 · 35

Each character in a password is either a digit [0-9] or lowercase letter [a-z]. How many valid passwords are there with the given restriction(s)? *Length is 17.*

36^17

Consider the set {John, Paul, George, Ringo}. These four would like to sit on a bench together, but Paul and John would like to sit next to each other. How many possible seatings are there?

3·2·1·2 or 3!·2 or 12 1. first consider that there is choice of Paul sitting on the left of John or on right of John, so by sum rule -- 2 choices 2. since they are together, we consider then one spot 3. therefore there are 3*2*1*2 = 12 ways to arrange them alternatively, since we know that in a finite set of size n, there are n! of permutations, we can just say n!*2

A manager must select three coders from her group to write three different software projects. There are 7 junior and 3 senior coders in her group. The first project can be written by any of the coders. The second project must be written by a senior person and the third project must be written by a junior person. How many ways are there for her to assign the three coders to the projects if no person can be assigned to more than one project?

3·7·8 First select the senior person for the second project. There are three choices. Then select the junior person for the third project. There are seven choices. The first project can be written by anyone except for the two people chosen for the second and third projects, so there are eight choices. Since the number of choices for each selection is independent of the selections already made, the number of choices can be combined using the generalized product rule.

Consider the following definitions for sets of characters: Digits = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 } Letters = { a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x, y, z } Special characters = { *, &, $, # } Compute the number of passwords that satisfy the given constraints. *Strings of length 6. Characters can be special characters, digits, or letters, with no repeated characters.*

40 · 39 · 38 · 37 · 36 · 35 There are a total of 40 characters. There are 40 possibilities for the first character. There are 39 for the second character (because the second character can not match the first character), then 38 choices for the third character, etc. The total number of length 6 strings with no repetitions is: 40 · 39 · 38 · 37 · 36 · 35

A burrito stand sells burritos with different choices of stuffing. The set of choices for each category are: Meats choices = {chicken, beef, pork} Bean choices = {black, pinto} Salsa choices = {mild, medium, hot} *Now suppose that the burrito stand introduces a choice between plain flour or whole wheat tortillas? The option to substitute veggies instead of a meat is still available as well. Now how many selections are there?*

48 A burrito selection is described by a 4-tuple of the form: (tortilla choice, filling choice, bean choice, salsa choice). The number of selections is: |tortilla| · |filling| · |bean| · |salsa| = 2 · 4 · 2 · 3 = 48

In the following question, a club with 10 students elects a president, vice president, secretary and treasurer. No student can hold more than one position. *How many ways are there to select the class officers?*

5040 10 choices for Pres. After Pres chosen, 9 choices for VP. After Pres, VP chosen, 8 choices for Treas. After Pres, VP, Treas chosen, 7 choices for Sec. 10 × 9 × 8 × 7 = 5040

what is the number of possible choices for a pin number of 4 digits, with no repeats and the last digit being an even number?

5·9·8·7 pick last even number first, then each of the others

P(6,6)

6!

How many six bit strings are there?

64 or 2^6 |{0, 1}6| = |{0, 1}|6 = 2 · 2 ·2 · 2 · 2 · 2 = 26 = 64

How many strings of length 4 are there over the alphabet {a, b, c}?

81 |{a, b, c}^4| = |{a, b, c}|^4 = 34 = 81

A class has ten students. A teacher will give out three prizes: One student gets a gift card, one gets a book, and one gets a movie ticket. No student can receive more than one prize. How many ways can the teacher distribute the prizes?

P(10,3) or 10·9·8 or 720 10 students to select from for the first prize. Once the first prize has been given, there are 9 students to select from for the second prize, and then 8 students to select from for the third prize. P(10, 3) = 10 · 9 · 8 = 720

Each character in a password is either a digit [0-9] or lowercase letter [a-z]. How many valid passwords are there with the given restriction(s)? Length is 12. No character repeats. Must contain: x Write using P(n,k)

P(12, 1) * P(25, 11) 1. x can be in 12 possible positions so P(12,1) 2. permute the rest of the spaces

Each character in a password is either a digit [0-9] or lowercase letter [a-z]. How many valid passwords are there with the given restriction(s)? Length is 13. No character repeats. Must contain: j Write using P(n,k)

P(13,1)*P(35, 12) j can be in 13 possible positions: P(13,1) -- think sum rule, 13 possible choices Then, permute 12 from 35 characters: P(35,12) Finally, combine: P(13, 1) * P(35, 12)

Each character in a password is either a digit [0-9] or lowercase letter [a-z]. How many valid passwords are there with the given restriction(s)? Length is 12. No character repeats. Starts with: q6 Write using P(n,k)

P(34,10)

Each character in a password is either a digit [0-9] or lowercase letter [a-z]. How many valid passwords are there with the given restriction(s)? Length is 8. No character repeats. Starts with: e1 Write using P(n,k)

P(34,6)

Each character in a password is either a digit [0-9] or lowercase letter [a-z]. How many valid passwords are there with the given restriction(s)? Length is 18. No character repeats. Starts with: a Write using P(n,k)

P(35, 17) First element is chosen so possible pool is reduced to 35 and we decrease one each time

Each character in a password is either a digit [0-9] or lowercase letter [a-z]. How many valid passwords are there with the given restriction(s)? Length is 10. No character repeats. Write using P(n,k)

P(36, 10)

There are 5 computers and 3 students. How many ways are there for the students to sit at the computers if no computer has more than one student and each student is seated at a computer?

P(5, 3) or 5·4·3 or 60 5 possible computers for the first student. Once the first student has chosen, there are 4 computers left for the second student to select from, and then 3 possible computer choices for the third student. TIP: pick the thing to list as the thing that will always correspond to another element -- all students will get a computer (and not all computers will get a student) so list students P(5, 3) = 5 × 4 × 3 = 60

A wedding party consisting of a bride, a groom, two bridesmaids, and two groomsmen line up for a photo. How many ways are there for the wedding party to line up?

P(6, 6) or 6·5·4·3·2·1 or 6! or 720 A line-up of the wedding party is a permutation of the six people in the group, so the number of different line-ups is: 6! = 720

A manager has five different jobs that need to get done on a given day. She has eight employees whom she can assign to the jobs. A job only requires one person and no person can be assigned more than one job. How many possible ways can she do the assignment?

The number of 5-permutations from a set of 8 people is P(8, 5) = 8 · 7 · 6 · 5 · 4 = 6720. The number of assignments can also be derived using the generalized product rule directly. There are 8 choices for job 1. Once the person for job 1 has been selected, there are 7 remaining choices for job 2, then 6 choices for job 3, 5 choices for job 4, and 4 choices for job 5. Applying the product rule, the total number of assignments is 8 · 7 · 6 · 5 · 4 = 6720.

what is a permutation?

a sequence of r items with no repetitions, all taken from the same set.

what is a permutation?

a sequence that contains each element of a finite set exactly once. For example, the set {a, b, c} has six permutations: Table 10.4.1: Permutations of the set {a, b, c}. (a, b, c) (b, a, c) (c, a, b) (a, c, b) (b, c, a) (c, b, a)

At a certain university in the U.S., all phone numbers are 7-digits long and start with either 824 or 825. (a) How many different phone numbers are possible? (b) How many different phone numbers are there in which the last four digits are all different? Write using P(n,k)

a) 2*10^4 b) 2 · P(10,4) or 2 ·10· 9 · 8 · 7

Ten members of a wedding party are lining up in a row for a photograph. (a) How many ways are there to line up the ten people? (b) How many ways are there to line up the ten people if the groom must be to the immediate left of the bride in the photo? (c) How many ways are there to line up the ten people if the bride must be next to the maid of honor and the groom must be next to the best man?

a) P(10,10) or 10! or 10·9·8·7·6·5·4·3·2·1 b)P(9,9) x 1 or 9! x 1 because the bride and groom are considered one spot and there is no choice whether to order one before the order so it's 9 spaces, reducing by one when each is filled c.) 2 x 2 x P(8,8) or 2 x 2 x 8!

Consider the following definitions for sets of characters: Digits = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 } Letters = { a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x, y, z } Special characters = { *, &, $, # } Compute the number of passwords that satisfy the given constraints. (a) Strings of length 6. Characters can be special characters, digits, or letters. (b) Strings of length 7, 8, or 9. Characters can be special characters, digits, or letters. (c) Strings of length 7, 8, or 9. Characters can be special characters, digits, or letters. The first character cannot be a letter.

a.) 40^6 b.) 40^7 + 40^8 + 40^9 c.) 14 * (40^6 + 40^7 + 40^8)

how to find the number of permutations of a finite set with n elements?

n! The number of permutations of a finite set with n elements is P(n, n) = n × (n-1) × ... × 2 × 1 = n! example: {a,b,c} has 3! permutations Table 10.4.1: Permutations of the set {a, b, c}. (a, b, c) (b, a, c) (c, a, b) (a, c, b) (b, c, a) (c, b, a)

A farm orders x horse shoes for its horses. The farm does not order extras and all the horses will get new horse shoes. Apply the k-to-1 rule to determine the number of horses on the farm. Express your answer as a function of x. You should not need the ceiling or floor functions.

x/4 Definition 10.2.3: k-to-1 rule. Suppose there is a k-to-1 correspondence from a finite set A to a finite set B. Then |B| = |A|/k.


Conjuntos de estudio relacionados

European Union Privacy Law Basics

View Set

Zhen Li's Microeconomics Final Exam Review

View Set

IB 320 F - Chapter 6 International Trade Theory

View Set

MGT 325 Chapter 19 Linear Programming-Optimization

View Set

Film Music, Midterm 2 - Music 3344

View Set

A+ Certification Practice Exam 1

View Set