- 博客(2)
- 资源 (6)
- 收藏
- 关注
原创 赌徒破产问题
上算法课老师讲了赌徒破产问题,回来在网上找了相关资料,感觉是个有趣的概率题,于是也写了篇作为总结。 问题介绍 一个赌徒开始有h枚金币,每次赢得一枚金币的概率为a,输掉一枚金币的概率为1-a,直到其所有的金币总数达到N或0则游戏结束,求赌徒最终赢得N枚金币的概率P(N|h)。 求解 对于当前拥有金币数h,下一时刻有两种可能,即h+1和h-1。于是有 (这个概率问题服从二项分布,准确点说...
2018-12-15 21:57:51 4524
原创 甲 1053 Path of Equal Weight
题目描述 Given a non-empty tree with root R, and with weight Wi assigned to each tree node Ti. The weight of a path from R to L is defined to be the sum of the weights of all the nodes along the pa...
2018-12-21 21:34:39 130
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人