概率期望题,等学了离散数学再来吧

我太难了,先放在这里,等我离散数学学了,在更

链接:登录—专业IT笔试面试备考平台_牛客网
来源:牛客网
 

题目描述

Thousand wants to drink a cup of tea.

The volume of his teacup is 1 unit and it is empty initially. Thousand will not drink the tea unless the teacup is full.

Thousand places the teacup on his table, and waits for his assistant BSP to fill the teacup.

Every time BSP visits Thousand's office, BSP will bring a pot with u∈[0,x]u \in [0,x]u∈[0,x] units of tea randomly, and fill them all into Thousand's teacup.

Thousand wants to know the expected number of visits his assistant has to make so that he can drink the tea.

Note that xxx and uuu are real numbers.

输入描述:

 

The input consists of:

    One line containing a real number xxx (1≤x≤1018)(1 \leq x \leq 10^{18})(1≤x≤1018).

输出描述:

Please output one real number rounded to 9 digits decimal, representing the expected times.

示例1

输入

复制2.5

2.5

输出

复制1.491824698

1.491824698

询问期望随机选择几次 [0,x][0,x][0,x] 中的实数进行累加后,结果不小于1。

答案

e1xe^{\frac{1}{x}}ex1​

解答

期望为 

∑i=1∞ ​i∗((x1​)i∗(1−i1​)∗((i−1)!1​)+(x1​)i−1∗(1−x1​)∗(i−1)!1​)

吐槽

这题最大的 Hint 是他被放在了E题。

这题也有若干种通过方法,鼓掌。然而内榜有好几个人被这题卡到自闭,我可怜的队友被这题卡了三个小时。

时隔半年,即使黄老师已经快要入土了,他还是想喝茶。

第四届南方科技大学程序设计竞赛同步赛_ACM/NOI/CSP/CCPC/ICPC算法编程高难度练习赛_牛客竞赛OJ

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

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值