I think Aerospacefag's question is clear enough. If the spheres don't even break from the 100th floor, there still is a minimum tries you need even to arrive at that answer, as it is if they break from the first. Come on, just think as a programmer and the problem is trivial...
Speaking of programming, on to my question:
Code
int f(int n) { int x; for (x = 0; n > x; x++) n -= 2*x; return x; }
It computes:
⌈√n⌉ ( =ceil(sqrt(n)) )
NIL DIFFICILE VOLENTI
Edited by midtskogen - Wednesday, 04.09.2013, 05:37
I'd wager that a large percentage of us have no experience or even aptitude in that area.
All right. Think like a scientist, then. Dropping a sphere is an experiment, and seeing whether it breaks is an observation. You want to do as few experiments as possible. Either because you're lazy or just pragmatic, or because an experiment costs a million dollar each.
NIL DIFFICILE VOLENTI
Edited by midtskogen - Wednesday, 04.09.2013, 08:21
Tomorrow you shake hands with two people. The day after, each of those two people shake hands with two more people. This process repeats every day. Roughly how long would it take for everyone on Earth to shake hands? (There are about 7 billion people.)
INSUFFICIENT DATA FOR MEANINGFUL ANSWER.
After a few days a lot of those handshakes are going to be towards people that have already shook hands with someone, and some countries will take a long time to reach. If the handshake begins in a western country, most of Europe, the Middle East, the USA, Canada, Australia, New Zealand, Japan, and South Korea will have shook hands after a year, but places like Nigeria will probably be untouched. After 10 years, assuming every is still shaking the hand of two different people per day, the handshake will probably have reached most of Latin America, Africa, India, China, Siberia, and just about any well-populated settlement in every country. However, there will likely still be many untouched remote villages, and the handshake will probably only have reached about 99% of the Earth's population. Any longer timescale will have to take into account macroeconomic predictions for every country i.e. Subsaharan countries industrializing and becoming popular targets for incoming western handshaking businessmen in 2045 A.D. Also, handshakes are not going to be exchanged between the people of this island and the rest of the world any time soon, so we can simplify your question to "how long will it take everyone on that remote island to shake hands?". The time frame for that, however, is so long that you'll also have to specify whether or not your original question includes people who shook hands on Earth but later left for the Martian/ Moon colonies. This is also ignoring the cultural meanings of a handshake which may ensure that handshakes are directed towards already-handshaked people rather than new people who don't want to receive a handshake.
Quote (werdnaforever)
1 epoch: ends at 10^-43
I was under the impression that the Planck epoch ends at exactly the Planck time, not at exactly 10^-43 seconds? Wikipedia says "from zero to approximately 10−43 seconds (Planck time)." In which case the only suitable answer to the blank is anything equivalent to "0*Tp, where Tp is the Planck time in seconds" such that the answer reads "10^0*Tp seconds"
Quote (werdnaforever)
4 Medium: Can a triangle have more than 180 degrees? Yes or no, and if yes then explain under what circumstances.
Yes, but only in non-Euclidian geometry. Three points on the surface of a sphere connected by great circle segments are not a triangle in Euclidian geometry.
Quote (Aerospacefag)
What is the minimum amount of spheres you have to trow out of the window(s) to find this out?
Best case scenario: 2. You start by chance on the floor one floor below, drop one, and it doesn't work. You move one floor up, and it does. Worst case scenario: 7. to guarantee you find it in as few drops as possible no matter what floor your choose and what floor it's on: An idealized algorithm would attempt to rule out as many floors as possible per drop. The best option for this is to start from the middle at 50 (ruling out 1-49 or 50-100), then going halfway between your current floor and a boundary. The boundaries for the first round are 1 if the ball broke and 100 if it did not. On every other round the boundary is in the same direction you moved before (if the result is unchanged) or the floor of the previous round (if the result changed). Repeat until you have found the two adjacent floors for which the upper breaks the sphere and the lower does not. For example, if the lowest breaking floor is 32 the algorithm will find "50, 25, 37, 31, 34, 32". This algorithm requires five, six, or seven spheres depending on how it rounds, as 100*(1/2)^x drops below 1 for x=7. That is to say the algorithm is always guaranteed, regardless of rounding method, to find an answer after 7 spheres.
Quote (midtskogen)
Code
int f(int n) { int x; for (x = 0; n > x; x++) n -= 2*x; return x; }
I'm not quite familiar with this particular syntax, could you explain clearly how this works?
From my limited experience with javascript, it seems to be telling the program to subtract from n 2x from all integer x's between 0 and n, exclusive, and then round up. That is to say, n - SUM(x=0,n-1,2x)=n-2[(n-1)^2+(n-1)]/2=n-(n^2-2n+1+n-1)=n-n^2+n=2n-n^2, then ceiling(2n-n^2). What am I missing?
EDIT: Nevermind, I read "return x" as "return n". When the problem reads "return x" you have to find the smallest integer x such that sum(k=0,x,2k)>n for all n. This sum can be simplified, leading to x^2+x>n. Since this has to work at infinite n, we can discard the x^1 and get x^2>n or x>sqrt(n). Therefore x is the first integer after sqrt(n).
Edited by Gondor2222 - Wednesday, 04.09.2013, 09:44
Hard question: Having gone back in time, __ _____ casually gives a patient a pill allowing her to grow a new ______ after casually making the remark "what is this, the ____ ____?"
Quote (werdnaforever)
This one's hard since it's a specific part of a specific movie (which is the only hint I'll give). I want to know if anyone else can get this though...
It's one of my favourite movies, so pretty easy for me: Having gone back in time, dr. McCoy casually gives a patient a pill allowing her to grow a new kidney after casually making the remark "what is this, the Dark Ages?"
But since you don't have any information on when it's going to break, you can't know that you should use this method.
Quote (Gondor2222)
Worst case scenario
Yes, it's a variation of binary search. For n floors, you can then always find the answer with ⌊log2n⌋+1 spheres in this case (remember that we don't even know if it will break from the top floor).
In the case when the number or floors is infinite, there is no of course no minimum number of squares, but it's still likely that you wont need many. If the lowest floor from which it breaks is n, then you'll need 2⌊log2n⌋+2 spheres, I believe. You would then start at 1st floor and double until it breaks, then do binary search.
Quote (Gondor2222)
When the problem reads "return x" you have to ...
Perfect reasoning and the right way to prove what it does! To clarify, though, x is incremented after n -= 2*x. This is equivalent: for (x = 0; n > x; n -= 2*x++);
The algorithm can easily be adapted to round the other way.
NIL DIFFICILE VOLENTI
Edited by midtskogen - Wednesday, 04.09.2013, 11:43
It's one of my favourite movies, so pretty easy for me: Having gone back in time, dr. McCoy casually gives a patient a pill allowing her to grow a new kidney after casually making the remark "what is this, the Dark Ages?"
Where do you guys even get this stuff? Wikipedia or from purely thinking about it? Anyway, you said that the spheres could break from a fall of 100 floors, so 1 experiment, as it breaks from a fall of 100 floors, right? Or do you mean it can break from a fall of less? Then I'd do luck. When I encounter a problem I don't really know anyway to solve, I just get scared. You guys are complete geniuses! I'm just going to stop the score, as I'm certain that you guys are just going to maul me in the intelligence area. So, here is ME asking the big question: Where do you guys get this stuff?! I want to be as smart as you guys!
Anyway, you said that the spheres could break from a fall of 100 floors, so 1 experiment, as it breaks from a fall of 100 floors, right? Or do you mean it can break from a fall of less?
He means that somewhere in that building is a lowest possible floor which will break the sphere. You have to find out what floor that is while testing a minimum of spheres.
Quote (Spyro)
Where do you guys get this stuff?!
Everything I see just looks made up by the posters.
Quote (Spyro)
You guys are complete geniuses!
Not sure I would agree; coming up with a riddle or some kind of math problem doesn't make someone a genius.
All forum users, please read this! My SE mods and addons Phenom II X6 1090T 3.2 GHz, 16 GB DDR3 RAM, GTX 970 3584 MB VRAM
Knowledge is clay, and intelligence is how you sculpt it. To get either of them takes, among other things, time. Despite the ever-increasing rate at which we can find new information, you're still only 13- you haven't had as long as some of us. You have most of your life still ahead of you including your teenage years... and trust me, enjoy your childhood while it lasts.
Quote (HarbingerDawn)
Not sure I would agree; coming up with a riddle or some kind of math problem doesn't make someone a genius.
Well, it depends on the math problem. Einstein was a genius... but you're right of course.
Hey, I'm 12 years old, so could you ask me some questions too? I want to test my intelligence as well. Pop culture allowed too, but not very hard questions about that.
To get either of them takes, among other things, time.
Intelligence is predominantly an inherent trait, so you either have a lot of intelligence or you don't, there's not much you can do to affect it either way. Knowledge on the other hand is open to anyone; to what degree is determined largely by intelligence.
All forum users, please read this! My SE mods and addons Phenom II X6 1090T 3.2 GHz, 16 GB DDR3 RAM, GTX 970 3584 MB VRAM
Anyway, you said that the spheres could break from a fall of 100 floors, so 1 experiment, as it breaks from a fall of 100 floors, right? Or do you mean it can break from a fall of less? Then I'd do luck.
Ok, that's really enough for +1 pts, but not for more, because real answer requires abstracting from probability.
(Original conditions had eggs instead these spheres, because I can't imagine what kind of eggs it could be)
So, there's the full answer from me :
It is very simple to determine the minimum height of drop: if you drop it from position above that mark, sphere breaks, if from lower - it does not. For example if the answer is 45, you can only figure this out by dropping it from 45 and 44 floors.
+1 pts - 1 or 2 drops. Easy mode, if it is possible for sphere to break even falling from 1st floor, it is only 1 throw, but that would be too easy, right? This is usually not a variant as it has no practical meaning.
+2 pts - 98 drops. Normal mode. It is implied that range of floors is from 2 to 99, because floors 100 and 1 are out of range. So, for minimum reliable result we have to test every floor from 2 to 99 to find out, and number of throws always will be between 2 and 98.
+3 pts - 7 drops. Hard mode, a programmer's version, with optimized algorithm aka "finding lion in the desert". 1. Drop 1 sphere from floor 50. If it doesn't break the answer is between 50 and 100, if does, it's 1<<50. 2. We split the remaining interval in 2 equal parts (1<<25 and 26<<50 or 50<<75 and 75<<100) 3. Here's the tricky part: repeat 2 until last interval is only 1 floor. This will be the answer. 26 = 64 < 100 < 128 = 27
+4 pts - 2 drops Quantum bogosort algorithm. 1. Drop sphere from random floor. If it breaks, destroy the entire universe. 2. Drop it from the floor below it. If it does not break, destroy the entire universe. 3. The universes that survive, have the right answer.
Ok, here's another puzzle. Anyone can have a go. Remember to put answers in spoiler tags.
Let's say I give you 1000 coins and 10 jars. Your task will be to distribute the coins into these jars and seal them, so that if I ask for any number of these coins, you shall be able to give me one or more jars that together contain the number of coins that I asked for. Can it be done, and how would you distribute the coins?
I think I might have the first part right: 1: 1c 2: 1c 3: 2c 4: 5c 5: 10c 6: 20c But if I were to go on, I wouldn't use all 1000 coins. So I don't know.
Quote (Billy Mayes)
Hey, I'm 12 years old, so could you ask me some questions too? I want to test my intelligence as well. smile Pop culture allowed too, but not very hard questions about that.
Easy: What is the name of the game I largely enjoy involving evolution? Medium: How much daily Calcium does an entire large bag of Goldfish have in it? Hard: What did I name my art project?