0% found this document useful (0 votes)
20 views

Counting Principles

Uploaded by

Ali Arshad
Copyright
© © All Rights Reserved
Available Formats
Download as PDF or read online on Scribd
0% found this document useful (0 votes)
20 views

Counting Principles

Uploaded by

Ali Arshad
Copyright
© © All Rights Reserved
Available Formats
Download as PDF or read online on Scribd
You are on page 1/ 11
386 6/ Counting cara ge amples Os EXAMPLE 1 EXAMPLE 2 EXAMPLE 3 EXAMPLE 4 Basic Counting Principles ‘We first present two basic counting principles, the product rule and the sum rule. Then we will show how they can be used to solve many different counting problems. ‘The product rule applies when a procedure is made up of separate tasks, THE PRODUCT RULE Suppose that a procedure can be broken down into a sequence of two tasks. If there are n; ways to do the first task and for each of these ways of doing the first task, there are nz ways to do the second task, then there are mn ways to do the procedure. Examples 1-10 show how the product rule is used. ‘A new company with just two employees, Sanchez, and Patel, rents a floor of a building with 12 offices. How many ways are there to assign different offices to these two employees? Solusion: ‘The procedure of assigning offices to these two employees consists of assigning an otic to Sanchez, which can be done in 12 ways, then assigning an ofice to Pate different from the office assigned to Sanchez, which can be done in 11 ways. By the product rule, there are 12-11 = 132 ways to assign offices to these two employees. < ‘The chairs of an auditorium ate to be labeled with an uppercase English letter followed by a positive integer not exceeding 100, What is the largest number of chairs that can be labeled differently? Solurion: ‘The procedure of labeling a chair consists of two tasks, namely, assigning tothe seat one ofthe 26 uppercase English letters, and then assigning to it one of the 100 possible integers ‘The productrale shows tha there ae 26 100 — 2600 different ways that a chair canbe labeled. “Therefore, the largest numberof chairs that can be labeled differently is 2600 < ‘There are 32 microcomputers in a computer center. Each microcomputer has 24 ports. How many different ports to a microcomputer in the center are there? ‘Soluion: "The procedure of choosing a port consists of two task, frst picking « microcomputer and then picking a port on this microcomputer. Because there are 32 ways to choose the micro- ‘computer and 24 ways to choose the port no matter which microcomputer has been selected the product rule shows that there are 32 24 ~ 768 port. < ‘An extended version of the product rule is often useful. Suppose that a procedure is carried out by performing the tasks T), To, -.., Tp in sequence. If each task T),i = 1.2,...., canbe done in n; ways, regardless of how the previous tasks were done, then there are my 72 ~ --~ - Mig ‘ways to carry out the procedure. This version of the product rule can be proved by mathematical induction from the product rule for two tasks (see Exercise 72). ‘How many different bit strings of length seven are there? Solution: Bach of the seven bits can be chosen in two ways, because each bit is either 0 or 1 Therefore, the product rule shows there are a (otal of 27 = 128 different bit strings of length EXAMPLE 5 ‘Dchoiees “TO eboices foreach foreach, Teter digit EXAMPLE 6 EXAMPLE 7 ‘Counting tbe numberof ‘onto functions ie had, ‘We'll do this Chapter 8 EXAMPLE 8 Curent projection ate that by 2038, twill be necessary to a one ot sore digs o Non ‘American telephone somber 6.4 The Basics of Counting 387 How many different license plates can be made if each plate contains a sequence of three ‘uppercase English letters followed by three digits (and no sequences of letters ate prohibited, even if they are obscene)? Solution. There are 26 choices for each of the three uppercase English letters and ten choices for each of the three digits. Hence, by the product rule there are a total of 26 +26 26-10. 10: 10 = 17,576,000 possible license plates. < Counting Functions How many functions are there from a set with m elements to a set with n elements? ‘Solution: A function corresponds to a choice of one of the n elements in the codomain for each of the m elements in the domain, Hence, by the product rule there aren «++ «m= n™ functions from a set with m elements to one with n elements. For example, there are 5? = 125 different functions from a set with three elements to a set with five elements, < Counting One-to-One Functions How many one-to-one functions are there from a set with ‘m clements to one with n elements? Solution: First note that when m > n there are no one-to-one functions from a set with m clements to a set with n clements Now let m -m times. Hence, the final value of k is nym) -+ My < Counting Subsets of a Finite Set Use the product rule to show that the number of different subsets of a finite set Sis 2! Soluion: Let $ be a finite set. List the elements of $ in arbitrary order. Recall from Section 2.2 that there is a one-to-one correspondence between subsets of $ and bit strings of length [S|. Namely, a subset of Sis associated with the bit string with a1 in the ith position if the th element inthe ist is in the subsct, and a0 in this position otherwise. By the product rae, there are 21 bit strings of length [S|. Hence. |P(S)| ~ 21. (Recall that we used mathematical induction to prove this fact in Example 10 of Section 5.1) < The product rule is often phrased in terms of sets in this way: If Ay, Aa, ... Ay are finite sets, then the number of elements in the Cartesian product of these sets is the product of the ‘number of elements in each set. To relate this to the product rule, note that the task of choosing an element in the Cartesian product Ay x Az x-+ x Ay is done by choosing an clement in Aj, an clement in Az, ..., and an element in Ay. By the product rule it follows that Jay x Az x --- % Ame] = [Aa] -1Aal ln DNA and Genomes The hereditary information of a living organism is encoded using de- oxyribonucleic acid (DNA), or in certain viruses, ribonucleic acid (RNA). DNA and RNA are extremely complex molecules, with different molecules interacting in a vast variety of ways to esl to hve your ova enti code found EXAMPLE 12 6.1 The Basics of Counting 389 enable living process. For our purposes, we give only the briefest description of how DNA and RNA encode genetic information. DNA molecules consist of two strands consisting of blocks known as nucleotides. Bach nucleotide contains subcomponents called bases, each of which is adenine (A), eytosine (C), ‘guanine (G), or thymine (I), The two strands of DNA are held together by hydrogen bonds connecting different bases, with A bonding only with T, and C bonding only with G. Unlike DNA, RNA is single stranded, with uracil (U) replacing thymine as a base. So, in DNA the possible base pairs are A-T and C-G, while in RNA they are A-U, and C-G. The DNA of a living creature consists of multiple pieces of DNA forming separate chromosomes. A geneis a segment of aDNA molecule that encodes a particular protein. The entirety of genetic information of an organism is called its genome. ‘Sequences of bases in DNA and RNA encode long chains of proteins called amino acids, ‘There are 22 essential amino acids for human beings. We can quickly see that a sequence of at Teast three bases are needed to encode these 22 different amino acid, First note, that because there are four possibilities for each base in DNA, A, C, G, and T, by the product rule there are = 16 < 22 different sequences of two bases. However, there are 4? = 64 different sequences of three bases, which provide enough different sequences to encode the 22 different amino acids (even after taking into account that several different sequences of three bases encode the same amino acid), ‘The DNA of simple living ereatures such as algae and bacteria have between 10° and 107 links, where each link is one of the four possible bases. More complex organisms, such as in- sects, birds, and mammals have between 10* and 10!° links in their DNA. So, by the product rule, there are at least 4!°° different sequences of bases in the DNA of simple organisms and at least 44° different sequences of bases in the DNA of more complex organisms. These are both incredibly huge numbers, which helps explain why there is such tremendous variability among living organisms. In the past several decades techniques have been developed for determining the genome of different organisms. The first step is to locate each gene in the DNA of an ot- ganism, The next task, called gene sequencing, is the determination of the sequence of links on each gene. (Of course, the specific sequence of kinks on these genes depends on the partic- ular individual representative of a species whose DNA is analyzed.) For example, the human ‘genome includes approximately 23,000 genes, each with 1,000 or more links. Gene sequencing techniques take advantage of many recently developed algorithms and are based on numerous new ideas in combinatorics. Many mathematicians and computer scientists work on problems involving genomes, taking part in the fast moving fields of bioinformatics and computational biology. < ‘We now introduce the sum rule. ‘THESUM RULE Ifa task can be done either in one of m ways or in one of n2 ways, where none of the set of my ways is the same as any of the set of my ways, then there are my +13 ways to do the task. Example 12 illustrates how the sum rule is used, ‘Suppose that either a member of the mathematics faculty or a student who is a mathematics major is chosen as a representative to a university committee. How many different choices are there for this representative if there arc 37 members of the mathematics faculty and 83 mathematics ‘majors and no one is both a faculty member and a student? Solution: There are 37 ways to choose a member of the mathematics faculty and there are 83 ‘ways to choose a student who is a mathematics major, Choosing a member of the mathematics faculty is never the same as choosing a student who is a mathematics major because no one is 390 6 /Counting EXAMPLE 13 EXAMPLE 14 both a faculty member and a student. By the sum rule it follows that there are 37 4 83 = 120 possible ways to pick this representative. < ‘We can extend the sum rule to more than two tasks. Suppose that a task can be done in one ‘of my ways, in one of n ways, ... ,orin one of my ways, where none of the set of n; ways of doing the taskis the same as any of the set of nj ways, forall pais i and j with 1

You might also like