正在加载图片...
How to generate distributions other than the uniform one on(0, 1)? Transformation ofrandom variables 1) Uniform distribution on(a, b) et x be an uniform distribution on(0, 1), the uniform distribution on(a, b)is obtained from y=a+ (b-a)x 2) Random integers from 0 to M First divide the interval [o, 1] into N+l segments(each has a length equal to A=1/(N+D). M(O<M<N) is generated when M△<x<(M+1)△ Code Integer mran mran=(N+1)*ranoHow to generate distributions other than the uniform one on (0,1)? Transformation of random variables: 1) Uniform distribution on (a,b): Let x be an uniform distribution on (0,1), the uniform distribution on (a, b) is obtained from y=a+(b-a)x 2) Random integers from 0 to N: First divide the interval [0,1] into N+1 segments (each has a length equal to D=1/(N+1)). M (0<M<N) is generated when MD < x < (M+1)D Code: integer mran mran=(N+1)*ran()
<<向上翻页向下翻页>>
©2008-现在 cucdc.com 高等教育资讯网 版权所有