avatar
菠菜输了!09的# EB23 - 劳工卡
e*e
1
只问了三个大问题,因为中间电话断了一次,耽误了时间,而且第一道题没答出来,
555
1. Array of capital letters (A-Z),how to find the first non-repeating
letter in this array. For example, an array of CBCWB. How to print out "W"?
这个估计大家都会吧?我没有答出来,sigh
2.Probabilities. 3 colors of balls, blue, red and yellow, there are a large
number of each color of balls which are distributed evenly. Ask what's the
probability to get 3 balls which are all red color? What's probability to
get 3 balls which are red, blue and yellow?
3.There is a spread s
avatar
Y*L
2
PD必须发包子!!!
avatar
r*o
3
第2题是不是两个概率都是1/9?
第3题查min是不是maintain一个max heap,动态更新
查mean怎么弄?

?
large

【在 e**e 的大作中提到】
: 只问了三个大问题,因为中间电话断了一次,耽误了时间,而且第一道题没答出来,
: 555
: 1. Array of capital letters (A-Z),how to find the first non-repeating
: letter in this array. For example, an array of CBCWB. How to print out "W"?
: 这个估计大家都会吧?我没有答出来,sigh
: 2.Probabilities. 3 colors of balls, blue, red and yellow, there are a large
: number of each color of balls which are distributed evenly. Ask what's the
: probability to get 3 balls which are all red color? What's probability to
: get 3 balls which are red, blue and yellow?
: 3.There is a spread s

avatar
s*r
4
第二题应该不是吧, 我算的1/27, 2/9, 不知道是否正确

【在 r****o 的大作中提到】
: 第2题是不是两个概率都是1/9?
: 第3题查min是不是maintain一个max heap,动态更新
: 查mean怎么弄?
:
: ?
: large

avatar
d*e
5
我觉得都是1/27,因为总数是一个很大的数,
所以概率总是1/3,取三只球都是 1/3 * 1/3 * 1/3 = 1/27
不知对不对

【在 s*****r 的大作中提到】
: 第二题应该不是吧, 我算的1/27, 2/9, 不知道是否正确
avatar
r*o
6
对,我觉得应该都是1/27, 我开始算错了。

【在 d**e 的大作中提到】
: 我觉得都是1/27,因为总数是一个很大的数,
: 所以概率总是1/3,取三只球都是 1/3 * 1/3 * 1/3 = 1/27
: 不知对不对

avatar
b*a
7
第二道题明显是
all red: 1/3 * 1/3 * 1/3 = 1/27
one color each = 1/27 * 3! = 2/9
avatar
r*o
8
这个应该是对的,多谢。

【在 b********a 的大作中提到】
: 第二道题明显是
: all red: 1/3 * 1/3 * 1/3 = 1/27
: one color each = 1/27 * 3! = 2/9

avatar
s*r
9
第二种情况顺序会变啊

【在 d**e 的大作中提到】
: 我觉得都是1/27,因为总数是一个很大的数,
: 所以概率总是1/3,取三只球都是 1/3 * 1/3 * 1/3 = 1/27
: 不知对不对

avatar
d*e
10
看不懂第二个,可以解释一下吗?谢谢

【在 r****o 的大作中提到】
: 这个应该是对的,多谢。
avatar
d*e
11
好像明白了,谢谢

【在 s*****r 的大作中提到】
: 第二种情况顺序会变啊
avatar
c*n
12
if all the balls are picked in one shot, the possibilities are different.
If they are picked one by one, then the above possibility is right
avatar
b*y
13
1. Use bit map to record the number of time one char appeared in the
string,
then follow the sequence of string chars, the first one that has value of
1
is the output.
2. 1/27, the second problem need to ask if the sequence of 3 colors
matters,
if not, 2/9, if yes, 1/27
3. Is he asking you to use Excel? since it says it's spreadsheet.
if so, I would say sort the list will get the min and max value
immediately,
and average would be sum()/count(), and updated average will be
((original_
count*orig
avatar
e*e
14
第一题我也不知道答案,不过对于CS的同学来说应该是很简单的字符串题目吧
第二题是1/27 and 2/9
第三题,我一开始也是用排序。但是后来他说如果不能排序的情况怎么办,那就每次都
把min储存在另外一个cell,然后每输入一个新值就跟这个stored min value比较,这
样就可以不用每次都go through every value而得到min。average同理。
avatar
l*y
15
第二题的2/9是怎么来的呀,谁能详细解释一下,多谢了!
avatar
s*g
16
谢谢楼主分享!楼主最后一题还是答得很漂亮的!祝好运!
avatar
s*g
17
6种情况:
red blue yellow
red yellow blue
blue red yellow
blue yellow red
yellow red blue
yellow blue red
他们各自出现的概率都是 1/3 * 1/3 * 1/3 = 1/27
6* 1/ 27 = 2/9

【在 l*******y 的大作中提到】
: 第二题的2/9是怎么来的呀,谁能详细解释一下,多谢了!
avatar
l*y
18
多谢解答!

【在 s*********g 的大作中提到】
: 6种情况:
: red blue yellow
: red yellow blue
: blue red yellow
: blue yellow red
: yellow red blue
: yellow blue red
: 他们各自出现的概率都是 1/3 * 1/3 * 1/3 = 1/27
: 6* 1/ 27 = 2/9

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