Pink Poogle Toy Forum

The official community of Pink Poogle Toy
Main Site
NeoDex
It is currently Mon Nov 18, 2024 12:19 pm

All times are UTC




Post new topic This topic is locked, you cannot edit posts or make further replies.  [ 12 posts ] 
Author Message
 Post subject: Lenny Conundrum 205
PostPosted: Wed Feb 28, 2007 11:16 pm 
Moderator
Moderator
User avatar

Posts: 2898
Joined: Tue Dec 27, 2005 7:21 am
Location: Hakazura Temple
Quote:
In an exceptionally long corridor in the Virtupets Space Station, there are one thousand windows along one wall. Coincidentally, there are exactly one thousand Grundos in the station. Dr Sloth orders the first Grundo to open the blinds on every window. Then, he orders the second Grundo to close the blinds on every second window. Then the third Grundo is told to go to every third window, and close the blinds if they are open, and open the blinds if they are closed. The fourth Grundo does this for every fourth window, and so on.

After all 1000 Grundos complete the process, how many blinds are open?


I feel really proud of myself because I programmed the solution to this in Java. I hope I did it right, though.

My answer was a prime number.


Image

IDB Rater, Pink Inker


Top
 Profile  
 
 Post subject:
PostPosted: Thu Mar 01, 2007 12:16 am 
Newbie
Newbie

Posts: 15
Joined: Mon Mar 13, 2006 3:09 pm
HEY, I DELETE IT MYSELF AS I MISCOUNTED ANYWAY SO CAN'T WIN. :(


Last edited by eagle_in_your_mind on Thu Mar 01, 2007 4:11 am, edited 1 time in total.

Top
 Profile  
 
 Post subject:
PostPosted: Thu Mar 01, 2007 3:35 am 
PPT Trainee
PPT Trainee

Posts: 549
Joined: Wed Jun 22, 2005 2:07 pm
Location: Huntington, NY
Gender: Male
That's probably far too big of a hint. That's almost the whole way there.

Just in case that post does end up deleted, here's a replacement
Hint: Instead of thinking about the doors that are visited by a specific Grundo, consider which Grundos visit a specific door.

My reasoning pretty much matches eagle_in_your_mind's, but my answer is prime too. Rounding error?

One might think that there is also a slight ambiguity - I assumed that "every second" starts at the second window, but "every second" could start at the first. The ambiguity doesn't have as much impact as one would expect. It would have more impact if there were 999 doors - I'll leave the reasoning open.

I've seen this puzzle before. The conundrums lately seem awfully bottled, to be honest. :(


~Habitual over-analyzer


Last edited by AySz88 on Thu Mar 01, 2007 4:15 am, edited 1 time in total.

Top
 Profile  
 
 Post subject:
PostPosted: Thu Mar 01, 2007 4:02 am 
Newbie
Newbie

Posts: 15
Joined: Mon Mar 13, 2006 3:09 pm
Oops I missed one out. Once I knew the type of number I googled a list of them to save time. The list is missing one of the numbers. :oops:


Top
 Profile  
 
 Post subject:
PostPosted: Thu Mar 01, 2007 4:14 am 
PPT Trainee
PPT Trainee

Posts: 549
Joined: Wed Jun 22, 2005 2:07 pm
Location: Huntington, NY
Gender: Male
eagle_in_your_mind wrote:
HEY, I DELETE IT MYSELF AS I MISCOUNTED ANYWAY SO CAN'T WIN. :(


Sorry. :( You can hold onto it and post it as a solution after it's judged, maybe. :)


~Habitual over-analyzer


Top
 Profile  
 
 Post subject:
PostPosted: Thu Mar 01, 2007 7:56 am 
PPT Student
PPT Student
User avatar

Posts: 329
Joined: Sun Sep 25, 2005 6:19 am
Err... that one's just a rendition of a pretty common mathematical problem.

There should be at least one circulating around the web somewhere...since I remember seeing one.

and...yeah...its definitely a prime number...the clue is in factors....


Top
 Profile  
 
 Post subject: Re: Lenny Conundrum 205
PostPosted: Thu Mar 01, 2007 11:31 am 
PPT Trainee
PPT Trainee
User avatar

Posts: 524
Joined: Thu Nov 16, 2006 5:14 am
theonlysaneone wrote:
Quote:
In an exceptionally long corridor in the Virtupets Space Station, there are one thousand windows along one wall. Coincidentally, there are exactly one thousand Grundos in the station. Dr Sloth orders the first Grundo to open the blinds on every window. Then, he orders the second Grundo to close the blinds on every second window. Then the third Grundo is told to go to every third window, and close the blinds if they are open, and open the blinds if they are closed. The fourth Grundo does this for every fourth window, and so on.


I feel really proud of myself because I programmed the solution to this in Java. I hope I did it right, though.

My answer was a prime number.

Is there a question included there somewhere?


Image


Top
 Profile  
 
 Post subject: Re: Lenny Conundrum 205
PostPosted: Thu Mar 01, 2007 8:16 pm 
PPT Trainee
PPT Trainee

Posts: 549
Joined: Wed Jun 22, 2005 2:07 pm
Location: Huntington, NY
Gender: Male
Kenjiro wrote:
Is there a question included there somewhere?


"After all 1000 Grundos complete the process, how many blinds are open?"


~Habitual over-analyzer


Top
 Profile  
 
 Post subject: Re: Lenny Conundrum 205
PostPosted: Thu Mar 01, 2007 10:52 pm 
Honorary Member
Honorary Member

Posts: 6812
Joined: Mon Nov 22, 2004 2:02 pm
Location: Watching little birds fly kamikaze missions into the walls.
Gender: Female
AySz88 wrote:
Kenjiro wrote:
Is there a question included there somewhere?


"After all 1000 Grundos complete the process, how many blinds are open?"


I totally didn't realize the question wasn't there...It has been edited in now!


Image
It was an honor serving you PPT. I will miss you.
Click here to join my new werewolf forum!


Top
 Profile  
 
 Post subject:
PostPosted: Wed Mar 07, 2007 11:07 pm 
PPT Student
PPT Student
User avatar

Posts: 329
Joined: Sun Sep 25, 2005 6:19 am
Hmm...oh yeah, what basically happens here is that:

The 1st grundo will reach the blinds that are multiples of 1. [all]
2nd -> multiples of 2
3rd -> multiples of 3
etc.

i.e., if we focus on the windows:

The 1st window will be reached by the 1st grundo
2nd window -> 1st and 2nd grundo
3rd window -> 1st and 3rd grundo
4th window -> 1st, 2nd and 4th grundo
etc.

Thus, what we are actually interested in, is the number of factors each number has.
If the no. is odd, then the blinds would be opened,
if it's even, then the blinds would be closed.

Factors

Since factors come in pairs. The only numbers that 'have an odd no. of factors' are square numbers.

e.g.
4 = 1*4 = 2*2.
Factors of 4 = 1, 2, 4 [odd]


Blinds that are open

Hence, the 1st blind that's open will be the very first blind, and 1 can be expresses as 1*1.

2nd -> 4th blind -> 2*2
3rd -> 9th blind -> 3*3
4th -> 16th blind -> 4*4

Actual calculation

In other words, all we need to do, is to find the square number that is closest to 1000, without exceeding it. Alternatively, you could just find the square root of 1000 [31.623...], and round it down [31].

Anyway, the answer's 31, which is a prime no.


Top
 Profile  
 
 Post subject:
PostPosted: Wed Mar 07, 2007 11:24 pm 
Moderator
Moderator
User avatar

Posts: 2898
Joined: Tue Dec 27, 2005 7:21 am
Location: Hakazura Temple
I actually wrote a program in Java for this:

Code:
public class WindowCounter
{
   public static void main(String[] args)
   {
      int[] windows = new int[1001];
      int counter=0;
      
      for(int x=1; x<=1000; x++)
      {
         for(int y=1; y<=1000; y++)
         {
            if(y%x==0)
            {
               if(windows[y]==0)
                  windows[y]=1;
               else
                  windows[y]=0;
            }
         }
      }
      
      for(int z=1; z<=1000; z++)
      {
         if(windows[z]==1)
         {
            counter++;
         }
      }
      
      System.out.println(counter);
   }
}


There was probably an easier way to do it, but whatever. I placed.


Image

IDB Rater, Pink Inker


Top
 Profile  
 
 Post subject:
PostPosted: Thu Mar 08, 2007 8:54 am 
PPT Student
PPT Student
User avatar

Posts: 329
Joined: Sun Sep 25, 2005 6:19 am
theonlysaneone wrote:

Code:
               if(windows[y]==0)
                  windows[y]=1;
               else
                  windows[y]=0;




For variables switching constantly from 1 to 0, etc. you could always change it to "var = 1 - var;". ...saves space at the cost of readability...


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic This topic is locked, you cannot edit posts or make further replies.  [ 12 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 103 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Jump to:  
Powered by phpBB® Forum Software © phpBB Group