counting1

counting1 - 1 Counting Basic principles for counting the...

Info iconThis preview shows pages 1–3. Sign up to view the full content.

View Full Document Right Arrow Icon

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

View Full DocumentRight Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: 1 Counting Basic principles for counting the number of elements in a set. 1. Count each element once. 2. Dont count an element more than once. 3. Determine how elements differ, and apply the appropriate rule. Notation: S , S 1 , S 2 , ... are sets | S | = the number of elements in S . The Sum Rule Conditions: S = S 1 S 2 S 1 S 2 = | S 1 | = n 1 | S 2 | = n 2 Conclusion: | S | = n 1 + n 2 . Example: S = set of alphanumeric characters S 1 = set of digits, and S 2 = set of letters S = S 1 S 2 , and S 1 S 2 = | S 1 | = 10, and | S 2 | = 26 (ignoring case) Therefore, | S | = 10 + 26 = 36 2 The Product Rule Conditions: S = S 1 S 2 | S 1 | = n 1 | S 2 | = n 2 Conclusion: | S | = n 1 * n 2 . Example: S = two digit numbers, no leading zeroes S 1 = { 1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 , 9 } S 2 = { , 1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 , 9 } | S 1 | = 9 and | S 2 | = 10 Therefore, | S | = 9 * 10 = 90 The Inclusion-Exclusion Principle Conditions:...
View Full Document

Page1 / 4

counting1 - 1 Counting Basic principles for counting the...

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

View Full Document Right Arrow Icon
Ask a homework question - tutors are online