+ 2
[ASSIGNMENT] Write a program to solve a Math question.
There are three bulbs A , B and C. The bulb A glows for 3 seconds and then remains closed for 3 sec. B glows for 4 sec and then remains closed for 4 sec. C glows for 5 sec and then remains closed for 5 sec. If all the bulbs are lit at the same time then tell at how many seconds all the bulbs will glow together and at how many seconds all the bulbs will switch off together ? Rule:You just have to make a program on it. Extra: Let time for each bulb be a, b, c. Tell the time in terms of operations of a,b,c
18 Answers
0
Not only 120 seconds but every time(in seconds) which is a multiple of 120.
like-120,240,360,480 and so on.
+ 2
This assignment have been already published by @Vivek Sivaramakrishnan in more general form here:
https://www.sololearn.com/Discuss/1246171/?ref=app
+ 2
@TARUN KUMAR SINGH Yes, that's why I said "in more general form".
Solution for your task can be easily obtained by reducing the functionality (add perform some other small changes) of the code made for Vivek's challenge.
+ 2
@TARUN KUMAR SINGH
Oh, I'm sorry, I did not want to offend you in any way.
For sure, all assignments are welcomed here!
I was just trying to say that you will probably not get many participants with the task that repeats a bit the other one.
Sorry again.
+ 2
By the way, am I right that the answer is:
1. 120 seconds?
2. Never?
+ 2
i am not sure to understand properly, but for 3.4.5 the periodicity is 120 secs. meantime it looks pretty stochastic, so if you notice a moment when all the bulbs lit it is not possible to predict the time of the next similar event. see my fast written code.
https://code.sololearn.com/cMrF25Yfj4WH/?ref=app
+ 1
Full Gamer, where is lesson factory?
+ 1
Oh, is it only for mobile? I am on the website.
+ 1
Ooh! there's a difference between Vivek's question and mine. In my question each led doesn't have more than one color and there's no color combination in my question also you just have to make a program to tell at what times the bulbs will glow on at same time.
The question only requires a visual answer.
I will post my solution shortly.
+ 1
Oh thank you for your advice and no need to feel sorry. I in no way felt offended. I was just trying to know information about posting asisignments of this type.
THANK YOU AGAIN
+ 1
@TARUN KUMAR SINGH
That's for sure. They are switching on at the same time at the moment of 0 second and then at 120 seconds. After that its behavior is just repetitive going again and again through this 2 minutes loop until the end of the world...
+ 1
@TARUN KUMAR SINGH
So now you can extend you task by asking to find a result for any given times (let's say a, b, c), but not only 3, 4, 5. I believe that it brings a bit more interest to solve it.
0
Okay.
I want to post this question as an assignment so can I go for it or should I not .
What ever, I must say that this question has a simple part and an intuitive part.
1-Simple Part is to find the time at which they'll glow together simultaneuosly.
2-Intuitive part is to find the time at which the bulbs, switch off simultaneously.
I guess many have not tried it !
0
We deduce to every 2 min from starting .
0
I welcome your thought.
I will edit the assignment.



