由买买提看人间百态

boards

本页内容为未名空间相应帖子的节选和存档,一周内的贴子最多显示50字,超过一周显示500字 访问原贴
JobHunting版 - all my baozi for people can give some answer to the question
相关主题
最近面经经常见的一题问个面试题
网上看到一道题 求O(n)的解法一道微软题
一道Facebook面经难题问一道google面试题(from careercup)
再讨论一个面试难题一个精华区的算法题
大家帮忙看看这个4sum怎么就不对非递归求二叉树高度,除了按层次遍历的方法,还可以怎么做?
给定一个值和sorted队列,找到所有pair(其和等于给定值)做道有序数组元素求最大和题?
Amazon first round phone interviewYoung Tableau如何找出前n个最小元素?
面试题算法一问
相关话题的讨论汇总
话题: gloves话题: question话题: answer话题: hand话题: what
进入JobHunting版参与讨论
1 (共1页)
c********t
发帖数: 4527
1
a bag has 9 pairs of gloves in the two colors red or green (a pair consist
of two gloves with the same color, left and right).
What's the minimal number of gloves if I pull out from the bag, that I
know that the gloves I pull out from bags are pairs.
There is a follow up question once we have it answered.
i**9
发帖数: 351
2
isn't it 10?
c********t
发帖数: 4527
3
how?
reasons?
thanks

【在 i**9 的大作中提到】
: isn't it 10?
B*****g
发帖数: 34098
4
1. 拿10个一定有一个是一双出来的。
2. 拿9个不一定有一双,比如拿了9个左手。

【在 c********t 的大作中提到】
: how?
: reasons?
: thanks

m****u
发帖数: 229
5
choosewhat,
My answer is 2 gloves are needed to satsify the min requirement of same
color and one left hand and one right hand glove.
But I agree with icn9's answer.
your question is so misleading or my English fails.
Is this your freshman course homework?
c********t
发帖数: 4527
6
hehe,
I guess yours as suck as mine.
I don't get what you are saying neither.
Let's focus on the question.
If the answer 10 means that at least that you have a pair at hand
sure, but I am not sure that's the question about.
then what color (red, green) applies here in the question?

【在 m****u 的大作中提到】
: choosewhat,
: My answer is 2 gloves are needed to satsify the min requirement of same
: color and one left hand and one right hand glove.
: But I agree with icn9's answer.
: your question is so misleading or my English fails.
: Is this your freshman course homework?

m****u
发帖数: 229
7
I said 2 because 2 gloves are needed to make a pair. And yes, i know the
chance of geetting 2 gloves that are in the same color and one is left hand
one and another is right hand one is less than 100% which means this can
happen but it doesn't always happen.
And I think based on your wording, the color and left/right hand info are
not important, I think it's just a way to misguide me.
icn9's answer promises you a pair of gloves with the same color and one is
right hand and one is left hand at the chance of 100%.
My answer doesn't promise 100% but it does have a slim chance to see it from
happening. When I read your wording I dont think you didn't ask for it to
happen 100%, you just want to have a chance to get it happen.
h***n
发帖数: 276
8
抽屉原理阿,就是10乐 (9+1),最少的数目保证一定有配对的

【在 c********t 的大作中提到】
: how?
: reasons?
: thanks

c********t
发帖数: 4527
9
what's 抽屉原 in English?
If it is 抽屉原, the question is so simple.
Maybe the question is
"How many gloves that I need to pull out from bag so that I am sure that
AT LEAST that I have pair at hand"
if so it is 抽屉原 and the answer is 10 no matter what

【在 h***n 的大作中提到】
: 抽屉原理阿,就是10乐 (9+1),最少的数目保证一定有配对的
c********t
发帖数: 4527
10
what's 抽屉原 in English?
If it is 抽屉原, the question is so simple.
Maybe the question is
"How many gloves that I need to pull out from bag so that I am sure that
AT LEAST that I have pair at hand"
if so it is 抽屉原 and the answer is 10 no matter what

【在 h***n 的大作中提到】
: 抽屉原理阿,就是10乐 (9+1),最少的数目保证一定有配对的
h***n
发帖数: 276
11
in English, it is called "pigeonhole principle"

【在 c********t 的大作中提到】
: what's 抽屉原 in English?
: If it is 抽屉原, the question is so simple.
: Maybe the question is
: "How many gloves that I need to pull out from bag so that I am sure that
: AT LEAST that I have pair at hand"
: if so it is 抽屉原 and the answer is 10 no matter what

c********t
发帖数: 4527
12
thanks

【在 h***n 的大作中提到】
: in English, it is called "pigeonhole principle"
1 (共1页)
进入JobHunting版参与讨论
相关主题
算法一问大家帮忙看看这个4sum怎么就不对
C++ STL好像没有hashtable,大家需要的时候咋弄的?给定一个值和sorted队列,找到所有pair(其和等于给定值)
请问一个老的google题Amazon first round phone interview
一道google面试题的讨论面试题
最近面经经常见的一题问个面试题
网上看到一道题 求O(n)的解法一道微软题
一道Facebook面经难题问一道google面试题(from careercup)
再讨论一个面试难题一个精华区的算法题
相关话题的讨论汇总
话题: gloves话题: question话题: answer话题: hand话题: what