F - 概率(经典问题) Time Limit:2000MS     Memory Limit:32768KB     64bit IO Format:%lld & %llu Submit Status Description Sometimes some mathematical results are hard to believe. One of the common problems is the birthday paradox. Suppose you are in a party…
链接网址:Math concepts / 数学概念 – https://www.codelast.com/math-concepts-%e6%95%b0%e5%ad%a6%e6%a6%82%e5%bf%b5/ 这里记录了我在学习过程中遇到或总结的一些基础数学概念,保存于此,与需要者共享. Following are some basic math concepts I read or summarized in my learning process, I wrote them down her…
baidu 21副GIF动图让你了解各种数学概念…
21副GIF动图让你了解各种数学概念…
Submit Status Description Sometimes some mathematical results are hard to believe. One of the common problems is the birthday paradox. Suppose you are in a party where there are 23 people including you. What is the probability that at least two peopl…
Description Sometimes some mathematical results are hard to believe. One of the common problems is the birthday paradox. Suppose you are in a party where there are 23 people including you. What is the probability that at least two people in the party…
起因:在一场训练赛上.有这么一题没做出来. 题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=6829 题目大意:有三个人,他们分别有\(X,Y,Z\)块钱(\(1<=X,Y,Z<=1e6\)),钱数最多的(如果不止一个那么随机等概率的选一个)随机等可能的选另一个人送他一块钱.直到三个人钱数相同为止.输出送钱轮数的期望,如果根本停不下来,输出-1. 根据题目的意思,其实就是每次向包里随机加入一枚钱币,直到包里某种钱币数量达到 100.本题的核心是如何…
E - 期望(经典问题) Time Limit:1000MS     Memory Limit:32768KB     64bit IO Format:%lld & %llu Submit Status Description Given a dice with n sides, you have to find the expected number of times you have to throw that dice to see all its faces at least once.…
N - 概率 Time Limit:4000MS     Memory Limit:32768KB     64bit IO Format:%lld & %llu Submit Status Description As Harry Potter series is over, Harry has no job. Since he wants to make quick money, (he wants everything quick!) so he decided to rob banks.…
Description There is a hill with n holes around. The holes are signed from 0 to n-1. A rabbit must hide in one of the holes. A wolf searches the rabbit in anticlockwise order. The first hole he get into is the one signed with 0. Then he will get into…
数学期望 P=Σ每一种状态*对应的概率. 因为不可能枚举完所有的状态,有时也不可能枚举完,比如抛硬币,有可能一直是正面,etc.在没有接触数学期望时看到数学期望的题可能会觉得很阔怕(因为我高中就是这么认为的,对不起何老板了QwQ),避之不及. 但是现在发现大多数题就是手动找公式或者DP推出即可,只要处理好边界,然后写好方程,代码超级简短.与常规的求解不同,数学期望经常逆向推出. 比如常规的dp[x]可能表示到了x这一状态有多少,最后答案是dp[n].而数学期望的dp[x]一般表示到了x这一状态还…
题1: Uva 1636 Headshot 题目大意: 给出一个000111序列,注意实际上是环状的.问是0出现的概率大,还是当前是0,下一个还是0的概率大. 问题比较简单,注意比较大小: A/C > B/D  <=> A * D > B * C #include <cstdio> #include <cstring> #include <cstdlib> #include <algorithm> #include <iostr…
问题: Ivan is fond of collecting. Unlike other people who collect post stamps, coins or other material stuff, he collects software bugs. When Ivan gets a new program, he classifies all possible bugs into n categories. Each day he discovers exactly one…
Description 大家常常感慨,要做好一件事情真的不容易,确实,失败比成功容易多了! 做好“一件”事情尚且不易,若想永远成功而总从不失败,那更是难上加难了,就像花钱总是比挣钱容易的道理一样. 话虽这样说,我还是要告诉大家,要想失败到一定程度也是不容易的.比如,我高中的时候,就有一个神奇的女生,在英语考试的时候,竟然把40个单项选择题全部做错了!大家都学过概率论,应该知道出现这种情况的概率,所以至今我都觉得这是一件神奇的事情.如果套用一句经典的评语,我们可以这样总结:一个人做错一道选择题并不…
0. 基本定义 Singularity (mathematics) 数学上的奇异性一般是指,函数在该点未定义(not defined,比如取值为无穷),或者不可微(fails to be well-behaved). 1. 举例 f(x)=1x:在 x=0 处未定义: g(x)=|x|:在 x=0 处不可微(左导数不等于右导数): y2=x 也就是 y=x√,x≥0,在点 (0,0) 处 虽然有定义,但是在 x=0 处为 vertical tangent,也即在该点处的导数为无穷大(又因为导数其…
最近研究slot 算法,看了大量的英文资料,因为母语中文,一直使用中文的英文小白来说,好心塞,悔不当初没学好英文. 下文是从众多的英文中摘录的唯一能够看明白的概念.先给自己留着,到时候深入研究可以看 Commonly used mathematical concepts in gambling: Combin Function The Combin Function is an Excel function that calls on combinatorial mathematics to p…
数学是很难的科学,但因为它是科学家用数学来解释宇宙的语言,我们无可避免的要学习它.看看下面的这些 GIF 动图,它们提供了视觉的方式来帮助你理解各种数学技巧. 1.椭圆的画法 2.杨辉三角问题(Pascal triangles)解法 3.使用“FOIL”轻松的解决二项式乘法 4.对数解法技巧 5.矩阵转置的技巧 6.勾股定理 7.多边形的外角之和总是等于 360 度 8.圆周率π 9.一弧度就是长度刚好等于半径的一段圆弧所对的圆心角 10.在Y轴上使用正弦(红色),在X轴上使用余弦(蓝色),则在…
You are going from Dhaka to Chittagong by train and you came to know one of your old friends is going from city Chittagong to Sylhet. You also know that both the trains will have a stoppage at junction Akhaura at almost same time. You wanted to see y…
“让我们面对它:总的来说数学是不容易的,但当你征服了问题,并达到新的理解高度,这就是它给你的回报.” ——Danica McKellar 数学是很难的科学,但因为它是科学家用数学来解释宇宙的语言,我们无可避免的要学习它.看看下面的这些 GIF 动图,它们提供了视觉的方式来帮助你理解各种数学技巧. 1.椭圆的画法 2.杨辉三角问题(Pascal triangles)解法 3.使用“FOIL”轻松的解决二项式乘法 4.对数解法技巧 5.矩阵转置的技巧 6.勾股定理 7.多边形的外角之和总是等于 36…
$arr=array("50","30","20"); //这里简单列出三个数 $pro = array_sum($arr); // 概率数组的总精度 foreach ($arr as $key=>$value){ $randnum = mt_rand(1,$pro); if($randnum<=$value){ $res = $value; //这里是中奖的时候,一般$res会赋值和其概率相对应的奖品 break; }else {…
http://acm.hust.edu.cn/vjudge/problem/viewProblem.action?id=18546 题意:有n个人会去超市,其中只有r个人会买东西,每个人独自买东西的概率会给出,问这一群人去买东西,第i个人属于r之中的概率是多少 思路:首先得了解什么是条件概率. 条件概率:事件A在事件B成立的基础上再成立的概率,公式为:P(A|B)=P(A*B)/P(B) 可以照着题目案例1进行分析: 输入 0.10 0.20 0.30 输出 0.413043 0.739130…
---恢复内容开始--- http://acm.hust.edu.cn/vjudge/problem/viewProblem.action?id=31471 题意,两辆火车,分别会在[t1,t2],[s1,s2]的时间段停留在同一个站点w分钟,问两辆火车能够在这个站点相遇的概率. 思路,枚举每一种情况,把两辆火车的相交区间画出来,然后求都在这个区间的概率 #include"iostream" #include"cstdio" #include"cmath&…
J - 数论,质因数分解 Time Limit:1000MS     Memory Limit:32768KB     64bit IO Format:%I64d & %I64u Submit Status Description Tomorrow is contest day, Are you all ready? We have been training for 45 days, and all guys must be tired.But , you are so lucky compa…
I - 数论,线性方程 Time Limit:1000MS     Memory Limit:32768KB     64bit IO Format:%I64d & %I64u Submit Status Description The Sky is Sprite. The Birds is Fly in the Sky. The Wind is Wonderful. Blew Throw the Trees Trees are Shaking, Leaves are Falling. Love…
D - 期望 Time Limit:2000MS     Memory Limit:32768KB     64bit IO Format:%lld & %llu Submit Status Description You are in a cave, a long cave! The cave can be represented by a 1 x N grid. Each cell of the cave can contain any amount of gold. Initially y…
H - 数论,晒素数 Time Limit:1000MS     Memory Limit:32768KB     64bit IO Format:%I64d & %I64u Submit Status Description 小明对数的研究比较热爱,一谈到数,脑子里就涌现出好多数的问题,今天,小明想考考你对素数的认识.  问题是这样的:一个十进制数,如果是素数,而且它的各位数字和也是素数,则称之为“美素数”,如29,本身是素数,而且2+9 = 11也是素数,所以它是美素数.  给定一个区间,你…
G - 数论,最大公约数 Time Limit:1000MS     Memory Limit:32768KB     64bit IO Format:%I64d & %I64u Submit Status Description There is a hill with n holes around. The holes are signed from 0 to n-1. A rabbit must hide in one of the holes. A wolf searches the r…
http://download.csdn.net/download/wz619899442/8405297 https://www.amazon.com/Introduction-Automata-Theory-Languages-Computation/dp/0321455363/ref=sr_1_4?ie=UTF8&qid=1509688992&sr=8-4&keywords=John+Hopcroft Books The course is mostly self-conta…
Bryce1010模板 10.1数论初步 1.欧几里得算法和唯一分解定理 2.Eratosthenes筛法 补充素数筛选 const int MAXN=1e6+10; ll prime[MAXN]; void getPrime(int maxn) { memset(prime,0,sizeof(prime)); for(int i=2;i<=maxn;i++) { if(!prime[i])prime[++prime[0]]=i; for(int j=i;j<=prime[0]&&am…
Description Tomorrow is contest day, Are you all ready? We have been training for 45 days, and all guys must be tired.But , you are so lucky comparing with many excellent boys who have no chance to attend the Province-Final. Now, your task is relaxin…