作者a016258 (憨仔)
看板Math
标题Re: [离散] 排容
时间Sat Apr 2 21:58:44 2011
※ 引述《mqazz1 (无法显示)》之铭言:
: find the number of solutions to the equation
: x1 + x2 + x3 + x4 = 18
: in which each xi, 1 <= xi <= 9
: justify your answer is required
: (hint: consider the inclusion and exclusion principle)
: 谢谢
还要满足是整数解吧~ 不然会有无限多解
x_i = y_i + 1 => 0 <= y_i <= 8
=>
y_1 + y_2 + y_3 + y_4 = 14
若只考虑 y_i, i=1~4 非负 , 总共有 H(4,14)种
考虑 y_i 范围
若其中有一个拿大於等於 9 , 也就是剩下三个拿小於等於5 , 就要扣掉
假设是 y_1 拿大於等於9
y_2 + y_3 + y_4 <= 5 , 0<= y_i <= 8 , i=1~3
这总共有 H(4,5) 种
=> H(4,14) - C(4,1) * H(4,5)
--
╬ ▃▃ ◢
◣
▄▄
▄▄
◥◣
▄▄
╮ ◣
﹊ _ ▄
▄ ◥◤
◣ ◢
--
※ 发信站: 批踢踢实业坊(ptt.cc)
◆ From: 140.112.90.239