a much better logical puzzle

Recommended Videos

restoshammyman

New member
Jan 5, 2009
261
0
0
hello everyone.
i have a riddle that will stump you all.
i will never ever ever post the answer, i will however tell you if someone got it right.
so here it goes:

there is a room with 100 light bulbs on the ceiling, and 100 switches on the wall.
each light bulb and each switch is numbered(switch 1 turns on the first bulb, No. 2 turns 2 on, and so on).
there are also 100 goblins.
each goblin is also numbered from 1 to 100 and the number is written on they'r shirts(goblins are retarded, what can you do).
each goblin get he's turn to go and play with the switches(only one turn per goblin).
when a goblin plays with the switches, he only switches a switch if its number can be divided by the number on the goblins shirt and only switch it once(a number CAN be divided by one and itself).

and the question is.
what lights will be on after all the goblin are done.
 

kommando367

New member
Oct 9, 2008
1,955
0
0
#1 will be off, I know this for sure. And from what else I can tell,
I have a headache and quit.
.
 

Tzfanya

New member
Jul 11, 2008
10
0
0
To clarify: does each goblin switch each switch that is a multiple of their shirt number?

So goblin one flicks all the switches once,
goblin two flicks all the even switches once, etc?
 

About To Crash

New member
Apr 24, 2009
332
0
0
A Goblin will only play with one switch on his turn, or as many as he can?
For instance, would Goblin 1 play with just 1 of the switches, or all of them?
 

Kpt._Rob

Travelling Mushishi
Apr 22, 2009
2,417
0
0
If I may adapt something Lewis Black said to our purposes here. There is not enough liquor in the universe to get one through the tedious mathematical process that would be necessary to solve this.
 

Gitsnik

New member
May 13, 2008
798
0
0
kommando367 said:
None of them.
I think this too. But:
Kpt._Rob said:
If I may adapt something Lewis Black said to our purposes here. There is not enough liquor in the universe to get one through the tedious mathematical process that would be necessary to solve this.
I don't know if my maths is correct:
Code:
#!/usr/bin/perl
use strict;
use warnings;
my @switch = ();
foreach (1..100) {
        $switch[$_] = 0;
}
foreach my $goblin (1..100) {
        foreach my $light (1..100) {
                for(my $counter = 2; $counter <= int($light / $goblin); $counter++) {
                        my $val = $goblin / $light;
                        print qq|$val\n|;
                        if($val !~ /\./) {
                                $switch[$light] = ($switch[$light] == 0 ? 1 : 0);
                                $counter = 2000000;
                        }
                }
        }
}
foreach (1..100) {
        print "$_ is on\n" if $switch[$_] == 1;
}
Edit:

Oh I don't think it was, that should have been my $val = $light / $goblin;

If that is the case then we have:

2 is on
3 is on
5 is on
6 is on
7 is on
8 is on
10 is on
11 is on
12 is on
13 is on
14 is on
15 is on
17 is on
18 is on
19 is on
20 is on
21 is on
22 is on
23 is on
24 is on
26 is on
27 is on
28 is on
29 is on
30 is on
31 is on
32 is on
33 is on
34 is on
35 is on
37 is on
38 is on
39 is on
40 is on
41 is on
42 is on
43 is on
44 is on
45 is on
46 is on
47 is on
48 is on
50 is on
51 is on
52 is on
53 is on
54 is on
55 is on
56 is on
57 is on
58 is on
59 is on
60 is on
61 is on
62 is on
63 is on
65 is on
66 is on
67 is on
68 is on
69 is on
70 is on
71 is on
72 is on
73 is on
74 is on
75 is on
76 is on
77 is on
78 is on
79 is on
80 is on
82 is on
83 is on
84 is on
85 is on
86 is on
87 is on
88 is on
89 is on
90 is on
91 is on
92 is on
93 is on
94 is on
95 is on
96 is on
97 is on
98 is on
99 is on

Again, not sure if that's correct.
 

restoshammyman

New member
Jan 5, 2009
261
0
0
Tzfanya said:
To clarify: does each goblin switch each switch that is a multiple of their shirt number?

So goblin one flicks all the switches once,
goblin two flicks all the even switches once, etc?
yes.
English isn't my first language, and i had trouble finding the right words to say just that.
 

restoshammyman

New member
Jan 5, 2009
261
0
0
About To Crash said:
A Goblin will only play with one switch on his turn, or as many as he can?
For instance, would Goblin 1 play with just 1 of the switches, or all of them?
he plays with all the ones he should on hes turn.
not just one
 

restoshammyman

New member
Jan 5, 2009
261
0
0
Gitsnik said:
kommando367 said:
None of them.
I think this too. But:
Kpt._Rob said:
If I may adapt something Lewis Black said to our purposes here. There is not enough liquor in the universe to get one through the tedious mathematical process that would be necessary to solve this.
I don't know if my maths is correct:
Code:
#!/usr/bin/perl
use strict;
use warnings;
my @switch = ();
foreach (1..100) {
        $switch[$_] = 0;
}
foreach my $goblin (1..100) {
        foreach my $light (1..100) {
                for(my $counter = 2; $counter <= int($light / $goblin); $counter++) {
                        my $val = $goblin / $light;
                        print qq|$val\n|;
                        if($val !~ /\./) {
                                $switch[$light] = ($switch[$light] == 0 ? 1 : 0);
                                $counter = 2000000;
                        }
                }
        }
}
foreach (1..100) {
        print "$_ is on\n" if $switch[$_] == 1;
}
Edit:

Oh I don't think it was, that should have been my $val = $light / $goblin;

If that is the case then we have:

2 is on
3 is on
5 is on
6 is on
7 is on
8 is on
10 is on
11 is on
12 is on
13 is on
14 is on
15 is on
17 is on
18 is on
19 is on
20 is on
21 is on
22 is on
23 is on
24 is on
26 is on
27 is on
28 is on
29 is on
30 is on
31 is on
32 is on
33 is on
34 is on
35 is on
37 is on
38 is on
39 is on
40 is on
41 is on
42 is on
43 is on
44 is on
45 is on
46 is on
47 is on
48 is on
50 is on
51 is on
52 is on
53 is on
54 is on
55 is on
56 is on
57 is on
58 is on
59 is on
60 is on
61 is on
62 is on
63 is on
65 is on
66 is on
67 is on
68 is on
69 is on
70 is on
71 is on
72 is on
73 is on
74 is on
75 is on
76 is on
77 is on
78 is on
79 is on
80 is on
82 is on
83 is on
84 is on
85 is on
86 is on
87 is on
88 is on
89 is on
90 is on
91 is on
92 is on
93 is on
94 is on
95 is on
96 is on
97 is on
98 is on
99 is on

Again, not sure if that's correct.
so freaking wrong. check your program. to bad i only know pascal and javascript :(
 

Gitsnik

New member
May 13, 2008
798
0
0
restoshammyman said:
so freaking wrong. check your program. to bad i only know pascal and javascript :(
It's the logic not the program ;)

Teach me to write code when I should be working.

Edit:

Well there you go, change that 2 for a 1 in the loop:

1 is on
4 is on
9 is on
16 is on
25 is on
36 is on
49 is on
64 is on
81 is on
100 is on

Personally, I don't even know if that is right or not (still) - but there it is.
 

restoshammyman

New member
Jan 5, 2009
261
0
0
Gitsnik said:
restoshammyman said:
Gitsnik said:
kommando367 said:
None of them.
I think this too. But:
Kpt._Rob said:
If I may adapt something Lewis Black said to our purposes here. There is not enough liquor in the universe to get one through the tedious mathematical process that would be necessary to solve this.
I don't know if my maths is correct:
Code:
#!/usr/bin/perl
use strict;
use warnings;
my @switch = ();
foreach (1..100) {
        $switch[$_] = 0;
}
foreach my $goblin (1..100) {
        foreach my $light (1..100) {
                for(my $counter = 2; $counter <= int($light / $goblin); $counter++) {
                        my $val = $goblin / $light;
                        print qq|$val\n|;
                        if($val !~ /\./) {
                                $switch[$light] = ($switch[$light] == 0 ? 1 : 0);
                                $counter = 2000000;
                        }
                }
        }
}
foreach (1..100) {
        print "$_ is on\n" if $switch[$_] == 1;
}
Edit:

Oh I don't think it was, that should have been my $val = $light / $goblin;

If that is the case then we have:

2 is on
3 is on
5 is on
6 is on
7 is on
8 is on
10 is on
11 is on
12 is on
13 is on
14 is on
15 is on
17 is on
18 is on
19 is on
20 is on
21 is on
22 is on
23 is on
24 is on
26 is on
27 is on
28 is on
29 is on
30 is on
31 is on
32 is on
33 is on
34 is on
35 is on
37 is on
38 is on
39 is on
40 is on
41 is on
42 is on
43 is on
44 is on
45 is on
46 is on
47 is on
48 is on
50 is on
51 is on
52 is on
53 is on
54 is on
55 is on
56 is on
57 is on
58 is on
59 is on
60 is on
61 is on
62 is on
63 is on
65 is on
66 is on
67 is on
68 is on
69 is on
70 is on
71 is on
72 is on
73 is on
74 is on
75 is on
76 is on
77 is on
78 is on
79 is on
80 is on
82 is on
83 is on
84 is on
85 is on
86 is on
87 is on
88 is on
89 is on
90 is on
91 is on
92 is on
93 is on
94 is on
95 is on
96 is on
97 is on
98 is on
99 is on

Again, not sure if that's correct.
so freaking wrong. check your program. to bad i only know pascal and javascript :(
It's the logic not the program ;)

Teach me to write code when I should be working.
i looked at your results.
they are backwards. your printing the lights that are off.
 

waggmd

New member
Feb 12, 2009
286
0
0
restoshammyman said:
waggmd said:
I think the only one's left on are the are lights which are perfect squares.
wow that was fast.
we got a guy with a working brain over here.
Actually I just helped my sister with this problem not too long ago. It was part of her Grade 8 math assignment.
 

Gitsnik

New member
May 13, 2008
798
0
0
restoshammyman said:
i looked at your results.
they are backwards. your printing the lights that are off.
My divisor was off by one I think. See the edit to the post you quoted.
 

dragontiers

The Temporally Displaced
Feb 26, 2009
497
0
0
Um, quick question. Which lights, if any, were on before the goblins started throwing switches? That is a major factor in the equations.
 

About To Crash

New member
Apr 24, 2009
332
0
0
I think that any number that has an odd number of different roots will be on. That's because it will be flicked an odd number of times, and end up in the on position.
Any number with an even number of different roots will be off, because it will be flicked an even number of times.

1, 4, 9, 24, etc.

I think.

And I'm assuming (Though this wasn't noted) that all the lights start off. If they do, groovy. If not, balls...

EDIT: Nope, nevermind, I'm way off.
 

restoshammyman

New member
Jan 5, 2009
261
0
0
Gitsnik said:
restoshammyman said:
so freaking wrong. check your program. to bad i only know pascal and javascript :(
It's the logic not the program ;)

Teach me to write code when I should be working.

Edit:

Well there you go, change that 2 for a 1 in the loop:

1 is on
4 is on
9 is on
16 is on
25 is on
36 is on
49 is on
64 is on
81 is on
100 is on

Personally, I don't even know if that is right or not (still) - but there it is.
100 is not on.
do you notice a pattern in the other ones?
 

restoshammyman

New member
Jan 5, 2009
261
0
0
dragontiers said:
Um, quick question. Which lights, if any, were on before the goblins started throwing switches? That is a major factor in the equations.
they all start off.
i spent an hour idiot proofing and i missed that.