about set

2006-10-24 5:08 pm
If X and Y are not disjoint subsets, we cannot add |X| and |Y| to compute the number of elements in X Y. We can get that | X Y| = |X|+|Y|-| X Y| for arbitrary sets X and Y.
Use this result to show how many eight-bit strings either start with a 1 or end with a 1?

回答 (1)

2006-10-24 8:23 pm
✔ 最佳答案
let X be the set of 8-bit string starting with a 1, and Y be the set of 8-bit string ending with a 1

Here X and Y are not disjoint subsets, since a 8-bit string CAN both start and end with 1, such as 10000001. Therefore, by the given formula, no. of 8-bit strings satisfying either X or Y is equal to |X| + |Y| - |XY|

|X| = no. of 8-bit string starting with 1, i.e. no. of 8-bit string from 10000000 to 11111111
= 2^7 = 128
|Y| = no. of 8-bit string ending with 1, i.e. 00000001, 00000011, 00000101, 00000111, ... 11111101, 11111111
= 2^7 = 128
|XY| = no. of 8-bit string BOTH starting and ending with 1, i.e. 10000001, 10000011, 10000101, 10000111 ... 11111101, 11111111
= 2^6 = 64

so, no. of 8-bit string either start with a 1 or end with a 1 = 128 + 128 - 64 = 192


收錄日期: 2021-04-23 15:45:46
原文連結 [永久失效]:
https://hk.answers.yahoo.com/question/index?qid=20061024000051KK00570

檢視 Wayback Machine 備份