Google And The Puzzle of Dropping Eggs Google et le puzzle de l'abandon des oeufs
Google is also known for its interesting interview questions. Google est également connu pour ses intéressantes questions. Enjoy this one and my solution. Profitez de celui-ci et ma solution. Suppose you have two eggs. Supposons que vous disposez de deux oeufs. These are special eggs—they can take much more punishment than you average chicken egg. Ces sont des oeufs-ils peuvent prendre beaucoup plus que vous la peine moyenne d'oeufs de poules. The question is exactly just how much punishment can they take? La question est de savoir exactement à quel point la peine peuvent-ils prendre?
Using a 100 storey building and only the two eggs, how would you find out which is the highest floor of the building you can drop the eggs from, before they break? L'utilisation d'un 100 étages et seules les deux œufs, comment pouvez-vous savoir qui est le plus haut étage de l'immeuble que vous pouvez faire glisser les oeufs de, avant de rompre?It could be the 1st floor but it could also be the 99th floor—you don’t know but to test, you need to try dropping the eggs from different floors and see what happens. Il pourrait être le 1er étage, mais il pourrait aussi être la 99e étage, vous ne sais pas, mais pour tester, vous devez essayer d'abandonner les oeufs de différents étages et voir ce qui se passe.
via SitePoint par SitePoint
Are you done yet? Êtes-vous déjà fait? My solution is simple. Ma solution est simple.
Use binary search with one egg till it breaks. Utilisation de recherche binaire avec un oeuf jusqu'à ce qu'il casse. Use linear search with the second egg till it breaks. Utilisez la recherche linéaire avec le deuxième œuf jusqu'à ce qu'il casse. And you have the solution. Et vous avez la solution. If that’s not clear enough allow me to explain. Si ce n'est pas assez clair permettez-moi d'expliquer.
First drop one egg from 50th (midway). Tout d'abord un oeuf baisse de 50e (à mi-chemin).
- If it breaks (no more binary search) then drop the second egg from first floor. Si ça casse (pas plus de recherche binaire), puis la deuxième chute de l'œuf premier étage. Move up one floor at a time till it breaks. Monter un étage à un moment jusqu'à ce qu'il casse.
- If it doesn’t break then drop it from 75th floor. Si elle ne se brise pas le laisser tomber puis de 75ème étage.
- If it breaks then drop the second egg from 76th floor. Si il se casse alors la deuxième chute de l'œuf 76e étage. Move up one floor at a time till it breaks. Monter un étage à un moment jusqu'à ce qu'il casse.
- If it doesn’t break then drop it from the 87th floor… Si elle ne se brise pas le laisser tomber puis de la 87 e étage…
I hope you get the picture by now. J'espère que vous obtenez l'image maintenant. I would love to see anyone coming with a better optimized solution. J'aimerais voir quelqu'un venir avec une meilleure solution optimisée.
Update: The optimization is to minimize the number of drops. Mise à jour: L'optimisation est de minimiser le nombre de gouttes.
Filed under Classé sous Google , Headline News Headline News , How To Comment , Web | |
| |
RSS 2.0 RSS 2,0 | |
Trackback this Article | cet article |
Email this Article Envoyer cet article
You may also like to read Vous mai également à lire |



June 10th, 2006 at 12:24 pm Juin 10th, 2006 à 12:24 pm
wouldn’t you drop it from the 51st instead of the 76th floor on the second round? ne pas vous laisser tomber de la 51 e au lieu de la 76e étage sur le deuxième tour? if the first broke on 75, then it’s between 51 and 74 inclusive that you need to check now si la première a éclaté sur 75, alors il est entre 51 et 74 inclus que vous devez vérifier maintenant
June 10th, 2006 at 5:41 pm Juin 10th, 2006 at 5:41 pm
I spent a long time typing a detailed explanation of a solution but I lost it in a browser mishap. J'ai passé un long temps de taper une explication détaillée d'une solution, mais je l'ai perdu dans un accident de navigation. But, here is my solution, without the explanation: drop egg #1 at every 10th (0, 10, 30, 50…) floor, and drop egg #2 at every 20th floor (20, 40, 60…), until one breaks. Mais, voici ma solution, sans l'explication: baisse # 1 œuf à chaque 10 (0, 10, 30, 50…) étage, et déposez l'oeuf # 2 à tous les 20 e étage (20, 40, 60…), jusqu'à un pauses. Then, drop one egg on every odd numbered floor and the other on every even numbered floor until one breaks. Ensuite, déposez un oeuf sur chaque étage impaires et l'autre sur toutes les paires jusqu'à un étage pauses. Then, you will have the answer to the question of “what is the lowest floor on which the egg will break?” Ensuite, vous aurez la réponse à la question de «ce qui est le plus bas plancher sur lequel l'oeuf se briser?"
If you analyze the two solutions with respect to the number of drops, you will see that this alternative has the same best-case performance, and notably better worst-case performance, always wins when the answer is within (10,50) when, and often wins (but sometimes loses) when the answer is greather than 50. Si vous analysez les deux solutions en ce qui concerne le nombre de gouttes, vous verrez que cette alternative a la même meilleure performance cas, et notamment mieux le pire des cas, les performances, remporte toujours le cas où la réponse est dans (10,50) lorsque, et gagne souvent (mais perd parfois) le cas où la réponse est greather que 50.
If you analyze the two solutions with respect to travel time/effort going up/down the building, then I believe that the alternative’s advantage is even better. Si vous analysez les deux solutions en ce qui concerne le temps de déplacement / effort en cours haut / bas de l'immeuble, alors je crois que les autres l'avantage, c'est encore mieux. Your solution ignores travel time, but I imagine you’d do it the same way I did (travel up, drop one, travel up again, drop the other, then travel down to get both). Votre solution ne tient pas compte du temps de déplacement, mais je vous imaginer faire la même manière je ne l'ai (frais de voyage, une baisse, les voyages à nouveau, abandonner les autres, puis rendez-vous à obtenir les deux).
I don’t know if the alternative solution is optimal; I was just trying to show a better alternative. Je ne sais pas si la solution est optimale; j'étais juste essayer de montrer une meilleure alternative. I too am interested in a better solution. Je suis également intéressé par une meilleure solution.
June 11th, 2006 at 7:17 am Juin 11, 2006 at 7:17 am
@a @ une
That depends on whether your floor numbering starts from 0 (ground floor) or 1 (first floor). Cela dépend de si votre plancher de numérotation commence à 0 (rez-de-chaussée) ou 1 (premier étage).
@Brian Brian @
I am sorry to hear your explanation got lost. Je suis désolé d'entendre vos explications se sont perdus. I would love to hear it. J'aimerais l'entendre.
> Then, drop one egg on every odd numbered floor and the other on every even numbered floor until one breaks. > Ensuite, déposez un oeuf sur chaque étage impaires et l'autre sur toutes les paires jusqu'à un étage pauses.
At this point one has already broken. À ce stade, une a déjà éclaté. If your second egg breaks too then you do not have any more eggs to find the exact floor. Si votre second oeuf pauses trop alors vous n'avez pas plus d'oeufs afin de trouver exactement la parole.
Also why use two eggs at ood and even floors? Aussi, pourquoi utiliser des oeufs à deux et même ois étages? Why not simply use one egg? Pourquoi ne pas simplement utiliser un oeuf? We are limited by only two eggs. Nous sommes limités par seulement deux œufs. So shouldn’t we keep the second egg to pinpoint the exact floor? Il en va de même pas nous tenir la deuxième oeuf à localiser avec précision l'exacte parole?
June 12th, 2006 at 12:37 am Juin 12, 2006 at 12:37 am
You are right; I copied my wording from the 10/20 part absent-mindedly. Vous avez raison, je copie mon texte de la partie absente 10/20-esprit. Once the first egg breaks, you should drop the second one from every floor, increasing the floor number by one, just as in your case. Une fois que le premier œuf pauses, vous devriez laisser tomber la seconde de chaque étage, de plus en plus la parole par un nombre, tout comme dans votre cas.
However, my main point was that it is better to go every 10th floor then to try the “binary search” you described. Cependant, mon principal point est qu'il est préférable d'aller tous les 10e étage puis à juger les "binaires de recherche" vous décrit. Your search is highly optimized for when the answer is a floor over 75 and it performs very poorly for high floors less than 50. Votre recherche est fortement optimisé pour le cas où la réponse est une parole de plus de 75 ans et il joue très mal pour les étages de moins de 50.
The reason for the “every 10th floor / every 20th floor” logic is to minimize travel time. La raison de la "10e étage tous / toutes les 20 e étage" logique est de minimiser le temps de déplacement. Let’s say that the answer is “22.” Then, I would drop egg #1 from floor 10, it would not break. Disons que la réponse est "22." Ensuite, je voudrais déposer des oeufs # 1 du sol 10, il se brise pas. Then, I can go up to floor 20 and drop egg #2 from floor 20, and it does not break. Ensuite, je peux aller jusqu'à 20 étage et déposez l'oeuf n ° 2 du sol 20, et il ne se brise pas. Then I need to go down and pick up both eggs, and take them both to floor 30. Ensuite, j'ai besoin d'aller vers le bas et ramasser les oeufs, et prendre tous les deux au sol 30. At this point I have traveled 10+10+20+30=70 flights of stairs. À ce stade, j'ai parcouru 10 +10 +20 +30 = 70 volées d'escaliers.
If travel time is not an issue, then you could just go up to floor 10, drop egg #1, go down to pick it up, carry it up to floor 20, drop it again, go down to pick it up, go up to floor 30 etc. In this case you would just keep egg #2 in your pocket until egg #1 breaks. Si le temps de déplacement n'est pas une question, vous pourriez aller jusqu'à étage 10, baisse des oeufs # 1, descendre à le ramasser, transporter jusqu'à 20 plancher, déposez-le à nouveau, allez vers le bas pour le ramasser, monter au sol 30 etc Dans ce cas, vous ne cessent d'oeufs # 2 dans votre poche jusqu'à ce que l'oeuf # 1 pauses. This method would require traveling 10+10+20+20+30=90 flights of stairs to get to floor 30. Cette méthode nécessiterait voyage 10 +10 +20 +20 +30 = 90 volées d'escaliers pour se rendre à étage 30. This is the kind of detail that interviewers would probably be interested in at least hearing about-they’d also probably like you to at least ask if the eggs will weaken structurally as you drop them. C'est le genre de détail que les enquêteurs seraient probablement intéressées dans au moins entendu parler-they'd aussi probablement comme vous à au moins demander si les œufs affaiblir structurellement comme vous le déposez-les.
Note also that I chose “10″ arbitrarily: I was just trying a better solution, not the optimal one. Notez aussi que j'ai choisi "10" par hasard: Je viens d'essayer une meilleure solution, pas la solution optimale.
June 22nd, 2006 at 4:35 am Juin 22, 2006 at 4:35 am
What about N floors? Qu'en est-il de N étages?
Is 10 a good choice since it’s the sqrt of 100? 10 est un bon choix car c'est la racine carrée de 100?
What about using a binary search on floors i=1, 2, 4, 8, 16, 32, 64, … and then a linear search for the floors inbetween? Qu'en est-il de l'aide d'un binaire de recherche sur les planchers i = 1, 2, 4, 8, 16, 32, 64,… et puis un linéaire de recherche pour les planchers inbetween?
A solution for 36 floors is here: Une solution de 36 étages est ici:
http://mathforum.org/wagon/past_solns/s921.html
Using the fact that 36 is the 8th triangular number, ie 36 = 1 + 2 + … + 8 En utilisant le fait que 36 est la 8 e nombre triangulaire, c'est-à-dire 36 = 1 + 2 +… + 8
June 22nd, 2006 at 8:04 am Juin 22, 2006 at 8:04 am
If you know the height of the building then I think the jump search is optimum using sqrt(h) as your jump size, but if the height of the building is unknown then I’m really not sure. Si vous connaissez la hauteur du bâtiment alors je pense que le saut de recherche est optimale en utilisant sqrt (h) de votre saut taille, mais si la hauteur du bâtiment est inconnu alors je suis vraiment pas sûr. Triangular numbers, fibonnaci, or binary. Nombres triangulaires, fibonnaci, ou binaire. Binary search on floors i=1, 2, 4, 8, 16, 32, 64, … covers a lot of ground quickly with the first egg. Binaires de recherche sur les planchers i = 1, 2, 4, 8, 16, 32, 64,… un couvre beaucoup de terrain rapidement avec le premier œuf.
November 4th, 2006 at 4:02 am 4 novembre 2006 à 4:02 am
hei…just a simple math problem hei… juste un simple problème de mathématiques
suppose we jump every N floors, and use second egg in the one step increasing pinpoint. Supposons que nous sauter toutes les N étages, et l'utilisation deuxième oeuf dans une étape de plus en plus identifier.
MaxNumbers = 100/N + (N-1) MaxNumbers = 100 / N + (N-1)
To get the Max N we take a derivative: Pour obtenir le N Max nous prenons un dérivé:
-100/N^2 + 1 = 0 => N = 10 -100 / N ^ 2 + 1 = 0 => N = 10
So we take 1st egg every 10 floors, then second egg one by one to pinpoint. Donc, nous prenons 1er œuf tous les 10 étages, puis la seconde à oeufs un par un pour identifier.
Worse case: 19 Pire cas: 19
Average case: 10. Moyenne des cas: 10.
November 30th, 2006 at 1:43 am Novembre 30th, 2006 at 1:43 am
Say X is the number we are looking for. Say X est le nombre que nous recherchons. Then, my choice will start with floor X first. Ensuite, mon choix de commencer par X parole en premier. This way, if the egg breaks, I start a linear search starting from 1 to X-1, guaranteeing a solution in Y attempts. De cette façon, si l'oeuf les pauses, je commence une recherche linéaire à partir de 1 à X-1, garantissant une solution en Y tentatives. Otherwise, I go to X + (X-1) floor…. Sinon, je vais à X + (X-1)… parole. Continuing in this way, with X attempts, I can cover sum(X + X-1 + X-2… 2 + 1) floors. Continuant dans cette voie, avec X tentatives, je peux couvrir somme (X + X-1 + X-2… 2 + 1) étages. Hence, we are looking for Min X such that X(X+1)/2 > 100. Par conséquent, nous recherchons pour min X tel que X (X +1) / 2> 100.
I can do it in 14 Je peux le faire en 14
October 4th, 2007 at 3:57 pm 4 octobre 2007 à 3:57 pm
I ran into this problem recently and am looking for a solution… it seems there are many J'ai rencontré ce problème récemment et je suis à la recherche d'une solution… il semble qu'il y sont nombreux
I don’t have a formal proof of this, but a gut feeling tells me my solution is good/pretty close to optimal (and it’s nice to have Jason Southgate’s agreement, I think he’s describing the same solution?). Je n'ai pas de preuve formelle de cela, mais une intuition me dit que ma solution est bien ou assez proches de façon optimale (et il est agréable d'avoir Jason Southgate l'accord, je pense qu'il le décrit la même solution? ).
Algorithm (assumes we know the number of floors): Algorithme (suppose que nous connaissons le nombre d'étages):
* Number of floors = N * Nombre d'étages N =
* Drop the first egg at floor 1 * sqrt(N), 2 * sqrt(N), … until you either reach N or it breaks. * Drop the premier œuf à étage 1 * sqrt (N), 2 * sqrt (N),… jusqu'à ce que vous atteindre soit N ou ça casse. If you drop it from the top floor without it breaking you have your answer. Si vous déposez de l'étage supérieur sans briser vous avez votre réponse.
* If it breaks when dropped from k * sqrt(N) floor then drop the second egg, starting at the (k - 1) * sqrt(N) floor and going up one floor at a time until it breaks. * Si il se casse en tombant de k * sqrt (N) alors étage baisse la deuxième oeuf, à partir de (k - 1) * sqrt (N) et de parole allant jusqu'à un étage à un moment jusqu'à ce qu'il casse. By definition it must break sometime before k * sqrt(N) Par définition, il faut rompre quelque temps avant k * sqrt (N)
I think this algorithm is O(N^0.5) - the maximum number of drops it can take is sqrt(N) + (sqrt(N) - 2). Je pense que cet algorithme est O (N ^ 0,5) - le nombre maximum de gouttes cela peut prendre est sqrt (N) + (sqrt (N) - 2). This would occur if it broke on the N-1′th floor. Cela se produirait si elle a éclaté sur la N-1'th parole.
Two interesting extensions of it would be: what if the number of floors doesn’t have an integer square root? Deux extensions intéressant de celui-ci serait la suivante: qu'en est-il si le nombre d'étages ne possède pas une racine carrée entier? Eg if N = 378? Par exemple, si N = 378? It seems there are three alternatives for the size of the increment of the first egg drops - the floor, ceiling or round of sqrt(N). Il semble qu'il y existe trois options pour la taille de l'augmentation du premier oeuf sera en baisse - le sol, plafond ou série de sqrt (N). I’m not certain of my answer but I think using the round would be optimal? Je suis pas sûr de ma réponse mais je crois en utilisant le cycle serait la meilleure?
The second extension is what to do in the case of an unknown number of floors, where N is just some integer (1…infinity). La deuxième extension est ce qu'il faut faire dans le cas d'un nombre inconnu d'étages, où N est quelques-unes entier (1 infini…). sqrt(infinity) just doesn’t make sense, and it seems to me that if any integer is equiprobable (sp?) then you want to leap up towards infinity as fast as possible, so you get a known upper bound and then just have a linear search. sqrt (infini) ne suffit pas de sens, et il me semble que si un nombre entier est équiprobables (sp?), vous voulez bond vers l'infini dans les plus brefs délais, de sorte qu'on a appelé une limite supérieure, puis suffit une recherche linéaire. But I have no way of expressing this formally or in any convincing way, I’m just pumping intuitions madly! Mais je n'ai aucun moyen d'exprimer officiellement ou dans toute façon convaincante, je suis juste de pompage intuitions fou!
All this fancy reasoning said though I think the triangle number solution linked to above is actually better. Tout cela dit fantaisie raisonnement si je pense que le nombre triangle solution liés ci-dessus est effectivement mieux. I’m just not sure how you would generalise it to situations where N is not a triangular number. Je suis pas sûr comment vous généraliser à des situations où N est pas un nombre triangulaire.
Binary search would be O(log N) though… hmmm, OK, now I’m confused and lack all certainty, but what the heck, other things to do this morning, I’ll post anyway Binaires de recherche serait O (log n) si… hmmm, OK, maintenant je suis confus et l'absence de certitude tous, mais ce que le diable, d'autres choses à faire ce matin, je posterai de toute façon
Christo
PS: A point I didn’t consider till now: if you’ve checked all but two possible floors and break the egg on the second to last possible floor then you still have your answer… Again, not sure and no time to see if this is important! PS: Un point que je ne considère pas jusqu'à maintenant: si vous avez vérifié tous les deux, mais la mesure du possible les sols et les sortir de l'œuf sur l'avant-dernier étage possible puis vous avez toujours votre réponse… Une fois encore, pas sûr et pas de temps pour voir si c'est important!
October 5th, 2007 at 5:13 pm 5 octobre 2007 à 5:13 pm
The original puzzle doesn’t say what they’re trying to optimize, so I assume the optimization variable is left to the solver. Le casse-tête d'origine ne dit pas ce qu'ils êtes en train d'essayer d'optimiser, donc je suppose l'optimisation variable est laissée à la résolution de contraintes.
Personally, I would optimize for minimal egg breaks by starting on floor 1 and going up one floor at a time until it breaks. Personnellement, je optimiser pour un minimum de pauses par œuf à partir du 1 er étage et en remontant un étage à un moment jusqu'à ce qu'il casse. In the end you’d be left with your answer and one unbroken egg. En fin de vous laisser de votre réponse et un œuf intact. Any egg that can survive a drop from more than 1 story would be a very valuable egg indeed, and get you a lot of money on ebay! Tout œuf qui peut survivre à une chute de plus de 1 histoire serait un très précieux oeuf en effet, et vous obtenez beaucoup d'argent sur ebay!
October 6th, 2007 at 11:42 am Octobre 6th, 2007 at 11:42 am
The optimization is for minimizing the number of drops. L'optimisation est de réduire au minimum le nombre de gouttes.
October 16th, 2007 at 12:42 am Octobre 16th, 2007 at 12:42 am
For goodness sake. Par souci de bonté. The egg will break when dropped from the first floor because, well, it’s an egg. L'oeuf se briser en tombant du premier étage parce que, bon, c'est un œuf.
I say cook the two eggs for breakfast and move onto the next question! Je dis faire cuire les deux oeufs pour le petit déjeuner et passer à la question suivante!
November 2nd, 2007 at 11:21 pm 2 novembre 2007 à 11:21 PM
@Christo Fogelberg execellent explanation and generalisation for optimizing the no of attempts. @ Christo Fogelberg execellent explication et la généralisation d'optimiser le no de tentatives.
but ofcourse you can match sqrt(n)(how did you find this?) from duduqin solution. mais bien sûr vous pouvez faire correspondre sqrt (n) (comment avez-vous trouvé?) de duduqin solution.
it is like : c'est comme:
no of steps = n pas de mesures n =
let us assume x = no of steps between two attempts Supposons que x = pas de mesures entre deux tentatives
and y = total no of attempts with first egg (maximum) et y = nombre total de tentatives de premier œuf (maximum)
so we get si nous obtenons
x*y = n x * y = n
and now no of attempt = y + x -1 (or y + x not sure) et maintenant pas de la tentative = x + y -1 (ou x + y pas sûr)
so for min(y + x - 1) si pour min (x + y - 1)
derivative(y + x -1) = 0 dérivés (y + x -1) = 0
so you get x = y = sqrt(n) from here. de sorte qu'on a x = y = sqrt (n) d'ici.
Now we can go with your solution. Maintenant, nous pouvons aller avec votre solution.
I dont know what to do when it is required to optimize not the no of attemps but the total no of steps travelled(going up to some floor and coming down to collect the egg(s) and in the same way). Je ne sais pas quoi faire quand il est nécessaire d'optimiser pas le pas, mais essaye de nombre total de mesures parcourue (en remontant dans une certaine parole à venir et à recueillir l'ovule (s) et de la même façon).
Please put your views. S’il vous plaît mettez votre point de vue.
December 4th, 2007 at 4:24 am 4 décembre 2007 à 4:24 am
Well because the questions is based upin eggs (fragile), we need to include the non-algorithmic parameters as well. Eh bien parce que les questions se fonde UPIN oeufs (fragile), nous avons besoin d'inclure la non-algorithmique paramètres ainsi.
Looking at the question statement, nothing is mentioned about the material on which it is to be dropped & the place where it should be dropped. Si l'on examine la question déclaration, rien n'est mentionné sur le document sur lequel il doit être supprimé et le lieu où il doit être supprimé. In those cases the egg could also be dropped on to the same floor from any height. Dans ces cas, l'œuf peut être aussi tomber sur le même étage de toute taille.
December 4th, 2007 at 9:20 pm 4 décembre 2007 à 9:20 pm
Obviously it is being dropped to the ground otherwise the question becomes meaningless. De toute évidence, il est tombé au sol autrement la question devient vide de sens. What non-algorithmic parameters are you talking about? La non-algorithmique paramètres parlez-vous?
The task is to determine at which height (divisible by height of each floors which are of equal height) the egg breaks. La tâche est de déterminer à quel hauteur (divisible par la taille de chaque étages qui sont d'égale hauteur) l'œuf se casse. The material of egg is unknown but obviously it is made of stronger material than your regular poultry egg. Le matériau à base d'œufs est inconnue, mais évidemment il est fait de matériaux plus forte que vos oeufs de volailles.
December 14th, 2007 at 11:48 am Décembre 14, 2007 at 11:48 am
One idea is that you want to maintain a constant risk throughout the drops to guarantee an equal average- and worst-case. Une idée est que vous voulez maintenir une constante tout au long de risque les gouttes de garantir une égalité de moyenne-et le pire des cas.
With the strategy of skipping a constant number of floors \ Avec la stratégie de sauter un nombre constant d'étages \
January 18th, 2008 at 1:36 pm 18 janvier 2008 à 1:36 pm
I found this page again randomly while checking nothing too noxious was being attributed to me on Google, it sounds like the discussion has moved on so I figure I\’ll add to it again J'ai trouvé cette page au hasard tout en vérifiant rien trop nuisibles a été attribuée à moi sur Google, il semble que le débat a évolué donc je figure I \ 'll ajouter à nouveau,
@Dhananjay: @ Dhananjay:
Yes, going back now and reading duduqin\’s reasoning I see it is a specific example for n=100 of the general case. Oui, pour en revenir maintenant et de la lecture duduqin \ 's raisonnement je vois qu'il s'agit d'un exemple précis pour n = 100 du cas général.
You are also right that I did not explain why sqrt(n) was optimal - and in fact, as I think I noted, I\’m still not sure that it is! Vous êtes aussi bon que je ne l'ai pas expliqué pourquoi sqrt (n) est optimale - et en fait, comme je pense que j'ai noté, I \ 'm toujours pas sûr que c'est!
In any case, I don\’t think derivatives factor into it. En tout cas, je n \ 't pense dérivés en facteur. Perhaps they do but I\’m not sure what you\’re deriving with respect to. Peut-être qu'ils font mais je \ 'm pas sûr de ce que vous \' re découlant à l'égard de. I agree x = y and that the maximum number of attempts will be n=xy and that you can get sqrt(n) from that but I\’m still a little bit confused. Je suis d'accord x = y et que le nombre maximum de tentatives seront n = xy et que vous pouvez obtenir sqrt (n) de cela, mais je \ 'm encore un peu confus. Sorry! Désolé! Also, what does the min function in min(x + y - 1) refer to or mean? Aussi, qu'est-ce que la fonction min en min (x + y - 1) se réfèrent à la moyenne?
###########
@dkaminski: @ dkaminski:
I haven\’t thought about this much, but I think you\’re right - it would be interesting to look at the expectation distribution. Je havre \ 't pensée à propos de cette grand-chose, mais je pense que vous \' re droit - il serait intéressant de se pencher sur l'attente de distribution. Any further thoughts? Toute autre opinion? (I have none right now:) (Je n'en ont pas pour le moment:)
Actually, talking of expectation, a cute wee problem with plenty of off-by-1 and off-by-k chances that a friend and I ended up talking about over dinner recently goes something like this: En fait, en parlant d'attente, un adorable petit problème avec beaucoup de hors-par-1 et hors-par-k chances qu'un ami et j'ai fini par parler récemment au cours d'un dîner va quelque chose comme ceci:
You have a bag with 50 lengths of string inside it. Vous avez un sac avec 50 longueurs de corde intérieur de celui-ci.
You pull out one end of one piece of string, leaving the rest of that piece in the bag. Vous sortez une fin d'un morceau de ficelle, en laissant le reste de cette pièce dans le sac. You pull out a second end of string, possibly the end of a different piece of string and possibly the other end of the piece of string you\’re already holding. Vous tirez à une deuxième fin de chaîne, peut-être la fin d'un autre morceau de ficelle et peut-être l'autre extrémité du bout de ficelle vous \ 're est déjà titulaire. You tie the two ends together before dropping them back in the bag. Vous attacher les deux extrémités avant de les ramener dans le sac.
After all the ends have been tied to some other end, what is the expected number of loops in the bag? Après les extrémités ont été liées à un autre extrémité, quel est le nombre de boucles dans le sac?
OK, it\’s Friday night, there\’s jazz and cocktails on and if I\’m not going to go to that I should really be doing something more productive. OK, il \ 's vendredi soir, il y \' s jazz et des cocktails et si I \ 'm ne vais pas à que je devrais vraiment faire quelque chose de plus productif. Cheerio all! Cheerio tous!
xto