Re: [理工] [離散]-成大電通97-電通甲

看板Grad-ProbAsk作者 (拜占庭)時間14年前 (2012/02/20 23:22), 編輯推噓3(302)
留言5則, 3人參與, 最新討論串2/2 (看更多)
※ 引述《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

02/20 23:41, , 1F
這樣如果n=2代入 結果好像不對 還是我算錯了
02/20 23:41, 1F

02/20 23:55, , 2F
when n=2, 3*3(without 0,1)+2*2(only 0,1)=13=(5^2+1)/2
02/20 23:55, 2F

02/21 11:21, , 3F
0.1的話 只能出現00 11這兩種吧@@
02/21 11:21, 3F

02/21 11:48, , 4F
感謝講解~,題目應該是1和0加起來為偶數個
02/21 11:48, 4F

02/21 11:50, , 5F
原來我連題目都解讀錯了= =
02/21 11:50, 5F
文章代碼(AID): #1FGcKVtN (Grad-ProbAsk)
文章代碼(AID): #1FGcKVtN (Grad-ProbAsk)