看板 Grad-ProbAsk 關於我們 聯絡資訊
※ 引述《love5566188 (I'dont kown)》之銘言: : 2. : Find the number of n-digital words renerated from the alphabet{0,1,2,3,4} : in each of which the total number of 0's and 1's is even. : 請問這樣怎麼求出來? 遞迴解法 考慮第一個alphabet, (n-1) 若為0 or 1, 則剩下n-1個digit裡0和1要有奇數個, 為2*[5 - a(n-1) ] (即為所有個數減去偶數個數) 若為2,3,4 則剩下n-1個digit裡0和1要有偶數個, 為3a(n-1) n-1 因此 an = 2*5 + a(n-1) , a0 = 1 , a1 = 3 n 解遞迴可得an = (5 + 1)/2 -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 114.37.162.23
ah941206:這樣如果n=2代入 結果好像不對 還是我算錯了 02/20 23:41
bbhands:when n=2, 3*3(without 0,1)+2*2(only 0,1)=13=(5^2+1)/2 02/20 23:55
ah941206:0.1的話 只能出現00 11這兩種吧@@ 02/21 11:21
love5566188:感謝講解~,題目應該是1和0加起來為偶數個 02/21 11:48
ah941206:原來我連題目都解讀錯了= = 02/21 11:50