Expected number of light bulbs on

  • Context: MHB 
  • Thread starter Thread starter oyth94
  • Start date Start date
  • Tags Tags
    Light
Click For Summary
SUMMARY

The expected number of light bulbs on after 50 random flips, where each of the 50 bulbs is toggled, is approximately 21.75. This conclusion is derived from the formula E(50,50) = (25^50 - 24^50) / 25^49, which simplifies to 25 - 24(24/25)^49. The discussion also explores generalizations for k switches, leading to the formula E(2k,n) = (k^n - (k-1)^n) / k^(n-1). Simulation results corroborate the analytical findings, yielding a mean of 21.74 with a standard error of approximately 0.034.

PREREQUISITES
  • Understanding of probability theory, specifically random variables and expected values.
  • Familiarity with combinatorial mathematics and binomial distributions.
  • Basic knowledge of Python for simulation purposes.
  • Ability to manipulate and derive mathematical formulas.
NEXT STEPS
  • Study the derivation of expected values in probability theory.
  • Explore the implications of the binomial distribution in random experiments.
  • Learn how to implement simulations in Python to validate mathematical models.
  • Investigate further generalizations of the expected value formula for different configurations of switches.
USEFUL FOR

Mathematicians, statisticians, computer scientists, and anyone interested in probability theory and its applications in random processes.

oyth94
Messages
32
Reaction score
0
There are 50 light bulbs in a room each with its own switch. If a light bulb is on, Dick turns it off and if it is off , he turns it on. Initially all light bulbs are off . After 50 flips and assuming that Dick chooses switches to be flipped randomly, what is the expected number of light bulbs on in the room rounded to the nearest natural number?

To be honest, i tried many times but i can;t seem to arrive at an answer. i am stuck. any help would be appreciated!

so i have started with this:
Let Ei be the event that bulb i is on after 50 flips. This is the case if switch i is chosen an odd number of times. Compute Pr(Ei) and let Xi be the indicator random variable for Ei. Then E[Xi]=Pr(Ei). Now, let X be the total number of bulbs on after 50 flips. X=∑Xi, so E[X]=∑E[Xi]=n⋅Pr(Ei).
 
Last edited:
Physics news on Phys.org
oyth94 said:
There are 50 light bulbs in a room each with its own switch. If a light bulb is on, Dick turns it off and if it is off, he turns it on. Initially all light bulbs are off. After 50 flips and assuming that Dick chooses switches to be flipped randomly, what is the expected number of light bulbs on in the room rounded to the nearest natural number?

To be honest, i tried many times but i can;t seem to arrive at an answer. i am stuck. any help would be appreciated!

so i have started with this:
Let Ei be the event that bulb i is on after 50 flips. This is the case if switch i is chosen an odd number of times. Compute Pr(Ei) and let Xi be the indicator random variable for Ei. Then E[Xi]=Pr(Ei). Now, let X be the total number of bulbs on after 50 flips. X=∑Xi, so E[X]=∑E[Xi]=n⋅Pr(Ei).

The core of the problem is the meaning of 'Dick chooses switches to be flipped randomly'... if it means that any bulb has probability 1/2 to be switched by Dick at any iteration it is evident that at the end of each iteration the expected number of switched on bulbs is 25...

Kind regards

$\chi$ $\sigma$
 
oyth94 said:
There are 50 light bulbs in a room each with its own switch. If a light bulb is on, Dick turns it off and if it is off, he turns it on. Initially all light bulbs are off. After 50 flips and assuming that Dick chooses switches to be flipped randomly, what is the expected number of light bulbs on in the room rounded to the nearest natural number?
Fascinating problem! I have wasted half my Sunday morning on it. (Coffee) (Yawn)

Let's generalise it a bit, to the case where there are $k$ switches. Denote by $E(k,n)$ the expected number of lit bulbs after $n$ random flips, given that initially all light bulbs were off. I found $50$ much too large a number to work with, so I did some experiments with smaller numbers. For $k=4$, I found that the values of $E(4,n)$, for $n=1,2,3,4,5,6$ are $$1,\ \frac32,\ \frac74,\ \frac{15}8,\ \frac{31}{16}, \frac{63}{32},$$ which makes it seem likely that $E(4,n) = \dfrac{2^n-1}{2^{n-1}}$.

I then tried $k=6$ and found something even more interesting: for $n=1,2,3,4$, the values of $E(6,n)$ are $$1,\ \frac53,\ \frac{19}9,\ \frac{65}{27},$$ which very strongly suggests that $E(6,n) = \dfrac{3^n-2^n}{3^{n-1}}.$

If so, then it seems inevitable that the general formula must be $\boxed{E(2k,n) = \dfrac{k^n - (k-1)^n}{k^{n-1}}}.$

I'm not prepared to put money on it, but I'm 99% sure that $$E(50,50) = \dfrac{25^{50} - 24^{50}}{25^{49}} = 25 - 24\Bigl(\frac{24}{25}\Bigr)^{\!49} \approx 21.75.$$

Now it's time for Sunday lunch, so I'll leave it to others to see if those results can be proved.
 
Opalg said:
Fascinating problem! I have wasted half my Sunday morning on it. (Coffee) (Yawn)

Let's generalise it a bit, to the case where there are $k$ switches. Denote by $E(k,n)$ the expected number of lit bulbs after $n$ random flips, given that initially all light bulbs were off. I found $50$ much too large a number to work with, so I did some experiments with smaller numbers. For $k=4$, I found that the values of $E(4,n)$, for $n=1,2,3,4,5,6$ are $$1,\ \frac32,\ \frac74,\ \frac{15}8,\ \frac{31}{16}, \frac{63}{32},$$ which makes it seem likely that $E(4,n) = \dfrac{2^n-1}{2^{n-1}}$.

I then tried $k=6$ and found something even more interesting: for $n=1,2,3,4$, the values of $E(6,n)$ are $$1,\ \frac53,\ \frac{19}9,\ \frac{65}{27},$$ which very strongly suggests that $E(6,n) = \dfrac{3^n-2^n}{3^{n-1}}.$

If so, then it seems inevitable that the general formula must be $\boxed{E(2k,n) = \dfrac{k^n - (k-1)^n}{k^{n-1}}}.$

I'm not prepared to put money on it, but I'm 99% sure that $$E(50,50) = \dfrac{25^{50} - 24^{50}}{25^{49}} = 25 - 24\Bigl(\frac{24}{25}\Bigr)^{\!49} \approx 21.75.$$

Now it's time for Sunday lunch, so I'll leave it to others to see if those results can be proved.

Thank you so much! I arrived with the same answer but I used either Poisson or Binomial. But my approach I didn't involve expected value...which I should...
 
Opalg said:
Fascinating problem! I have wasted half my Sunday morning on it. (Coffee) (Yawn)

Let's generalise it a bit, to the case where there are $k$ switches. Denote by $E(k,n)$ the expected number of lit bulbs after $n$ random flips, given that initially all light bulbs were off. I found $50$ much too large a number to work with, so I did some experiments with smaller numbers. For $k=4$, I found that the values of $E(4,n)$, for $n=1,2,3,4,5,6$ are $$1,\ \frac32,\ \frac74,\ \frac{15}8,\ \frac{31}{16}, \frac{63}{32},$$ which makes it seem likely that $E(4,n) = \dfrac{2^n-1}{2^{n-1}}$.

I then tried $k=6$ and found something even more interesting: for $n=1,2,3,4$, the values of $E(6,n)$ are $$1,\ \frac53,\ \frac{19}9,\ \frac{65}{27},$$ which very strongly suggests that $E(6,n) = \dfrac{3^n-2^n}{3^{n-1}}.$

If so, then it seems inevitable that the general formula must be $\boxed{E(2k,n) = \dfrac{k^n - (k-1)^n}{k^{n-1}}}.$

I'm not prepared to put money on it, but I'm 99% sure that $$E(50,50) = \dfrac{25^{50} - 24^{50}}{25^{49}} = 25 - 24\Bigl(\frac{24}{25}\Bigr)^{\!49} \approx 21.75.$$

Now it's time for Sunday lunch, so I'll leave it to others to see if those results can be proved.

I can report that simulation gives the mean number off after 50 flips of the 50 switchs is 21.74 with a standard error ~0.034

(another exercise on my Python learning curve)

.
 
Last edited:
I now see how to prove the formula for $E(2k,n)$, and it's really quite easy. When the $(n+1)$th switch is flipped, the probability that it is already on is $\dfrac{E(2k,n)}{2k}$, in which case the flip turns it off, and the number of "on" switches is reduced by $1$. Likewise, the probability that the $(n+1)$th switch is off is $\dfrac{2k-E(2k,n)}{2k}$, in which case the flip turns it on, and the number of "on" swiches is increased by $1$. Therefore $$E(2k,n+1) = \frac{E(2k,n)}{2k}(E(2k,n)-1) + \frac{2k-E(2k,n)}{2k}(E(2k,n)+1) = \frac{(k-1)E(2k,n) + k}k.$$ Now assume as an inductive hypothesis that $E(2k,n) = \dfrac{k^n-(k-1)^n}{k^{n-1}}$. Then $$E(2k,n+1) = \frac{(k-1)E(2k,n) + k}k = \frac{(k-1)k^n-(k-1)^{n+1} + k^n}{k^n} = \frac{k^{n+1} - (k-1)^{n+1}}{k^n},$$ which completes the inductive step. The base case $E(2k,1) = 1$ is easy to check, so the result is proved.
 

Similar threads

  • · Replies 3 ·
Replies
3
Views
2K
  • · Replies 5 ·
Replies
5
Views
1K
  • · Replies 11 ·
Replies
11
Views
3K
  • · Replies 8 ·
Replies
8
Views
2K
  • · Replies 15 ·
Replies
15
Views
2K
  • · Replies 3 ·
Replies
3
Views
2K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 2 ·
Replies
2
Views
5K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 4 ·
Replies
4
Views
3K