Awesome Thinker Problem!!

\\OFF-TOPIC// conversations about everything that has nothing to do with Conquer Club.

Moderator: Community Team

Forum rules
Please read the Community Guidelines before posting.
User avatar
TheProwler
Posts: 354
Joined: Mon Feb 12, 2007 9:54 am
Gender: Male
Location: Ontario, Canada

Re: Awesome Thinker Problem!!

Post by TheProwler »

So does this satisfy the conditions to be considered a solution?

Call the switches A, B, C, D. So, turn 2 switches on - A and B. Wait one minute or so (enough time for the bulb to get very hot if it is on). Now, quickly turn off B and turn on C and lift the lid. Touch the bulb. Is it very hot?

A - bulb is lit and very hot
B - bulb is out and very hot
C - bulb is lit and cool
D - bulb is out and cool
El Capitan X wrote:The people in flame wars just seem to get dimmer and dimmer. Seriously though, I love your style, always a good read.
User avatar
john9blue
Posts: 1268
Joined: Mon Aug 20, 2007 6:18 pm
Gender: Male
Location: FlutterChi-town

Re: Awesome Thinker Problem!!

Post by john9blue »

TheProwler wrote:So does this satisfy the conditions to be considered a solution?

Call the switches A, B, C, D. So, turn 2 switches on - A and B. Wait one minute or so (enough time for the bulb to get very hot if it is on). Now, quickly turn off B and turn on C and lift the lid. Touch the bulb. Is it very hot?

A - bulb is lit and very hot
B - bulb is out and very hot
C - bulb is lit and cool
D - bulb is out and cool


Yup, that's what I had in mind.

Umm... another one... okay, so you're a school janitor and you're bored. You decide to mess with the lockers, because the students are pissing you off. The hallway is lined with 1000 lockers, labeled 1 to 1000. You walk down the hallway and open every locker. Then you walk down again and close every locker that's a multiple of 2. Then, you walk down a third time and change every locker that is a multiple of 3 (by "change", I mean close it if it is open and open it if it is closed). Then you do the same for multiples of 4, 5, etc., until you reach multiples of 100 (i.e. changing lockers 100, 200, 300, ... 1000). When you finish, which lockers will be open?

There is a problem like this that some of you may have heard, so I added my own twist to change things up. :P
natty_dread wrote:Do ponies have sex?
Army of GOD wrote:the term heterosexual is offensive. I prefer to be called "normal"
(proud member of the Occasionally Wrongly Banned)
User avatar
TheProwler
Posts: 354
Joined: Mon Feb 12, 2007 9:54 am
Gender: Male
Location: Ontario, Canada

Re: Awesome Thinker Problem!!

Post by TheProwler »

john9blue wrote:
TheProwler wrote:So does this satisfy the conditions to be considered a solution?

Call the switches A, B, C, D. So, turn 2 switches on - A and B. Wait one minute or so (enough time for the bulb to get very hot if it is on). Now, quickly turn off B and turn on C and lift the lid. Touch the bulb. Is it very hot?

A - bulb is lit and very hot
B - bulb is out and very hot
C - bulb is lit and cool
D - bulb is out and cool


Yup, that's what I had in mind.

Umm... another one... okay, so you're a school janitor and you're bored. You decide to mess with the lockers, because the students are pissing you off. The hallway is lined with 1000 lockers, labeled 1 to 1000. You walk down the hallway and open every locker. Then you walk down again and close every locker that's a multiple of 2. Then, you walk down a third time and change every locker that is a multiple of 3 (by "change", I mean close it if it is open and open it if it is closed). Then you do the same for multiples of 4, 5, etc., until you reach multiples of 100 (i.e. changing lockers 100, 200, 300, ... 1000). When you finish, which lockers will be open?

There is a problem like this that some of you may have heard, so I added my own twist to change things up. :P


1^2, 2^2, 3^2, 4^2...9^2, 10^2

so 1, 4, 9, 16....81, 100

But I'm not sure why you stopped at 100...that will mess up the pattern...so past 100, I am not sure...for instance, 101 will be open...but only because you stopped at 100. Same for 102. But for 202, 303, 404, 505, 606, 707, etc. (ie. multiples of 101) I will not be sure...
El Capitan X wrote:The people in flame wars just seem to get dimmer and dimmer. Seriously though, I love your style, always a good read.
User avatar
pimpdave
Posts: 1083
Joined: Fri Nov 30, 2007 10:15 am
Gender: Male
Location: Anti Tea Party Death Squad Task Force Headquarters
Contact:

Re: Awesome Thinker Problem!!

Post by pimpdave »

qeee1 wrote:Girls can't drive buses.


This is actually the correct answer.
jay_a2j wrote:hey if any1 would like me to make them a signature or like an avator just let me no, my sig below i did, and i also did "panther 88" so i can do something like that for u if ud like...
User avatar
Haggis_McMutton
Posts: 403
Joined: Sun Mar 26, 2006 11:32 am
Gender: Male

Re: Awesome Thinker Problem!!

Post by Haggis_McMutton »

john9blue wrote:
TheProwler wrote:So does this satisfy the conditions to be considered a solution?

Call the switches A, B, C, D. So, turn 2 switches on - A and B. Wait one minute or so (enough time for the bulb to get very hot if it is on). Now, quickly turn off B and turn on C and lift the lid. Touch the bulb. Is it very hot?

A - bulb is lit and very hot
B - bulb is out and very hot
C - bulb is lit and cool
D - bulb is out and cool


Yup, that's what I had in mind.

Umm... another one... okay, so you're a school janitor and you're bored. You decide to mess with the lockers, because the students are pissing you off. The hallway is lined with 1000 lockers, labeled 1 to 1000. You walk down the hallway and open every locker. Then you walk down again and close every locker that's a multiple of 2. Then, you walk down a third time and change every locker that is a multiple of 3 (by "change", I mean close it if it is open and open it if it is closed). Then you do the same for multiples of 4, 5, etc., until you reach multiples of 100 (i.e. changing lockers 100, 200, 300, ... 1000). When you finish, which lockers will be open?

There is a problem like this that some of you may have heard, so I added my own twist to change things up. :P


I think enough time has passed that it`s safe to say this one won't likely be solved( damn your "twist")

So to encourage you to post the solution and move on, i thought i'd do the nice thing and brute force it.

1 4 9 16 25 36 49 64 81 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 197 198 199 200 201 203 205 207 209 211 213 215 217 219 221 223 227 229 231 233 235 237 239 241 243 245 247 249 251 253 255 256 257 259 261 263 265 267 269 271 273 275 277 279 281 283 285 287 291 293 295 297 299 301 305 306 307 311 312 313 317 318 319 323 325 329 330 331 335 336 337 341 342 343 347 348 349 353 354 355 359 360 365 366 367 371 372 373 377 378 379 383 384 385 389 390 391 395 396 397 400 401 402 403 404 407 409 412 413 414 415 416 419 421 424 425 426 427 428 431 433 436 437 438 439 440 441 443 445 448 449 450 451 452 455 457 460 461 462 463 464 467 469 472 473 474 475 476 479 481 485 486 487 488 491 493 496 497 498 499 500 503 508 509 511 512 517 521 522 523 524 525 527 530 532 533 534 536 539 540 541 544 546 547 548 550 551 553 555 556 557 558 559 563 568 569 571 572 576 577 581 582 583 584 585 587 589 590 592 593 594 596 599 600 601 604 607 608 610 611 612 613 615 616 617 619 623 624 625 628 629 630 631 632 636 637 641 643 644 645 647 648 649 650 652 653 656 659 661 664 667 668 670 671 672 673 675 677 679 683 684 688 689 690 691 692 696 697 701 703 704 705 708 709 710 712 713 714 716 719 724 727 729 730 731 732 733 736 737 739 742 743 744 748 750 751 752 757 761 764 765 767 768 769 772 773 776 777 779 781 784 787 788 790 792 793 795 796 797 798 799 803 804 805 809 810 811 817 819 821 823 825 826 827 828 829 830 836 839 844 850 851 852 853 854 855 857 859 861 863 869 870 871 875 876 877 880 881 882 883 884 885 887 890 892 893 896 899 900 901 903 907 908 909 911 913 915 916 918 919 920 923 927 929 930 932 936 937 938 941 943 945 947 948 949 950 952 953 954 956 960 963 964 966 967 970 971 975 977 979 980 981 983 987 988 989 991 994 996 997 999 1000

There you go.

Now let`s revive this thread, t'was fun.

Please don`t tell me i got the brute force wrong :P
Highest score: 3063; Highest position: 67;
Winner of {World War II tournament, -team 2010 Skilled Diversity, [FuN||Chewy]-[XII] USA};
8-3-7
User avatar
john9blue
Posts: 1268
Joined: Mon Aug 20, 2007 6:18 pm
Gender: Male
Location: FlutterChi-town

Re: Awesome Thinker Problem!!

Post by john9blue »

Haggis_McMutton wrote:I think enough time has passed that it`s safe to say this one won't likely be solved( damn your "twist")

So to encourage you to post the solution and move on, i thought i'd do the nice thing and brute force it.

1 4 9 16 25 36 49 64 81 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 197 198 199 200 201 203 205 207 209 211 213 215 217 219 221 223 227 229 231 233 235 237 239 241 243 245 247 249 251 253 255 256 257 259 261 263 265 267 269 271 273 275 277 279 281 283 285 287 291 293 295 297 299 301 305 306 307 311 312 313 317 318 319 323 325 329 330 331 335 336 337 341 342 343 347 348 349 353 354 355 359 360 365 366 367 371 372 373 377 378 379 383 384 385 389 390 391 395 396 397 400 401 402 403 404 407 409 412 413 414 415 416 419 421 424 425 426 427 428 431 433 436 437 438 439 440 441 443 445 448 449 450 451 452 455 457 460 461 462 463 464 467 469 472 473 474 475 476 479 481 485 486 487 488 491 493 496 497 498 499 500 503 508 509 511 512 517 521 522 523 524 525 527 530 532 533 534 536 539 540 541 544 546 547 548 550 551 553 555 556 557 558 559 563 568 569 571 572 576 577 581 582 583 584 585 587 589 590 592 593 594 596 599 600 601 604 607 608 610 611 612 613 615 616 617 619 623 624 625 628 629 630 631 632 636 637 641 643 644 645 647 648 649 650 652 653 656 659 661 664 667 668 670 671 672 673 675 677 679 683 684 688 689 690 691 692 696 697 701 703 704 705 708 709 710 712 713 714 716 719 724 727 729 730 731 732 733 736 737 739 742 743 744 748 750 751 752 757 761 764 765 767 768 769 772 773 776 777 779 781 784 787 788 790 792 793 795 796 797 798 799 803 804 805 809 810 811 817 819 821 823 825 826 827 828 829 830 836 839 844 850 851 852 853 854 855 857 859 861 863 869 870 871 875 876 877 880 881 882 883 884 885 887 890 892 893 896 899 900 901 903 907 908 909 911 913 915 916 918 919 920 923 927 929 930 932 936 937 938 941 943 945 947 948 949 950 952 953 954 956 960 963 964 966 967 970 971 975 977 979 980 981 983 987 988 989 991 994 996 997 999 1000

There you go.

Now let`s revive this thread, t'was fun.

Please don`t tell me i got the brute force wrong :P


LOL! You have lots of free time, I guess.

When I first thought of this problem, I thought it would be easy. Turns out I had to spend about ten minutes figuring out how to do it (and an hour actually writing this post and finding the answer).

The way the problem usually goes is that the janitor goes through 1-1000, instead of 1-100. I decided to make it harder, since people might have seen that one before.

So, let's say that the janitor does 1-1000. The open lockers are, of course, the perfect squares, since they are the only numbers with an odd amount of factors.

If the janitor does 1-500, then the open lockers are:
1-500: all perfect squares,
501-1000: all except perfect squares.
This is because the janitor, when doing multiples of 501-1000, only has to change a single locker. So, the last half are the opposite of what they would be in 1-1000. You can see that going from 1-500 is the same as going from 1-1000 and then going back from 1000-501. We're gonna work backwards like that.

Now, if the janitor does 1-333, then the open lockers are:
1-333: all perfect squares,
334-666: all except perfect squares,
667-1000 multiples of 2: all perfect squares,
667-1000 not multiples of 2: all except perfect squares.
Look at the difference between this and the last one. You'd think that 333-1000 would be all except perfect squares, but the janitor starts changing two lockers now, instead of one. He's going to change lockers 499*2, 498*2, 497*2, etc., which are basically all of the evens from 667-1000.

You probably see the pattern- 1000/1 lockers, then 1000/2, then 1000/3. So, our next number is 250 (1000/4). The open lockers are:
1-250: all p.s.,
251-500: all except p.s.,
501-750 x2: all p.s.,
501-750 not x2: all except p.s.,
751-1000 x2 x3: all except p.s.,
751-1000 x2 not x3: all p.s.,
751-1000 not x2 x3: all p.s.,
751-1000 not x2 not x3: all except p.s..
Heh, as you can see, this problem is spiraling out of control fast. This follows the same pattern as the last one.

Let's try 1-200. The open lockers are:
1-200: all p.s.,
201-400: all except p.s.,
401-600 x2: all p.s.,
401-600 not x2: all except p.s.,
601-800 x2 x3: all except p.s.,
601-800 x2 not x3: all p.s.,
601-800 not x2 x3: all p.s.,
601-800 not x2 not x3: all except p.s.,
801-1000 x2 x3 x4: all p.s.,
801-1000 x2 x3 not x4: all except p.s.,
801-1000 x2 not x3 x4: all except p.s.,
801-1000 x2 not x3 not x4: all p.s.,
801-1000 not x2 x3 x4: all except p.s.,
801-1000 not x2 x3 not x4: all p.s.,
801-1000 not x2 not x3 x4: all p.s.,
801-1000 not x2 not x3 notx4: all except p.s..

Blehhhhhhh.

But, there's a pattern in this mess. Notice that, for lockers 801-1000, the numbers that divide into an odd number of factors 2-4 are all p.s., and the numbers that divide into an even number of factors 2-4 are all except p.s.. For lockers 601-800, it's the same: an odd number of factors 2-3 are all p.s., and an even number of factors 2-3 are all except p.s. In fact, it's the exact same way for 250 and 333! Cha-ching.

So, how do we take this all the way to 100?

100 is, of course, 1000/10. So, we're going to divide the lockers into groups, like we've been doing. There are ten groups: 1-100, 101-200... 801-900, 901-1000. Here is the answer:

1-100: perfect squares,
101-200: all except perfect squares,
201-300 (even numbers): all perfect squares,
201-300 (odd numbers): all except perfect squares,
301-400 (odd number of factors 2-3): all perfect squares,
301-400 (even number of factors 2-3): all except perfect squares,
401-500 (odd number of factors 2-4): all perfect squares,
401-500 (even number of factors 2-4): all except perfect squares,
501-600 (odd number of factors 2-5): all perfect squares,
501-600 (even number of factors 2-5): all except perfect squares,
601-700 (odd number of factors 2-6): all perfect squares,
601-700 (even number of factors 2-6): all except perfect squares,
701-800 (odd number of factors 2-7): all perfect squares,
701-800 (even number of factors 2-7): all except perfect squares,
801-900 (odd number of factors 2-8): all perfect squares,
801-900 (even number of factors 2-8): all except perfect squares,
901-1000 (odd number of factors 2-9): all perfect squares,
901-1000 (even number of factors 2-9): all except perfect squares,

Since the multiplication tests for 2-9 are fairly easy (except for 7, get out your calculators), this makes it a lot easier to brute force the problem. But, who needs brute force when our best buddy Excel is only a few clicks away?

[bigimg]http://img133.imageshack.us/img133/456/excel1ca9.png[/bigimg]

Here, I put the locker numbers in the first row, and numbers to keep track of which ones were open/closed in the other rows. I started off by putting a 1 in every perfect square, and a 0 everywhere else. This is what happens if the janitor goes from 1-1000. As you can see, an odd number represents the locker being open, and an even number represents the locker being closed. Now, let's deal with lockers 101-200 by adding 1 to every locker above 100. You can do this by adding a few 1's, and dragging the black box on the lower right corner all the way to locker 1000.

[bigimg]http://img133.imageshack.us/img133/5959/excel2gs8.png[/bigimg]

Now, in lockers 101-200, all numbers except the perfect squares are odd. That's exactly what we want. But, in lockers 201-300, it's the same way. That's fine for the odd numbers, but we need to switch the evens. The reason it's evens and not odds is because we offset our system by adding 1 to every number. We changed it from 2-9 to 1-9. This easily fixes the problem, and checking the first few numbers will convince you that we're on the right track. Again, start a pattern, and use the black box to fill in the rest.

[bigimg]http://img395.imageshack.us/img395/1168/excel3jo9.png[/bigimg]

Done. Now, let's add 1 to every multiple of 3 above 300.

[bigimg]http://img395.imageshack.us/img395/6991/excel4ur0.png[/bigimg]

This is starting to get too easy. :P

Keep on going, and add 1 to multiples of 4 above 400, multiples to 5 above 500, etc., until you've added 1 to all multiples of 9 above 900. Here's the end of the spreadsheet.

[bigimg]http://img395.imageshack.us/img395/1685/excel5cv9.png[/bigimg]

Now, we have to find the sum of rows 2-11 for every column, and determine whether it's odd or even. Excel, once again, is our friend.

[bigimg]http://img395.imageshack.us/img395/767/excel6tz9.png[/bigimg]

You need a formula for this one. Add up rows 2-11 with the sum function, and take the mod 2 of the result. Mod 2 is a short way of saying "the remainder when you divide by 2". So, odd numbers will have a mod 2 of 1, and even numbers will have a mod 2 of 0. And remember what I said earlier?

john9blue wrote:As you can see, an odd number represents the locker being open, and an even number represents the locker being closed.


This means that a number with 1 is open, and a number with 0 is closed. We found them all! We're done! \:D/

And Haggis, there's no way in hell I'm checking all those numbers, but the last screenie seems to indicate that you got it right. So, well done! :ugeek:
natty_dread wrote:Do ponies have sex?
Army of GOD wrote:the term heterosexual is offensive. I prefer to be called "normal"
(proud member of the Occasionally Wrongly Banned)
User avatar
Haggis_McMutton
Posts: 403
Joined: Sun Mar 26, 2006 11:32 am
Gender: Male

Re: Awesome Thinker Problem!!

Post by Haggis_McMutton »

Holy shit, i was hopping you'd have a more erm succinct solution :lol:

LOL! You have lots of free time, I guess.


Actually, it only took 5 minutes.

#include<fstream.h>
ofstream out("1001.txt");
int i, v[1001],j;

void main ()
{
for(i=2;i<=100;i++)
{
for(j=i;j<=1000;j=j+i)
{
if(v[j])
v[j]=0;
else
v[j]=1;
}
}
for(i=1;i<=1000;i++)
if(!v[i])
out<<i<<" ";
}

:P
Highest score: 3063; Highest position: 67;
Winner of {World War II tournament, -team 2010 Skilled Diversity, [FuN||Chewy]-[XII] USA};
8-3-7
User avatar
TheProwler
Posts: 354
Joined: Mon Feb 12, 2007 9:54 am
Gender: Male
Location: Ontario, Canada

Re: Awesome Thinker Problem!!

Post by TheProwler »

Haha.

Brute force is what it turned out to be.
El Capitan X wrote:The people in flame wars just seem to get dimmer and dimmer. Seriously though, I love your style, always a good read.
User avatar
john9blue
Posts: 1268
Joined: Mon Aug 20, 2007 6:18 pm
Gender: Male
Location: FlutterChi-town

Re: Awesome Thinker Problem!!

Post by john9blue »

Haggis_McMutton wrote:Holy shit, i was hopping you'd have a more erm succinct solution :lol:

LOL! You have lots of free time, I guess.


Actually, it only took 5 minutes.

#include<fstream.h>
ofstream out("1001.txt");
int i, v[1001],j;

void main ()
{
for(i=2;i<=100;i++)
{
for(j=i;j<=1000;j=j+i)
{
if(v[j])
v[j]=0;
else
v[j]=1;
}
}
for(i=1;i<=1000;i++)
if(!v[i])
out<<i<<" ";
}

:P


Cheater! That's not brute force, that's using your head! :P

I can't do much computer programming (except TI basic, but I left my calculator at college), but after next semester, I'll know Java (and it looks like that's what you're using). :)
natty_dread wrote:Do ponies have sex?
Army of GOD wrote:the term heterosexual is offensive. I prefer to be called "normal"
(proud member of the Occasionally Wrongly Banned)
User avatar
InkL0sed
Posts: 2370
Joined: Sat Jun 23, 2007 4:06 pm
Gender: Male
Location: underwater
Contact:

Re: Awesome Thinker Problem!!

Post by InkL0sed »

john9blue wrote:
Haggis_McMutton wrote:Holy shit, i was hopping you'd have a more erm succinct solution :lol:

LOL! You have lots of free time, I guess.


Actually, it only took 5 minutes.

#include<fstream.h>
ofstream out("1001.txt");
int i, v[1001],j;

void main ()
{
for(i=2;i<=100;i++)
{
for(j=i;j<=1000;j=j+i)
{
if(v[j])
v[j]=0;
else
v[j]=1;
}
}
for(i=1;i<=1000;i++)
if(!v[i])
out<<i<<" ";
}

:P


Cheater! That's not brute force, that's using your head! :P

I can't do much computer programming (except TI basic, but I left my calculator at college), but after next semester, I'll know Java (and it looks like that's what you're using). :)


I believe that's C++, actually.
User avatar
john9blue
Posts: 1268
Joined: Mon Aug 20, 2007 6:18 pm
Gender: Male
Location: FlutterChi-town

Re: Awesome Thinker Problem!!

Post by john9blue »

InkL0sed wrote:I believe that's C++, actually.


Huh, my bad. Never used C++... :oops:
natty_dread wrote:Do ponies have sex?
Army of GOD wrote:the term heterosexual is offensive. I prefer to be called "normal"
(proud member of the Occasionally Wrongly Banned)
User avatar
TheProwler
Posts: 354
Joined: Mon Feb 12, 2007 9:54 am
Gender: Male
Location: Ontario, Canada

Re: Awesome Thinker Problem!!

Post by TheProwler »

Ok, that last puzzle was so much fun, I'll come up with one:

There are 360 full bottles of beer. Three college students have to drink all the beer in a little under a week, starting on Monday and ending Sunday at 6:00 p.m.. But there are certain rules.

Billy can only start drinking once Kenny has finished his 3rd beer of the day.
Kenny is not allowed to start drinking until he is done his classes for the day.
john is not allowed to drink a full bottle of beer - he only gets to drink the last few drops that might be left behind in any bottle.
It takes Kenny 15 minutes to drink a beer.
It takes Billy 10 minutes to drink a beer, but he needs a 30 minute break after his 3rd, 7th, 12th, and 18th beer of the day. He can only drink 24 beer in a day.
john is not allowed to defecate the entire week and he must eat three full meals each day.
Kenny has classes until 2:00 on Monday, 3:00 on Tuesday, and 4:00 on Wednesday, Thursday, and Friday.

Solve this problem:

It is Sunday at 5:00 p.m.

If they drank as much as possible, did they finish the beer? If so, when was it finished? If not, how much beer is left? What is john full of?
El Capitan X wrote:The people in flame wars just seem to get dimmer and dimmer. Seriously though, I love your style, always a good read.
Post Reply

Return to “Acceptable Content”