數學題..Discrete Math..HELP!
How many binary strings of length 7 (that is; sequences of length 7 whose entries are chosen from { 0, 1 }) contain the substring 101?
For example, 1010101 is such a string,while 0111110 is not.
Hint: partition the set of all such strings according to the first occurence of the substring.
回答 (4)
I have written a macro to count the of occurence of such string, and the answer is 63.
以下為第一次出現 101 的位置:
101.... 16種
.101... 16種
..101.. 12種
...101. 10種
....101 9種
共63種。
收錄日期: 2021-04-23 23:19:14
原文連結 [永久失效]:
https://hk.answers.yahoo.com/question/index?qid=20091019000051KK00179
檢視 Wayback Machine 備份