Redian新闻
>
请问斑竹班花以及各位同仁怎样才可以确认relink成功啊?
avatar
请问斑竹班花以及各位同仁怎样才可以确认relink成功啊?# EB23 - 劳工卡
m*1
1
1.如何判断Anagram
2.一个file有1billion个数字,找到top15
3.有一个unfair的coin,出现head的概率是1/4, 出现tail的概率是3/4,有个对应的返
回值为boolean的function,当是head的时候返回true,是tail返回false,现在,你如
何利用原有方程,再写一个function,使得返回true和false的概率一样。。
这个面试真是纠结,本来约星期一,等了一个小时没打来,今天再面,面试官说没找到
电话号码= =Groupon的电话估计质量有问题。。今天断线了三次。。最近题目做得真不
少了。。。真的希望顺利啊。。
avatar
H*9
2
昨天收到 SR 回复之后就不再淡定了Your case is still pending consideration. We
regret that we are not able to give you a timeframe for when we will
complete the review of your case.
看到大多数伙伴们收到的回复都知道relink成功了,我收到的回复什么信息也没有。书
面信6月1号就寄到了。昨晚再写了email 到uscis followup的邮箱。今天打了1-800-
375-5283,也没有结果。我联系了一个参议员一个众议员动作都很慢,现在都不知道他
们把request send 到uscis没有。
请问还有其他途径可以知道是否relink成功吗?infopass能知道relink是否成功吗?议
员可以天天打电话骚扰吗?
本人是9/12的pd, 现在极度焦虑中啊,食无味,寝不安…
avatar
P*b
3
这三题怎么做?

【在 m*****1 的大作中提到】
: 1.如何判断Anagram
: 2.一个file有1billion个数字,找到top15
: 3.有一个unfair的coin,出现head的概率是1/4, 出现tail的概率是3/4,有个对应的返
: 回值为boolean的function,当是head的时候返回true,是tail返回false,现在,你如
: 何利用原有方程,再写一个function,使得返回true和false的概率一样。。
: 这个面试真是纠结,本来约星期一,等了一个小时没打来,今天再面,面试官说没找到
: 电话号码= =Groupon的电话估计质量有问题。。今天断线了三次。。最近题目做得真不
: 少了。。。真的希望顺利啊。。

avatar
p*2
5
1. if rand==head return head
2. if rand==head return head
3. if rand==head && rand==head return head
else return tail
avatar
H*9
6
斑竹,谢谢你的快速回复!不过我还是不是很明白。你给我的link,提到了EB2,至少很
明确他是relink成功了,我的什么信息都没有啊,感觉象系统自动回复。我到底relink
上了没有啊?我是NSC的
再次感谢!
avatar
e*s
7
if(rand == head) return head;
if(rand == head) return head;
return tail;
就行了吧? 1/4 + 1/4 = 1/2;

【在 p*****2 的大作中提到】
: 1. if rand==head return head
: 2. if rand==head return head
: 3. if rand==head && rand==head return head
: else return tail

avatar
c*e
8
我的SR回复也看不出来有没有relink成功,email followup也没回复,打了电话也说系
统里看不出来,不过说帮我再request. 看来只能等了。。。。:(

We

【在 H*******9 的大作中提到】
: 昨天收到 SR 回复之后就不再淡定了Your case is still pending consideration. We
: regret that we are not able to give you a timeframe for when we will
: complete the review of your case.
: 看到大多数伙伴们收到的回复都知道relink成功了,我收到的回复什么信息也没有。书
: 面信6月1号就寄到了。昨晚再写了email 到uscis followup的邮箱。今天打了1-800-
: 375-5283,也没有结果。我联系了一个参议员一个众议员动作都很慢,现在都不知道他
: 们把request send 到uscis没有。
: 请问还有其他途径可以知道是否relink成功吗?infopass能知道relink是否成功吗?议
: 员可以天天打电话骚扰吗?
: 本人是9/12的pd, 现在极度焦虑中啊,食无味,寝不安…

avatar
x*0
9
mark
avatar
B*t
10
跟我的一个模板

We

【在 H*******9 的大作中提到】
: 昨天收到 SR 回复之后就不再淡定了Your case is still pending consideration. We
: regret that we are not able to give you a timeframe for when we will
: complete the review of your case.
: 看到大多数伙伴们收到的回复都知道relink成功了,我收到的回复什么信息也没有。书
: 面信6月1号就寄到了。昨晚再写了email 到uscis followup的邮箱。今天打了1-800-
: 375-5283,也没有结果。我联系了一个参议员一个众议员动作都很慢,现在都不知道他
: 们把request send 到uscis没有。
: 请问还有其他途径可以知道是否relink成功吗?infopass能知道relink是否成功吗?议
: 员可以天天打电话骚扰吗?
: 本人是9/12的pd, 现在极度焦虑中啊,食无味,寝不安…

avatar
s*l
11
这样返回tail的概率是(3/4)*(3/4) = 9/16吧?

【在 e***s 的大作中提到】
: if(rand == head) return head;
: if(rand == head) return head;
: return tail;
: 就行了吧? 1/4 + 1/4 = 1/2;

avatar
H*9
12
你收到的回复跟我一样吗?

【在 B****t 的大作中提到】
: 跟我的一个模板
:
: We

avatar
j*2
13
请问面的哪个office?
thx

【在 m*****1 的大作中提到】
: 1.如何判断Anagram
: 2.一个file有1billion个数字,找到top15
: 3.有一个unfair的coin,出现head的概率是1/4, 出现tail的概率是3/4,有个对应的返
: 回值为boolean的function,当是head的时候返回true,是tail返回false,现在,你如
: 何利用原有方程,再写一个function,使得返回true和false的概率一样。。
: 这个面试真是纠结,本来约星期一,等了一个小时没打来,今天再面,面试官说没找到
: 电话号码= =Groupon的电话估计质量有问题。。今天断线了三次。。最近题目做得真不
: 少了。。。真的希望顺利啊。。

avatar
y*0
14
我的意思就是说你收到类似这样的回复,才说明你relink成了,其他的回复看不出来。

relink

【在 H*******9 的大作中提到】
: 斑竹,谢谢你的快速回复!不过我还是不是很明白。你给我的link,提到了EB2,至少很
: 明确他是relink成功了,我的什么信息都没有啊,感觉象系统自动回复。我到底relink
: 上了没有啊?我是NSC的
: 再次感谢!

avatar
p*2
15



【在 s*****l 的大作中提到】
: 这样返回tail的概率是(3/4)*(3/4) = 9/16吧?
avatar
H*9
16
你打的电话是T2吗?我打1-800-375-5283什么都不肯说。打1-800-375-5283这个电话是
不是T1接,然后再要求转T2呢?

【在 c*****e 的大作中提到】
: 我的SR回复也看不出来有没有relink成功,email followup也没回复,打了电话也说系
: 统里看不出来,不过说帮我再request. 看来只能等了。。。。:(
:
: We

avatar
h*i
17
1/4 + 3/4 * 1/4 + 3/4 * 3/4 * 1/4 * 1/4
不对吧?

【在 p*****2 的大作中提到】
: 1. if rand==head return head
: 2. if rand==head return head
: 3. if rand==head && rand==head return head
: else return tail

avatar
H*9
18
谢谢斑竹!悲伤中。。。

【在 y******0 的大作中提到】
: 我的意思就是说你收到类似这样的回复,才说明你relink成了,其他的回复看不出来。
:
: relink

avatar
p*2
19

我得意思是可以继续下去,

【在 h***i 的大作中提到】
: 1/4 + 3/4 * 1/4 + 3/4 * 3/4 * 1/4 * 1/4
: 不对吧?

avatar
c*e
20
就是这个号码,然后接线员帮我转给一个immigration officer,应该就是T2吧,不过
也没问出什么来。。。

【在 H*******9 的大作中提到】
: 你打的电话是T2吗?我打1-800-375-5283什么都不肯说。打1-800-375-5283这个电话是
: 不是T1接,然后再要求转T2呢?

avatar
h*i
21
其实可以这样,一个while loop,扔两次,如果是TF,就返回T,如果是FT,返回F,剩下
的两种情况重新来。

【在 p*****2 的大作中提到】
:
: 我得意思是可以继续下去,

avatar
H*9
22
谢谢!祝我们都好运!

【在 c*****e 的大作中提到】
: 就是这个号码,然后接线员帮我转给一个immigration officer,应该就是T2吧,不过
: 也没问出什么来。。。

avatar
R*1
23
是,我也觉得不对

【在 h***i 的大作中提到】
: 1/4 + 3/4 * 1/4 + 3/4 * 3/4 * 1/4 * 1/4
: 不对吧?

avatar
B*t
24
On 05/14/2015, you or your representative contacted USCIS concerning your
I485 to notify us that you believe your case is outside of our normal
processing time. Below is a summary of what we found and how the issue has
been or may be resolved.
Your petition/application is still pending consideration. We regret that we
are not able to give you a timeframe for when we will complete the review of
your petition/application.
What You Can Do
Please see the "Online Services" below to check the status of your case in
the near future. We apologize for the delay.
We hope this information is helpful to you.

【在 H*******9 的大作中提到】
: 你收到的回复跟我一样吗?
avatar
h*n
25
额...会死循环吧...

【在 h***i 的大作中提到】
: 其实可以这样,一个while loop,扔两次,如果是TF,就返回T,如果是FT,返回F,剩下
: 的两种情况重新来。

avatar
H*9
26
我的回复和你一摸一样,我是5月26号做的SR,我想是不是6月1号之前做的SR都是这样
的回复呢?但是我收到回复已经是6月9号,按理已经current了

we
of

【在 B****t 的大作中提到】
: On 05/14/2015, you or your representative contacted USCIS concerning your
: I485 to notify us that you believe your case is outside of our normal
: processing time. Below is a summary of what we found and how the issue has
: been or may be resolved.
: Your petition/application is still pending consideration. We regret that we
: are not able to give you a timeframe for when we will complete the review of
: your petition/application.
: What You Can Do
: Please see the "Online Services" below to check the status of your case in
: the near future. We apologize for the delay.

avatar
h*i
27
如果你不相信概率的话,这两种情况发生的可能性占6/16,循环个3次就差不多出来了。

【在 h*****n 的大作中提到】
: 额...会死循环吧...
avatar
f*t
29
可能性比较小

【在 h*****n 的大作中提到】
: 额...会死循环吧...
avatar
e*s
30
我错了,我是猪

【在 e***s 的大作中提到】
: if(rand == head) return head;
: if(rand == head) return head;
: return tail;
: 就行了吧? 1/4 + 1/4 = 1/2;

avatar
p*2
31

这个不错。我的那个是继续扔,最后可以非常接近1/2。

【在 h***i 的大作中提到】
: 其实可以这样,一个while loop,扔两次,如果是TF,就返回T,如果是FT,返回F,剩下
: 的两种情况重新来。

avatar
p*2
32

如果继续扔,最后可以非常接近1/2。当然没有LS的方法好了。

【在 R******1 的大作中提到】
: 是,我也觉得不对
avatar
h*i
33
你这个需要算级数了。

【在 p*****2 的大作中提到】
:
: 如果继续扔,最后可以非常接近1/2。当然没有LS的方法好了。

avatar
b*u
34
恩,优点是能解决任意的uneven coin
缺点是最坏情况无穷久

【在 h***i 的大作中提到】
: 其实可以这样,一个while loop,扔两次,如果是TF,就返回T,如果是FT,返回F,剩下
: 的两种情况重新来。

avatar
b*u
35
我的方法:
rand1= rand;
rand2= rand;
rand3= rand;
rand4= rand;
if ((rand1==tail&&rand2==tail)&&!(rand3==head &&rand4==head))
return tail
else
return head;
3/4*3/4-1/4*1/4 = 1/2

【在 p*****2 的大作中提到】
: 1. if rand==head return head
: 2. if rand==head return head
: 3. if rand==head && rand==head return head
: else return tail

avatar
p*e
36
概率能相减的?这样可以不
if(rand() || rand())
return head;
return tail;

【在 b*****u 的大作中提到】
: 我的方法:
: rand1= rand;
: rand2= rand;
: rand3= rand;
: rand4= rand;
: if ((rand1==tail&&rand2==tail)&&!(rand3==head &&rand4==head))
: return tail
: else
: return head;
: 3/4*3/4-1/4*1/4 = 1/2

avatar
d*s
37
FT/TF其余循环肯定没问题,楼上的概率不能相减,第一个为真第二个必然为真
avatar
i*n
38
这样可以不
rand1=rand();
rand2=rand();
if((rand1==head && rand2==tail)||(rand1==tail && rand2==head))
return head;
return tail;

【在 p****e 的大作中提到】
: 概率能相减的?这样可以不
: if(rand() || rand())
: return head;
: return tail;

avatar
B*t
39
这个不行吧。返回head的概率是6/16啊

【在 i****n 的大作中提到】
: 这样可以不
: rand1=rand();
: rand2=rand();
: if((rand1==head && rand2==tail)||(rand1==tail && rand2==head))
: return head;
: return tail;

avatar
g*g
40
不要去这家。 活多久都是问题。
avatar
c*t
41
我怎么感觉是3/4*3/4*(1-1/4*1/4)呢?

【在 b*****u 的大作中提到】
: 我的方法:
: rand1= rand;
: rand2= rand;
: rand3= rand;
: rand4= rand;
: if ((rand1==tail&&rand2==tail)&&!(rand3==head &&rand4==head))
: return tail
: else
: return head;
: 3/4*3/4-1/4*1/4 = 1/2

avatar
e*s
42
但是这样会不会有机会永远不返回?

【在 h***i 的大作中提到】
: 其实可以这样,一个while loop,扔两次,如果是TF,就返回T,如果是FT,返回F,剩下
: 的两种情况重新来。

avatar
h*2
43
菜鸟请教各位大牛:
这个题目是不是不能精确得到1/2,只能逼近?
如果这样的话,可不可以写个random number generator(足够大),然后如果是tail,
就看得到的random number,其中的1/3的结果返回true。
avatar
t*r
44
第三题加个计数器,就可以了吧?

【在 m*****1 的大作中提到】
: 1.如何判断Anagram
: 2.一个file有1billion个数字,找到top15
: 3.有一个unfair的coin,出现head的概率是1/4, 出现tail的概率是3/4,有个对应的返
: 回值为boolean的function,当是head的时候返回true,是tail返回false,现在,你如
: 何利用原有方程,再写一个function,使得返回true和false的概率一样。。
: 这个面试真是纠结,本来约星期一,等了一个小时没打来,今天再面,面试官说没找到
: 电话号码= =Groupon的电话估计质量有问题。。今天断线了三次。。最近题目做得真不
: 少了。。。真的希望顺利啊。。

avatar
c*t
45
Zkss

★ 发自iPhone App: ChineseWeb 7.8

【在 t*********r 的大作中提到】
: 第三题加个计数器,就可以了吧?
avatar
m*1
47
1.如何判断Anagram
2.一个file有1billion个数字,找到top15
3.有一个unfair的coin,出现head的概率是1/4, 出现tail的概率是3/4,有个对应的返
回值为boolean的function,当是head的时候返回true,是tail返回false,现在,你如
何利用原有方程,再写一个function,使得返回true和false的概率一样。。
这个面试真是纠结,本来约星期一,等了一个小时没打来,今天再面,面试官说没找到
电话号码= =Groupon的电话估计质量有问题。。今天断线了三次。。最近题目做得真不
少了。。。真的希望顺利啊。。
avatar
P*b
48
这三题怎么做?

【在 m*****1 的大作中提到】
: 1.如何判断Anagram
: 2.一个file有1billion个数字,找到top15
: 3.有一个unfair的coin,出现head的概率是1/4, 出现tail的概率是3/4,有个对应的返
: 回值为boolean的function,当是head的时候返回true,是tail返回false,现在,你如
: 何利用原有方程,再写一个function,使得返回true和false的概率一样。。
: 这个面试真是纠结,本来约星期一,等了一个小时没打来,今天再面,面试官说没找到
: 电话号码= =Groupon的电话估计质量有问题。。今天断线了三次。。最近题目做得真不
: 少了。。。真的希望顺利啊。。

avatar
p*2
49
1. if rand==head return head
2. if rand==head return head
3. if rand==head && rand==head return head
else return tail
avatar
e*s
50
if(rand == head) return head;
if(rand == head) return head;
return tail;
就行了吧? 1/4 + 1/4 = 1/2;

【在 p*****2 的大作中提到】
: 1. if rand==head return head
: 2. if rand==head return head
: 3. if rand==head && rand==head return head
: else return tail

avatar
x*0
51
mark
avatar
s*l
52
这样返回tail的概率是(3/4)*(3/4) = 9/16吧?

【在 e***s 的大作中提到】
: if(rand == head) return head;
: if(rand == head) return head;
: return tail;
: 就行了吧? 1/4 + 1/4 = 1/2;

avatar
j*2
53
请问面的哪个office?
thx

【在 m*****1 的大作中提到】
: 1.如何判断Anagram
: 2.一个file有1billion个数字,找到top15
: 3.有一个unfair的coin,出现head的概率是1/4, 出现tail的概率是3/4,有个对应的返
: 回值为boolean的function,当是head的时候返回true,是tail返回false,现在,你如
: 何利用原有方程,再写一个function,使得返回true和false的概率一样。。
: 这个面试真是纠结,本来约星期一,等了一个小时没打来,今天再面,面试官说没找到
: 电话号码= =Groupon的电话估计质量有问题。。今天断线了三次。。最近题目做得真不
: 少了。。。真的希望顺利啊。。

avatar
p*2
54



【在 s*****l 的大作中提到】
: 这样返回tail的概率是(3/4)*(3/4) = 9/16吧?
avatar
h*i
55
1/4 + 3/4 * 1/4 + 3/4 * 3/4 * 1/4 * 1/4
不对吧?

【在 p*****2 的大作中提到】
: 1. if rand==head return head
: 2. if rand==head return head
: 3. if rand==head && rand==head return head
: else return tail

avatar
p*2
56

我得意思是可以继续下去,

【在 h***i 的大作中提到】
: 1/4 + 3/4 * 1/4 + 3/4 * 3/4 * 1/4 * 1/4
: 不对吧?

avatar
h*i
57
其实可以这样,一个while loop,扔两次,如果是TF,就返回T,如果是FT,返回F,剩下
的两种情况重新来。

【在 p*****2 的大作中提到】
:
: 我得意思是可以继续下去,

avatar
R*1
58
是,我也觉得不对

【在 h***i 的大作中提到】
: 1/4 + 3/4 * 1/4 + 3/4 * 3/4 * 1/4 * 1/4
: 不对吧?

avatar
h*n
59
额...会死循环吧...

【在 h***i 的大作中提到】
: 其实可以这样,一个while loop,扔两次,如果是TF,就返回T,如果是FT,返回F,剩下
: 的两种情况重新来。

avatar
h*i
60
如果你不相信概率的话,这两种情况发生的可能性占6/16,循环个3次就差不多出来了。

【在 h*****n 的大作中提到】
: 额...会死循环吧...
avatar
f*t
61
可能性比较小

【在 h*****n 的大作中提到】
: 额...会死循环吧...
avatar
e*s
62
我错了,我是猪

【在 e***s 的大作中提到】
: if(rand == head) return head;
: if(rand == head) return head;
: return tail;
: 就行了吧? 1/4 + 1/4 = 1/2;

avatar
p*2
63

这个不错。我的那个是继续扔,最后可以非常接近1/2。

【在 h***i 的大作中提到】
: 其实可以这样,一个while loop,扔两次,如果是TF,就返回T,如果是FT,返回F,剩下
: 的两种情况重新来。

avatar
p*2
64

如果继续扔,最后可以非常接近1/2。当然没有LS的方法好了。

【在 R******1 的大作中提到】
: 是,我也觉得不对
avatar
h*i
65
你这个需要算级数了。

【在 p*****2 的大作中提到】
:
: 如果继续扔,最后可以非常接近1/2。当然没有LS的方法好了。

avatar
b*u
66
恩,优点是能解决任意的uneven coin
缺点是最坏情况无穷久

【在 h***i 的大作中提到】
: 其实可以这样,一个while loop,扔两次,如果是TF,就返回T,如果是FT,返回F,剩下
: 的两种情况重新来。

avatar
b*u
67
我的方法:
rand1= rand;
rand2= rand;
rand3= rand;
rand4= rand;
if ((rand1==tail&&rand2==tail)&&!(rand3==head &&rand4==head))
return tail
else
return head;
3/4*3/4-1/4*1/4 = 1/2

【在 p*****2 的大作中提到】
: 1. if rand==head return head
: 2. if rand==head return head
: 3. if rand==head && rand==head return head
: else return tail

avatar
p*e
68
概率能相减的?这样可以不
if(rand() || rand())
return head;
return tail;

【在 b*****u 的大作中提到】
: 我的方法:
: rand1= rand;
: rand2= rand;
: rand3= rand;
: rand4= rand;
: if ((rand1==tail&&rand2==tail)&&!(rand3==head &&rand4==head))
: return tail
: else
: return head;
: 3/4*3/4-1/4*1/4 = 1/2

avatar
d*s
69
FT/TF其余循环肯定没问题,楼上的概率不能相减,第一个为真第二个必然为真
avatar
i*n
70
这样可以不
rand1=rand();
rand2=rand();
if((rand1==head && rand2==tail)||(rand1==tail && rand2==head))
return head;
return tail;

【在 p****e 的大作中提到】
: 概率能相减的?这样可以不
: if(rand() || rand())
: return head;
: return tail;

avatar
B*t
71
这个不行吧。返回head的概率是6/16啊

【在 i****n 的大作中提到】
: 这样可以不
: rand1=rand();
: rand2=rand();
: if((rand1==head && rand2==tail)||(rand1==tail && rand2==head))
: return head;
: return tail;

avatar
g*g
72
不要去这家。 活多久都是问题。
avatar
c*t
73
我怎么感觉是3/4*3/4*(1-1/4*1/4)呢?

【在 b*****u 的大作中提到】
: 我的方法:
: rand1= rand;
: rand2= rand;
: rand3= rand;
: rand4= rand;
: if ((rand1==tail&&rand2==tail)&&!(rand3==head &&rand4==head))
: return tail
: else
: return head;
: 3/4*3/4-1/4*1/4 = 1/2

avatar
e*s
74
但是这样会不会有机会永远不返回?

【在 h***i 的大作中提到】
: 其实可以这样,一个while loop,扔两次,如果是TF,就返回T,如果是FT,返回F,剩下
: 的两种情况重新来。

avatar
h*2
75
菜鸟请教各位大牛:
这个题目是不是不能精确得到1/2,只能逼近?
如果这样的话,可不可以写个random number generator(足够大),然后如果是tail,
就看得到的random number,其中的1/3的结果返回true。
avatar
t*r
76
第三题加个计数器,就可以了吧?

【在 m*****1 的大作中提到】
: 1.如何判断Anagram
: 2.一个file有1billion个数字,找到top15
: 3.有一个unfair的coin,出现head的概率是1/4, 出现tail的概率是3/4,有个对应的返
: 回值为boolean的function,当是head的时候返回true,是tail返回false,现在,你如
: 何利用原有方程,再写一个function,使得返回true和false的概率一样。。
: 这个面试真是纠结,本来约星期一,等了一个小时没打来,今天再面,面试官说没找到
: 电话号码= =Groupon的电话估计质量有问题。。今天断线了三次。。最近题目做得真不
: 少了。。。真的希望顺利啊。。

avatar
c*t
77
Zkss

★ 发自iPhone App: ChineseWeb 7.8

【在 t*********r 的大作中提到】
: 第三题加个计数器,就可以了吧?
avatar
b*l
79
我觉得第三题应该这么做:
首先扔2次不够,因为扔2次的话,组合和概率是这样的:
T T:1/16
T F: 3/16
F T: 3/16
F F: 9/16
没有一种组合可以得到8/16 = 1/2
所以必须扔3次,扔3次的组合和概率是这样的:
T T T: 1/64
T T F: 3/64
T F T: 3/64
T F F: 9/64
F T T: 3/64
F T F: 9/64
F F T: 9/64
F F F: 27/64
这里面有好几个组合可以得到32/64 = 1/2,最简单的是F T T + F F F. 最后我的解法
是:
result1 = rand();
result2 = rand();
result3 = rand();
if (!result1&&result2&&result3 || !result1&&!result2&&!result3)
return true;
else
return false;
扔4次也可以,但是没必要。
哪位大侠指教一下?
avatar
F*n
80
public boolean flip() {// the given function}
public boolean adjustment() {
if (flip()) return true;
return Math.random() < 1/3 ? true : false;
}

【在 P*******b 的大作中提到】
: 这三题怎么做?
avatar
s*s
81
这个好像是对的。

【在 b*******l 的大作中提到】
: 我觉得第三题应该这么做:
: 首先扔2次不够,因为扔2次的话,组合和概率是这样的:
: T T:1/16
: T F: 3/16
: F T: 3/16
: F F: 9/16
: 没有一种组合可以得到8/16 = 1/2
: 所以必须扔3次,扔3次的组合和概率是这样的:
: T T T: 1/64
: T T F: 3/64

avatar
r*h
82
扔两次
如果HT则返回true,如果TH则返回false
其他reject

【在 m*****1 的大作中提到】
: 1.如何判断Anagram
: 2.一个file有1billion个数字,找到top15
: 3.有一个unfair的coin,出现head的概率是1/4, 出现tail的概率是3/4,有个对应的返
: 回值为boolean的function,当是head的时候返回true,是tail返回false,现在,你如
: 何利用原有方程,再写一个function,使得返回true和false的概率一样。。
: 这个面试真是纠结,本来约星期一,等了一个小时没打来,今天再面,面试官说没找到
: 电话号码= =Groupon的电话估计质量有问题。。今天断线了三次。。最近题目做得真不
: 少了。。。真的希望顺利啊。。

avatar
t*h
83
硬凑啊 那如果p(h)=0.21454354 那你就很难凑出来了

【在 b*******l 的大作中提到】
: 我觉得第三题应该这么做:
: 首先扔2次不够,因为扔2次的话,组合和概率是这样的:
: T T:1/16
: T F: 3/16
: F T: 3/16
: F F: 9/16
: 没有一种组合可以得到8/16 = 1/2
: 所以必须扔3次,扔3次的组合和概率是这样的:
: T T T: 1/64
: T T F: 3/64

avatar
n*m
84
F T T + F F F = 30/64
1/2怎么跑出来的?

【在 b*******l 的大作中提到】
: 我觉得第三题应该这么做:
: 首先扔2次不够,因为扔2次的话,组合和概率是这样的:
: T T:1/16
: T F: 3/16
: F T: 3/16
: F F: 9/16
: 没有一种组合可以得到8/16 = 1/2
: 所以必须扔3次,扔3次的组合和概率是这样的:
: T T T: 1/64
: T T F: 3/64

avatar
u*g
85
p要是离0.5很远才会杯具,1/4这种任何practical的case下都是能接受的。。
avatar
b*l
86
不好意思,我算错了,那看来只能接近1/2, 比如 T T T + F T T + F F F.
不管扔多少次,都只能无限的逼近1/2,扔的次数越多越逼近。

【在 n**m 的大作中提到】
: F T T + F F F = 30/64
: 1/2怎么跑出来的?

avatar
n*m
87
对,凑不出来 只能reject一部分结果
扔的次数越多 reject的越少

【在 b*******l 的大作中提到】
: 不好意思,我算错了,那看来只能接近1/2, 比如 T T T + F T T + F F F.
: 不管扔多少次,都只能无限的逼近1/2,扔的次数越多越逼近。

avatar
F*n
88
public boolean adjustedRand() {
int n1 = count();
int n2 = count();
if (n1 > n2) return true;
else if (n1 < n2) return false;
return adjustedRand();
}
private int count() {
int n = 0;
while (!rand()) n++;
return n;
}
avatar
t*h
89
有限次是不行的。看证明。
flip a coin n times, each outcome has a probability 3^i/4^n, where i is the
number of heads. We can prove that no combination of the outcomes will add
up to 1/2.
Proof by contradiction:
If we multiply all the probabilities by 4^n, and think them as outcome
frequencies(integers). Please note that all the frequencies but all tails
can be divided by 3. Now the question becomes whether you can find a
combination of outcomes which has an added frequency 4^n/2.
Assume there is a way to divide the outcomes into two groups A and B, such
that freq(A) = freq(B). Again assume all tails outcome is in A, it becomes
clear that freq(B) can be divided by 3, but not freq(A). It contradicts the
equality.
avatar
b*l
90
正解!freq(B)肯定能被3整除,但是 4^n/2 一定是2的power,2的power绝对不可能被3
整除。

the

【在 t*****h 的大作中提到】
: 有限次是不行的。看证明。
: flip a coin n times, each outcome has a probability 3^i/4^n, where i is the
: number of heads. We can prove that no combination of the outcomes will add
: up to 1/2.
: Proof by contradiction:
: If we multiply all the probabilities by 4^n, and think them as outcome
: frequencies(integers). Please note that all the frequencies but all tails
: can be divided by 3. Now the question becomes whether you can find a
: combination of outcomes which has an added frequency 4^n/2.
: Assume there is a way to divide the outcomes into two groups A and B, such

avatar
i*1
91
都是书呆子。
if (rand==H)
return true
else
if (rand==H) return true
end if
1/4+1/3*3/4=1/2.
也就是初中数学题。
avatar
n*m
92
书呆子们都理解不了你这1/3从哪来的 lol

【在 i***1 的大作中提到】
: 都是书呆子。
: if (rand==H)
: return true
: else
: if (rand==H) return true
: end if
: 1/4+1/3*3/4=1/2.
: 也就是初中数学题。

avatar
i*1
93
第一题烂大街。
第二题divide and conq.
avatar
j*x
94
既然你都说是书呆子了,对应的,你也配得上智障这个称呼了。。。

【在 i***1 的大作中提到】
: 都是书呆子。
: if (rand==H)
: return true
: else
: if (rand==H) return true
: end if
: 1/4+1/3*3/4=1/2.
: 也就是初中数学题。

avatar
i*1
95
loser, 你看不懂。你也就是个ASSHOL....

【在 j********x 的大作中提到】
: 既然你都说是书呆子了,对应的,你也配得上智障这个称呼了。。。
avatar
l*y
96
扔两次为啥不够呢?
r1=rand();
r2=rand();
if(r1==h&&r2=h)
return h;
else
return t;
p(r1=h)=p(r1=t)=p(r2=h)=p(r2=t)=1/2
而且两次事件相互独立
p(r1=h&&r2=h)=p(r1)*p(r2)=1/4
avatar
m*n
97
能问问什么position吗?
avatar
m*n
98
第二题怎么做啊?

【在 m*****1 的大作中提到】
: 1.如何判断Anagram
: 2.一个file有1billion个数字,找到top15
: 3.有一个unfair的coin,出现head的概率是1/4, 出现tail的概率是3/4,有个对应的返
: 回值为boolean的function,当是head的时候返回true,是tail返回false,现在,你如
: 何利用原有方程,再写一个function,使得返回true和false的概率一样。。
: 这个面试真是纠结,本来约星期一,等了一个小时没打来,今天再面,面试官说没找到
: 电话号码= =Groupon的电话估计质量有问题。。今天断线了三次。。最近题目做得真不
: 少了。。。真的希望顺利啊。。

avatar
B*2
99
用Quick-Select

【在 m***n 的大作中提到】
: 第二题怎么做啊?
avatar
n*m
100
input output颠倒了?

【在 l*********y 的大作中提到】
: 扔两次为啥不够呢?
: r1=rand();
: r2=rand();
: if(r1==h&&r2=h)
: return h;
: else
: return t;
: p(r1=h)=p(r1=t)=p(r2=h)=p(r2=t)=1/2
: 而且两次事件相互独立
: p(r1=h&&r2=h)=p(r1)*p(r2)=1/4

avatar
l*a
101
为什么不问找最大的15个还是出现频率最高的15个

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