07counting10_modified

# 07counting10_modified - ENGG1007 Foundations of Computer...

This preview shows pages 1–6. Sign up to view the full content.

ENGG1007 oundations of Computer Science Foundations of Computer Science Counting Prof. Francis Chin, Dr SM Yiu October 4 / 6, 2010 (Chapter 5) 1

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
ENGG1007 FCS ounting Counting Counting is for finding the number of possible arrangements r configurations of a certain pattern or configurations of a certain pattern. xamples Examples: Assume the length of a password is between 6 and 8,? how secure is this password system? E.g., year2010, computer, ebi8ks9, …. ) How many possible passwords are there if each character must be in {0,1,…,9} or {a, b,…, z}? ) The larger is this number, the more secure is the system. Is a 5-card poker hand with a “pair of 6” a good hand? ow many different hands nd players are ere? 2 ) How many different hands and players are there? ) How many hands are there without a “pair”?
ENGG1007 FCS asic Counting Rules he Sum Rule Basic Counting Rules The Sum Rule How many ways I can get a red card from a deck of cards? ¾ Answer: 13 +13 = 26 (either heart or diamond) Three departments offer 23, 15, and 19 courses, respectively. A student can choose an elective course from these departments. How many possible courses he can choose? ¾ Answer: 23 + 15 + 19 = 57 he um Rule The The Sum Rule Sum Rule : ¾ Suppose r tasks T 1 , T 2 , …, T r can be done in n , n , …, n ways, respectively. 1 2 r ¾ Then, there are n 1 + n 2 + … + n r ways for doing any of the r tasks. 3 Note that all these tasks are “exclusive”, i.e., only one can be done.

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
ENGG1007 FCS asic Counting Rules he Sum Rule Basic Counting Rules The Sum Rule The The Sum Rule Sum Rule : k bd i ti l ¾ r tasks T 1 , T 2 , …, T r can be done in n 1 , n 2 , …, n r ways respectively. ¾ There are n 1 + n 2 + … + n r ways for doing any of the r tasks. Another example: There are 5 tours to Japan, 3 tours to Taiwan, 2 tours to India, and 3 tours to Singapore. I plan to take one of these tours. There are 4 tasks: T 1 (Japan) which can be done n 1 = 5 ways, T 2 (Taiwan) with n 2 = 3 , T 3 (India) with n 3 = 2 and T 4 (Singapore) with n 4 = 3. There are 5+3+2+3 = 13 ways for doing any of the tasks (or 13 urs can choose om). 4 tours I can choose from).

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
This is the end of the preview. Sign up to access the rest of the document.

## This note was uploaded on 02/10/2011 for the course ENGG 1007 taught by Professor Unknown during the Spring '11 term at HKU.

### Page1 / 19

07counting10_modified - ENGG1007 Foundations of Computer...

This preview shows document pages 1 - 6. Sign up to view the full document.

View Full Document
Ask a homework question - tutors are online