Redian新闻
>
访问学者怎么给孩子买保险?
avatar
访问学者怎么给孩子买保险?# Parenting - 为人父母
j*y
1
如何产生一个 单位圆内的 uniform distribution 呢?
多谢.
avatar
m*a
2
朋友带4岁孩子来访学半年,怕生病,想卖便宜点的保险,求推荐。学校推荐的太贵。
avatar
f*e
3
你学数学的应该很在行啊?!

【在 j*****y 的大作中提到】
: 如何产生一个 单位圆内的 uniform distribution 呢?
: 多谢.

avatar
w*t
4
半年而已,扛过去吧!
反正美国什么病毒感冒流感什么的?
都是让你回家扛,不给药的

【在 m***a 的大作中提到】
: 朋友带4岁孩子来访学半年,怕生病,想卖便宜点的保险,求推荐。学校推荐的太贵。
avatar
M*5
5
#include "math.h"
double UniDisCircle(){
while(true){
double m = rand();
double n = rand();
double t = m*m + n*n;
if( r <= 1.0 )
return sqrt(t);
}
}

【在 j*****y 的大作中提到】
: 如何产生一个 单位圆内的 uniform distribution 呢?
: 多谢.

avatar
n*p
6
其实比较厉害的流感还是要吃药, tamiflu. 今年冬天我们家很壮观的四口人一起吃
tamiflu.

【在 w********t 的大作中提到】
: 半年而已,扛过去吧!
: 反正美国什么病毒感冒流感什么的?
: 都是让你回家扛,不给药的

avatar
j*y
7
惭愧 :)

【在 f*****e 的大作中提到】
: 你学数学的应该很在行啊?!
avatar
w*t
8
怎么判断是流感厉害还是人太弱?哈哈

【在 n***p 的大作中提到】
: 其实比较厉害的流感还是要吃药, tamiflu. 今年冬天我们家很壮观的四口人一起吃
: tamiflu.

avatar
j*y
9
多谢 。
不过这个只能产生 1/4 个圆内的吧, 负数坐标出不来阿.

【在 M********5 的大作中提到】
: #include "math.h"
: double UniDisCircle(){
: while(true){
: double m = rand();
: double n = rand();
: double t = m*m + n*n;
: if( r <= 1.0 )
: return sqrt(t);
: }
: }

avatar
n*p
10
Good point. 其实还是看医生的化验结果,查出来是甲型流感就给开药方去抓药。

【在 w********t 的大作中提到】
: 怎么判断是流感厉害还是人太弱?哈哈
avatar
l*i
11
generate r and theta, then use (r,theta), polar coordinate?
avatar
g*9
12
一般这种保险copay比较高,50,100的,而urgent care walk in起价大概100左右。
实际点,小病找学医的咨询咨询,
大病直接上emergency,账单么,慢慢付好了。

【在 m***a 的大作中提到】
: 朋友带4岁孩子来访学半年,怕生病,想卖便宜点的保险,求推荐。学校推荐的太贵。
avatar
M*5
13
你最后的结果是要二维的还是一维的?如果是一维的话只能是这样的吧?要是结果是二
维的也还蛮好改的。。。
#include "math.h"
struct Coordinate{
int x;
int y;
};
int sign(){
double n = rand();
if( n<=0.5 )
return -1;
else
return 1;
}
Coordinate UniDistCircle(){
Coordinate co;
while(true){
double m = rand();
double n = rand();
double t = m*m + n*n;
if( t<=1.0){
co.x = sign()*m;
co.y = sign()*n;
return co;
}
}
}

【在 j*****y 的大作中提到】
: 多谢 。
: 不过这个只能产生 1/4 个圆内的吧, 负数坐标出不来阿.

avatar
w*e
14
赌一下不会有需要住院的话,看几次医生自己付钱比买保险便宜,当然,这个几次不好
说。
avatar
j*y
15
thanks.

【在 l***i 的大作中提到】
: generate r and theta, then use (r,theta), polar coordinate?
avatar
b*0
16
可以买旅行保险吧。我在华人上看到说“万国游踪”理赔还挺痛快的,价格也不贵。
avatar
j*y
17
thanks.

【在 M********5 的大作中提到】
: 你最后的结果是要二维的还是一维的?如果是一维的话只能是这样的吧?要是结果是二
: 维的也还蛮好改的。。。
: #include "math.h"
: struct Coordinate{
: int x;
: int y;
: };
: int sign(){
: double n = rand();
: if( n<=0.5 )

avatar
m*a
18
谢谢大家的回付,朋友人比较谨慎,差不多一个月100左右就行。

【在 b******0 的大作中提到】
: 可以买旅行保险吧。我在华人上看到说“万国游踪”理赔还挺痛快的,价格也不贵。
avatar
l*b
19
reject sampling吧,感觉有限步uniform distribution太难

【在 j*****y 的大作中提到】
: 如何产生一个 单位圆内的 uniform distribution 呢?
: 多谢.

avatar
p*i
20
check for your state's Medicaid.

【在 m***a 的大作中提到】
: 谢谢大家的回付,朋友人比较谨慎,差不多一个月100左右就行。
avatar
M*5
21
我写的代码就是基于reject sampling的想法的

【在 l*******b 的大作中提到】
: reject sampling吧,感觉有限步uniform distribution太难
avatar
X*r
22
很多旅行保险赔付上限不高,就没有多大意义,买的时候要注意。

【在 m***a 的大作中提到】
: 谢谢大家的回付,朋友人比较谨慎,差不多一个月100左右就行。
avatar
f*n
23
No. You can't just use uniform distribution for r, because that way it will
be too concentrated in the middle and too spread out at the edge.
r needs to be weighted to the higher numbers. Specifically, the probability
distribution of r needs to be P(r) = 2r. So that at r = 1, it is twice as
likely as at r = 0.5. This is because dx dy = r dr dθ in polar coordinates.
To do that you can use inverse transform sampling http://en.wikipedia.org/
wiki/Inverse_transform_sampling). The cumulative distribution of r is r^2.
Therefore, to generate r with the correct distribution, you need to take
sqrt(rand()).

【在 l***i 的大作中提到】
: generate r and theta, then use (r,theta), polar coordinate?
avatar
k*a
25
generate random number r1, X=2*(r1-0.5)
generate random number r2, Y=2*(r2-0.5)
if X^2+Y^2<1 then return (X, Y)
avatar
p*l
27
uniform on the sphere can be generated by normaling gaussian
so
x = randn(2,1) (inverse cdf * rand(2,1))
then x/\|x\| will do

【在 j*****y 的大作中提到】
: 如何产生一个 单位圆内的 uniform distribution 呢?
: 多谢.

avatar
b*e
28
It's just {r: sqrt(rand()), \theta: rand()*2*PI} in polar notation.

【在 l*******b 的大作中提到】
: reject sampling吧,感觉有限步uniform distribution太难
avatar
P*b
29
这个好像x^2 + y^2 总是小于等于1的吧。

【在 k*******a 的大作中提到】
: generate random number r1, X=2*(r1-0.5)
: generate random number r2, Y=2*(r2-0.5)
: if X^2+Y^2<1 then return (X, Y)

相关阅读
logo
联系我们隐私协议©2024 redian.news
Redian新闻
Redian.news刊载任何文章,不代表同意其说法或描述,仅为提供更多信息,也不构成任何建议。文章信息的合法性及真实性由其作者负责,与Redian.news及其运营公司无关。欢迎投稿,如发现稿件侵权,或作者不愿在本网发表文章,请版权拥有者通知本网处理。