Here's a montecarlo solution to check your answers.
Printable View
Here's a montecarlo solution to check your answers.
Absolutely not! How did you get that!? :eek: n can take values between [1,k]. n can be as great as k.Quote:
Originally Posted by SolarFlare
And what do you mean with posibility vs. probability? After all, they are the same thing. And yes, I was talking in terms of probability.
If my formula is wrong please prove it. Please don't make assumption just because you didn't read my posts carefully.
Regards. :wave:
Your formula does not conform to the standards I have requested.Quote:
Originally Posted by cilu
It's possible that a helicopter just landed on your roof.Quote:
Originally Posted by cilu
Proof that I have not adequately explained the problem. A random lightswitch is toggled, and this act is repeated n-1 times for a total of n times. I sure hope your house isn't built such that you can only turn on each lightswitch once.Quote:
Originally Posted by cilu
When you say turn on a switch. That means the switch MUST be OFF. An ON switch cannot be turned ON. So, in the first phase of each step, only OFF switches can be turned ON. That's why you can always have only EVEN numbers of ON switches. If we start withQuote:
Someone turns on one of the lightswitches randomly. Then they toggle another lightswitch randomly (if it's the same one as the first one, the light goes off. This process is repeated n times (so that n total toggles are made).
00000
and in Step1, phase 1 turn a switch ON we get
10000
in Step 2, phase 1 (n=1), we toggle a switch. Than can only lead either to
00000 or to 11000
(position is not important 11000 is the same with 10001).
If in the first step, we got 11000, in step 2 (n=2), phase 1, we can only select one of the three OFF switches. So it can lead us to either
11110 or 11000
+
00000 or 11000 from configuration 00000 at the end of step 1.
NOW I SEE THAT I MISUNDERSTOOD THE PROBLEM. Well, SolarFlare, next time please be less ambiguous. :DQuote:
Proof that I have not adequately explained the problem. A random lightswitch is toggled, and this act is repeated n-1 times for a total of n times. I sure hope your house isn't built such that you can only turn on each lightswitch once.
NEW ANSWER will come soon.
PS: I have a new pyramid, but I'm looking for the formula.
1
0 1
1 0 1
0 2 0 1
2 0 3 0 1
0 5 0 4 0 1
5 0 9 0 5 0 1
...
I give up. :( There were too many exceptions thrown in my brain, I can't handle them anymore. :D
Yes, inquriing minds would like to see the answer to this.
Do you mean "n number of switches are toggled" ? You could toggle the same switch a trillion times. :eek:Quote:
Originally Posted by SolarFlare
Yeah. Well, I'll try to solve this now, two ways.Quote:
Originally Posted by Sahir
Method 1
I am looking for L(n,k), the number of lights on after n toggles of k switches. I will treat k as a constant, since it doesn't change once it has been selected, so I may use the notation L_n to mean L(n,k).
Suppose we know L_n. It is fairly simple to find the expected value L_(n+1) recursively:
L_(n+1) = L_n + (probability next lightswitch is turned on) - (probability next lightswitch is turned off) = L_n + p_on - p_off.
Well, p_on and p_off depend on the number of lights that are currently on (L) and the number of total lights (k):
p_off = L_n/k
p_on = (k-L_n)/k
So L_(n+1) = L_n + (k-L)/k - L/k = L_n + (k-2L_n)/k = (k+L_n*(k-2))/k.
Also it should be clear intuitively that L_0 = 0 (no lights are on at the beginning), and L_1 = 1 (you will always have one light on after one toggle), establishing a base case and completing the recursive formula.
That only helps a little, since the solution is supposed to be in closed form. So I have to escape recursion somehow. This is a little tricky. Consider what a graph of L vs n would look like. It would start off at 0, climb rapidly at first and then slow down, until it approached approximately k/2, because for n>>k, about half of the lights should be on. This sounds a lot like what an exponential graph does, so perhaps our formula can be modeled by an exponential formula.
Let L_n = k/2-b^n for some b.
Now k/2 - b^(n+1) = L_(n+1) = (k+L_n*(k-2))/k = (k+(k/2 - b^n)*(k-2))/k
k^2/2 - kb^(n+1) = k+(k/2 - b^n)*(k-2)
k^2/2 - kb^(n+1) = k + k^2/2 - k - kb^n +2b^n
- kb^(n+1) = - kb^n +2b^n
kb = k-2
b = (k-2)/k
Thus we have L_n = k/2 - ((k-2)/k)^n satisfying the recursion.
But does it satisfy the base case as well? L_0 = k/2 - ((k-2)/k)^0 = k/2 - 1 != 0 and we can see that it does not. So, let's tweak the proposed formula a little to see if that helps.
Let L_n = k/2-a*b^n for some a, b.
The 'a's fall out leaving the same solution for b, so L_n = k/2 - a((k-2)/k)^n.
Solving for a using the known base case (L_0=0), 0 = L_0 = k/2 - a((k-2)/k)^0 = k/2 - a, so a=k/2.
Putting it all together gives L_n = k/2 - k/2((k-2)/k)^n = k/2 * [ 1 - ((k-2)/k)^n ] as the final solution, which satisfies both the recursion and the base case.
Method 2
Suppose k=2. Once one of the switches is turned on, the expected value is always 1, since there is an equal chance of a light being turned off as it is being turned on. Using this fact, we can group pairs of lights for other values of k.
Now suppose k is arbitrary, as per the guidelines of the question. Consider the first two lightbulbs. The probability that neither has been turned on after n toggles is ((k-2)/k)^n. So the probability that at least one has turned on (giving the pair an expected value of 1) is 1 - ((k-2)/k)^n.
In exactly half these circumstances, the first lightbulb is on. This means the expected value for the first bulb is (1 - ((k-2)/k)^n)/2.
Since the first bulb is symmetric with all other bulbs, the expected value for all the bulbs is the sum of each bulb's expected value, or L = E_total = sum(E_i) = k*E_i = k*(1 - ((k-2)/k)^n)/2 = k/2 * (1 - ((k-2)/k)^n), as above.
==========
Notice that the solutions are radically different in both length, method, and the number of assumptions it asks you to believe.
Suppose k = 2 and n = 2 let the switches be s1, s2Quote:
Originally Posted by SolarFlare
if you toggle s1 twice you have 0 lights on
if you toggle s1 and s2 once each you have 2 lights on
If this is a challenge to my solution, then perhaps the meaning of Expected Value has been misunderstood.Quote:
Originally Posted by Sahir
In the instance of k=n=2, there is a 1/2 chance that no lights will be on and a 1/2 chance that both lights will be on, so E = (1/2)*(0) + (1/2)*(2) = 1.
hhmm...... okay i think that was is far over my head. I know It is not my turn but
I would like to ask a question any way. I prolly won't be here long enough for
the points to matter.
It has been a while since i read this last, and the wording may be a little off. ICode:Gertrude entered a Boeing 707 (I don't know if this is a real plane or not, it
doesn'tmatter either way.) which seated 300 people, it is full. No one saw
Gertrude get on. Gertrude exited the plane. No one saw Gertrude exit the plane.
Gertrude killed 300 people. How did she do it?
Note: You do NOT need any knowledge about jet liners aside from what you
would learn by 6th grade. Or anything else for that matter. A logic problem not a
technical problem.
hope it is close enough that some one could answer it.
Gertrude is a rocket!
Qaueda operative with a parachute?Quote:
Originally Posted by Sravoff
Either that or it's an odorless and colorless gas of some sort that knocked out the pilot.
How about everybody ;)Quote:
Originally Posted by YourSurrogateGod
/Hypoxia
The thing with the gas is not stupid. Maybe the gas or fuelt vault is called Gertrude. Or she is a Re'Tu
It was either that or a huge flame wreck :) . At the very least the pilot would have to go :) .Quote:
Originally Posted by Mick
[edit]
I take it that it was CO?
/ahh... carbon monoxide... wait a sec!
Loss of cabin pressure.Quote:
Originally Posted by YourSurrogateGod
Gertrude is a goose that flew through the jet engine.
Goose is to jet engine as apple pie is to ............ ?
Gertrude is some kind of ariborne virus ?
Maybe Gertrude is the pilots ex-wife. She shot him and jumped off the plane. No one saw her because she was a midget.
I've made some research on google and it seems there is no gertrude rocket, virus or desease.
But I'm sure that in this problem, it is a rocket. ;)
A goose flying into/through the engine is the answer. Unless of course it was a duck or a loon.
Note: duck is a funny word.
A gertrude is what they called the underwater phones on subs in world war II.
You know they have windows on planes...you can see a duck duck goose. Ok so it might be blurry.
/Quack Quack.
Jet big. Goose small.Quote:
Originally Posted by Mick
Jet move fast. Goose move slow.
Pilot no see goose. Goose enter engine.
Kaboom.
It has happened.
Geese and Airplanes
From another site:
Quote:
Only 325 people have are known to have died in bird strike aircraft crashes since the beginning of aviation, according to BSC. The last time birds killed airline passengers in the United States was in 1960, when a flock of Canada Geese took down a Lockheed Electra taking off from Boston's Logan International Airport. And a USAF Boeing 707 "AWACS" radar/surveillance jet crashed on takeoff in 1995 at Elmendorf AFB in Alaska after geese crippled the jet. All 24 crew died.
You don't say... there are thousands of bird strikes every year. But then we are talking about probabilities. It is likely we are talking about a bird strike, since gertrude is a common name for pet geese. But there is also the probability that the crew and passengers would see a goose being sucked into the engine, especially at take off and landing. During crusing meh..a nice blur would do... well it looked like a goose.Quote:
Originally Posted by Tom Frohman
We could also say the crew/passengers were blindfolded and gerturde is a serial killer :) [I see chmanish covered that topic below :) ]
The plane carried 300 blind passengers. When the plane took off, Gertrude told the blind people that plane can not take off due tostrong winds and guided them out of the plane. Then she jumped out with a parachute. :rolleyes:
:D And yes, they were deaf too :D
Gertrude is the name of a novel by Hermann Hesse. Copies of the book were left under the seats by the clown convention that booked the plane on the last flight. The passengers all read the book and died of boredom.
As the plane was going down the books all jumped out of the plane.
Meanwhile in a small sweatshop in New York, Vlad and Serge were finishing their milk and cookies. It was a slow day. Nobody had bought any sweat today. They felt their labors had been wasted and considered a new line of business. "Maybe we could make a living by asking questions in the question and answer thread on Codeguru?" Serge suggested. It was a stupid idea but somebody had to do it.
This turned the page on a new era in world history.
That's why there is a canon on airplane test centers to shoot 3 kinds of birds into the engine. Big birds, medium birds and small birds.... For testing purpose ... of course.Quote:
Originally Posted by Tom Frohman
Hmm ... maybe Gertrude is an old quicksilver thermometer which broke in the plane...
/Quicky doesn't like aluminium
Unavailable for comment.Quote:
Originally Posted by NoHero
Search for Gertrude and Jet on Google and you will find:
http://www.webspawner.com/users/doubleminttwins1940/
~*LATERAL THINKING PUZZLES*~
(from the book Lateral Thinking Puzzles by Paul Sloane & Des MacHale)
*********************GERTRUDE**********************************
When Gertrude entered the plane she caused her own death and the deaths of 200 other people. Yet she was never blamed or criticized for her actions. What happened?(scroll down for clues)
*****************************************************************
***********************GERTRUDE**********************************
Gertrude, a goose, had been sucked into a jet engine.
And here comes the story about the frozen chicken ... :rolleyes:Quote:
Originally Posted by NoHero
Chicken Chops?Quote:
Originally Posted by Elrond
Of course frozen chicken ... or would you should living chickens in the engine :eek:Quote:
Originally Posted by Elrond
The 1337h (1337th?) reply.
You are so smart......um, you win....... is there still a score board?Quote:
Originally Posted by Tom Frohman
if so you get a point, i think that was lie 60 pages back or something though.......
Ben
With all due respect for Tom and Sravoff this question and answer is irrelevant. How can you prove that Gertrude is a goose or duck rather than a virus, rocket, metheorit or anything else? :eek: :sick: :(Quote:
You are so smart......um, you win....... is there still a score board?
if so you get a point, i think that was lie 60 pages back or something though.......
Please people, ask more unambiguous questions.
Gertrude can not be a rocket. When a rocket hits (enters) a plane, it usually explodes or gets stopped inside the plane. Therefore the rocket can not exit (leave) the plane. And we've been sdaid Gertrude left the plane. The only way Gertrude can be a bullet or rocket is if it is strong enough to pierce through the plane and go on its path after crashing on the plane.Quote:
Originally Posted by cilu
Also Gertrude can not be anything faster than a speeding bullet. She ("it"?) entered the plane, and then left the plane. And we're said, if I am correctly interpreting words, than people were killed "after" Gertrude left. A meteorite for an example travels too fast and it is too big to escape the plane before killing everyone.
I think this quiz case is not that ambiguous. Before reading all the answers posted I was thinking in a virus.
Well...
OK, You have a good point here. But in this case a how did a duck that entered into the engine extited the plane? Same problem...
Q: Why do ducks have flat feet?
A: To stamp out forest fires.
Q: Why do forest rangers wear boots?
A: So they can stamp out flaming ducks.
Q: What to elephants do between 3 and 5 PM in the forest?
A: They jump out of trees.
Q: Why are crocodiles built so low to the ground?
A: From taking walks in the forest between 3 and 5 PM.
The duck left the plane as minced meat ....Quote:
Originally Posted by cilu
Hahahaha... that's funny. :DQuote:
Originally Posted by Elrond
6, 6, and 1
Wrong, the answer is 42. :DQuote:
Originally Posted by bighorus83
Q: what goes down slowly but goes up fast:D
hmm, a plane?Quote:
Originally Posted by mrRee
A manned space craft. Up on rockets; Down on a parachute.Quote:
Originally Posted by mrRee
What's wrong with a dogged space craft? :DQuote:
Originally Posted by Tom Frohman