UVA 11971 - Polygon 数学概率

                                    Polygon 

John has been given a segment of lenght N, however he needs a polygon. In order to create a polygon
he has cut given segment K times at random positions (uniformly distributed cuts). Now he has K + 1
much shorter segments. What is the probability that he can assemble a polygon using all new segments?
Input
The number of tests T (T ≤ 1000) is given on the first line. T lines follow, each of them contains two
integers N K (1 ≤ N ≤ 106
; 1 ≤ K ≤ 50) described above.
Output
For each test case output a single line ‘Case #T: F’. Where T is the test case number (starting from
1) and F is the result as simple fraction in form of N/D. Please refer to the sample output for clarity.
Sample Input
2
1 1
2 2
Sample Output
Case #1: 0/1
Case #2: 1/4

 

紫书P335

题意:

有一根长度为n的木条,随机选k个位置吧他们切成k+1个小木条。求这些小木条能构成一个多边形的概率

题解:

不难发现这题答案与n无关,在一条直线上切似乎难以处理,可以吧直线接成一个圆,多切一下,即在圆上随机选k+1个点,吧圆切成k+1个线段

除了点x特殊在超过1/2的圆周上,其余K个点都在另一边 , 因此总的概率为 1/(2^k) ,点i取法有k+1种,所有最后答案就是 1 - (k+1)/(2^k).

 

转载于:https://www.cnblogs.com/zxhl/p/5142969.html

  • 1
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值