L05-1 - Counting Counting in Algorithms How many...

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

View Full Document Right Arrow Icon
Counting
Background image of page 1

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

View Full DocumentRight Arrow Icon
Counting in Algorithms How many comparisons are needed to sort n numbers? How many steps to compute the GCD of two numbers ? How many steps to factor an integer?
Background image of page 2
How many different configurations for a Rubik’s cube? How many weighings to nd the one counterfeit among 12 coins? How many different chess positions after n moves? Counting in Games
Background image of page 3

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

View Full DocumentRight Arrow Icon
If sets A and B are disjoint , then | A B | = | | + | | Sum Rule Class has 43 women, 54 men, so total enrollment = 43 + 54 = 97 26 lower case letters, 26 upper case letters, and 10 digits, so total characters = 26+26+10 = 62
Background image of page 4
Given two sets A and B, the Cartisean product Product Rule If | A | = m and | B | = n, then | | = mn. = { a, b, c, d }, B = { 1, 2, 3 } B = {( a , 1 ),( a , 2 ),( a , 3 ), ( b , 1 ),( b ,2 ),( b , 3 ), ( c , 1 ),( c , 2 ),( c , 3 ), ( d , 1 ),( d , 2 ),( d , 3 )} If there are 4 men and 3 women, there are possible married couples. 4 1 3 2
Background image of page 5

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

View Full DocumentRight Arrow Icon
Product Rule: Counting Strings The number of length-4 strings from alphabet B ::= { 0 , 1 } = | | = ±2 ± ·2 ± ± ±= 4 The number of length- n stringsfrom an alphabet of size m is .
Background image of page 6
between 6 & 8 characters long starts with a letter case sensitive other characters: digits or letters How many passwords satisfy the following requirements?
Background image of page 7

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

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

Page1 / 35

L05-1 - Counting Counting in Algorithms How many...

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

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