+ 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

15th May 2018, 5:34 PM
TARUN KUMAR SINGH
TARUN KUMAR SINGH - avatar
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.
19th May 2018, 5:43 PM
TARUN KUMAR SINGH
TARUN KUMAR SINGH - avatar
+ 2
This assignment have been already published by @Vivek Sivaramakrishnan in more general form here: https://www.sololearn.com/Discuss/1246171/?ref=app
17th May 2018, 11:44 PM
Nevfy
+ 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.
18th May 2018, 3:39 PM
Nevfy
+ 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.
18th May 2018, 4:09 PM
Nevfy
+ 2
By the way, am I right that the answer is: 1. 120 seconds? 2. Never?
19th May 2018, 2:41 AM
Nevfy
+ 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
21st May 2018, 4:40 PM
tamaslud
tamaslud - avatar
+ 1
Full Gamer, where is lesson factory?
15th May 2018, 6:40 PM
Just A Rather Ridiculously Long Username
+ 1
Oh, is it only for mobile? I am on the website.
17th May 2018, 8:29 PM
Just A Rather Ridiculously Long Username
+ 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.
18th May 2018, 3:36 PM
TARUN KUMAR SINGH
TARUN KUMAR SINGH - avatar
+ 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
18th May 2018, 4:41 PM
TARUN KUMAR SINGH
TARUN KUMAR SINGH - avatar
+ 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...
20th May 2018, 12:58 AM
Nevfy
+ 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.
20th May 2018, 3:29 AM
Nevfy
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 !
18th May 2018, 3:47 PM
TARUN KUMAR SINGH
TARUN KUMAR SINGH - avatar
0
We deduce to every 2 min from starting .
20th May 2018, 3:09 AM
TARUN KUMAR SINGH
TARUN KUMAR SINGH - avatar
0
I welcome your thought. I will edit the assignment.
20th May 2018, 8:11 AM
TARUN KUMAR SINGH
TARUN KUMAR SINGH - avatar