Page 1 of 2 12 LastLast
Results 1 to 20 of 21

Thread: I also have an IQ question...

  1. #1
    Senior Member
    Join Date
    Jan 2002
    Location
    Northwest
    Posts
    5,011

    Default I also have an IQ question...

    Imagine there are 1000 switches, numbered from 1 to 1000 and lined up sequentially in a single row on a very long wall. Each switch controls a light bulb on top of the switch and all the switches are at the "OFF" position in the beginning.

    Then imagine there are 1000 people, each wearing a number tag, and the numbers run from 1 to 1000.

    The sequence of actions are:

    Starting from the person with the number 1, each person in order of their number goes from switch number 1 to switch number 1000, and flick the switches that has the numbers that are multiples of the person's number.

    Here's how it would have gone:

    The person number 1 goes from switch number 1 to switch number 1000, and turns on every switch. (Since his number is 1, so every switch number is a multiple of 1).

    The person number 2 goes from switch number 1 to switch number 1000, and turns off all the switches with numbers that are multiples of 2, ie, 2,4,6,.....1000. (Since the 1st person turned on all the switches, the second person then turns off all the even number switches).

    The person number 3 then turns switch number 3 off (initially turned on by peron number 1), turns switch number 6 on (initially turned on by person number 1 then turned off by person number 2), switch number 9 off.....

    .
    .
    .
    .

    Person number 1000 simply go to switch number 1000. If it is on, he turns it off, it it is off, he turns it on.

    The question is, by the end of the whole exercise, how many light bulbs are lit?

    This was a question given to me on my job interview...

    - Roy
    As complexity rises, precise statements lose meaning and meaningful statements lose precision.

  2. #2
    Member
    Join Date
    Dec 2002
    Location
    Near Equator
    Posts
    258

    Default

    Wah! What job you apply for??

    Need a formula to calculate this one or not?

  3. #3
    Member
    Join Date
    Dec 2002
    Location
    Near Equator
    Posts
    258

    Default

    I anyhow guess. I guess 1 light bulb.

  4. #4
    newuser
    Guests

    Default Re: I also have an IQ question...

    Originally posted by roygoh
    Imagine there are 1000 switches, numbered from 1 to 1000 and lined up sequentially in a single row on a very long wall. Each switch controls a light bulb on top of the switch and all the switches are at the "OFF" position in the beginning.

    Then imagine there are 1000 people, each wearing a number tag, and the numbers run from 1 to 1000.

    The sequence of actions are:

    Starting from the person with the number 1, each person in order of their number goes from switch number 1 to switch number 1000, and flick the switches that has the numbers that are multiples of the person's number.

    Here's how it would have gone:

    The person number 1 goes from switch number 1 to switch number 1000, and turns on every switch. (Since his number is 1, so every switch number is a multiple of 1).

    The person number 2 goes from switch number 1 to switch number 1000, and turns off all the switches with numbers that are multiples of 2, ie, 2,4,6,.....1000. (Since the 1st person turned on all the switches, the second person then turns off all the even number switches).

    The person number 3 then turns switch number 3 off (initially turned on by peron number 1), turns switch number 6 on (initially turned on by person number 1 then turned off by person number 2), switch number 9 off.....

    .
    .
    .
    .

    Person number 1000 simply go to switch number 1000. If it is on, he turns it off, it it is off, he turns it on.

    The question is, by the end of the whole exercise, how many light bulbs are lit?

    This was a question given to me on my job interview...

    - Roy
    And your answer was???
    One?

    The first light bulb will never be turned off as '1' is only a multiple of 1.

    This is a maths question I think.

  5. #5
    Member
    Join Date
    Sep 2002
    Location
    Sengkang
    Posts
    567

    Default

    My guess is -

    S = (n/2)[2a+(n-1)d] + n

    S = 1000,
    n = to find
    a = 2
    d = 2

    thus n=30.63

    taking the approximate value, it is 31 light bulb on.
    Last edited by cheechee; 3rd May 2003 at 11:07 AM.

  6. #6
    Member
    Join Date
    Sep 2002
    Location
    Sengkang
    Posts
    567

    Default

    Just to confirm, is it 31 lightbulbs switched on?

    Cheers
    Last edited by cheechee; 3rd May 2003 at 11:07 AM.

  7. #7
    Senior Member
    Join Date
    Feb 2003
    Location
    The heart of the Abyss
    Posts
    2,307

    Default

    Originally posted by Silverelf
    Wah! What job you apply for??

    Need a formula to calculate this one or not?
    Let me guess.... Microsoft, right? They are famous for these questions...

  8. #8
    Member
    Join Date
    Feb 2003
    Location
    In the void.
    Posts
    1,323

    Default

    Hahaha... then you give them a cheeky answer loh.
    At the end of the exercise, you will turn off all the bulbs that are on. So in the end, there will be no light bulbs on.

  9. #9

    Default

    only 1

  10. #10

    Default

    No lightbulb on... switch on an off so many times... spoilt liaoz.....


  11. #11
    Member
    Join Date
    Sep 2002
    Location
    Sengkang
    Posts
    567

    Default

    For lightbulb 1, only Mr1 can touch it, so it can only be switched on.

    For lightbulb 4, Mr1 switch it on, Mr2 switch it off, Mr4 switch it on.
    So it is switched on.

    For lightbulb 9, Mr1 switch it on, Mr3 switch it off, Mr9 switch it on.
    So it is switched on.

    According to the logic above, Switch 1,4,9,16,25, and so on are switched on.

    Note that there are
    2 switches between 01 and 04 are off->2.3
    4 switches between 04 and 09 are off->5.6.7.8
    6 switches between 09 and 16 are off->10.11.12.13.14.15
    8 switches between 16 and 25 are off->17.18.19.20.21.22.23.24
    and so on.

    So the thing is to find n.

    S > (n/2)[2a+(n-1)d] + n

    S = 1000,
    n = to find
    a = 2
    d = 2

    Thus n=30
    This seems like the answer, but we need to sub in n=30 into
    n(n+2) and see what the sum is, it is 960, means we can add one more litted bulb after this, namely switch 961.

    Thus the total number of switches on is 31


  12. #12
    Senior Member
    Join Date
    Feb 2003
    Location
    The heart of the Abyss
    Posts
    2,307

    Default

    Chee Chee,
    Once the pattern that shows that the squares are the remaining numbers, the extrapolation is trivial; the biggest square before 1000 is 31. Hence, the total number would be 31.

    To be sure and fast, I would write a program to simulate it.

  13. #13
    Member
    Join Date
    Sep 2002
    Location
    Sengkang
    Posts
    567

    Default

    Originally posted by Watcher
    Chee Chee,
    Once the pattern that shows that the squares are the remaining numbers, the extrapolation is trivial; the biggest square before 1000 is 31. Hence, the total number would be 31.

    To be sure and fast, I would write a program to simulate it.
    >the extrapolation is trivial; the biggest square before 1000 is >31. Hence, the total number would be 31.
    Err.. dun understans

    Aiyaah.... limited time mar, only 20minutes for me to solve.

    confirm got faster way to solve than my kind of primitive methods

  14. #14
    Member
    Join Date
    Feb 2003
    Location
    In the void.
    Posts
    1,323

    Default

    As I said....
    Tell them that you will switch everything off... cos waste of electricity.... then they will probably give you a job as resource manager instead of whatever you are applying for. hahaha.....

  15. #15
    Member
    Join Date
    Sep 2002
    Location
    Sengkang
    Posts
    567

    Default

    Hehe.. then might as well tell them "Why use so many lightbulbs? Use 1 big output one then can liao mar.."

    Voila, the post of R&D director.

  16. #16
    Senior Member
    Join Date
    Jan 2002
    Location
    Northwest
    Posts
    5,011

    Default

    Here's the "standard" answer I gave:

    At the end of the exercise, switches that are flicked an odd number of times will be on.

    The number of times a switch is flicked is equal to the number of factors its number has.

    All numbers have even number of factors except square numbers.

    For example, 12 (not a square number) = 1 X 12 = 2 X 6 = 3 X 4, so there are 6 factors (1,2,3,4,6,12). Swich 12 is therefore flicked an even number of times, so it is off.

    36 (a square numner) = 1 X 36 = 2 X 18 = 3 X 12, = 4 X 9 = 6 X 6. So there are 9 factors, which is a odd number. Switch 36 is flicked an odd numner of time, so it is on.

    The number of switches that are on
    = the number of switches that are flicked an odd number of times
    = the number of switches that has a square number
    = the number of square numbers from 1 to 1000 (including 1 itself)
    = Integer(square root of 1000)
    = 31.

    So cheechee's answer is correct!

    - Roy
    As complexity rises, precise statements lose meaning and meaningful statements lose precision.

  17. #17

    Default

    What kind of a job is that?????

    Think Ur interviewer has a very good sense of humour.....


  18. #18

    Default

    Originally posted by mervlam
    only 1
    Wrong answer! That's why I can't be a software programmer.

  19. #19
    Member
    Join Date
    Dec 2002
    Location
    Near Equator
    Posts
    258

    Default

    That's not an IQ question what! It's a mathemetical one.....

  20. #20
    newuser
    Guests

    Default

    Someone should write a short program in C or what ever, and see if the answer is 31.

Page 1 of 2 12 LastLast

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •