Exercise 4.2: A light bulb is controlled by nswitches. Each switch can be
in one of two possible states—“OFF” and “ON”. We can’t tell thestatus of a
switch (i.e., whether it is ON or OFF) at any given time. We canonly toggle
it between the two states by pressing the switch. Only whenall switches are
in the ON state, the light bulb will glow, otherwise it will notglow. Given
that the light bulb is not initially glowing, give arecursive algorithm to
make it glow. What is the number of operations (as a function of n)needed
by your algorithm in the worst case? (Count each toggle of a
PayPal Gateway not configured
PayPal Gateway not configured