Page 3 of 5 FirstFirst 12345 LastLast
Results 21 to 30 of 43

Thread: Window Washer Problem

  1. #21
    Join Date
    Sep 2004
    Posts
    1,905
    Rep Power
    21

    Default

    I am scrutinizing again. I propose 2 test cases and show me how you can have a mathematical implementation that gives the correct result. I tried to start but you can start from scratch

    Case 1...........
    Width is 50

    Height is 1000

    Wash times is {1x950 1x2 48x1} ie {950, 2 , 1, 1, 1, ...} (lower is faster)

    N wash times is 50

    Minimum Time is 2 * (50x1000) = 100,000
    (It is best to leave out the 950 person)
    .................

    Case 2...........
    Width is 50

    Height is 1000

    Wash times is {48x200 2x100 1x1} ie {200, 200, 200,... 200, 100 , 100, 1} (lower is faster)

    N wash times is 50

    Minimum Time is 1 * (50x1000) = 50,000
    (It is best to use only the 1 person)
    .................



    Case 1...........
    Average work time = 1x950 + 1x2 + 48x1 = 1000/50 = 20

    Case 2...........
    Average work time = 48x200 + 2x100 + 1x1 = 9801/50 = 196.02
    Let's act on what we agree on now, and argue later on what we don't.
    Black men leave Barbeque alone if Barbeque don't trouble you

  2. #22
    Join Date
    Sep 2004
    Posts
    1,905
    Rep Power
    21

    Default

    I am asking that you show just the mathematical calculations no code needed. But the same math proceedure must be used and must be correct it both cases
    Let's act on what we agree on now, and argue later on what we don't.
    Black men leave Barbeque alone if Barbeque don't trouble you

  3. #23
    Join Date
    Sep 2004
    Posts
    1,905
    Rep Power
    21

    Default

    Let's act on what we agree on now, and argue later on what we don't.
    Black men leave Barbeque alone if Barbeque don't trouble you

  4. #24
    Join Date
    Jul 2005
    Posts
    75
    Rep Power
    0

    Default Window washer solution

    Crosswire i am thinking about it too.

    Let us say the width is 12 and height 12. This would make 12 x 12 = 144 windows.

    Let us further assume that the fastest person cleans a window in 10 secs. It would take this worker 1440 secs to clean all the windows himself.

    If the next fastest person cleans a window in 20 secs then..........

    This is important............

    Now i am not a math person but using a ratio theory 10:20

    Slowest washer share = 10/30 x 12 = 4 (4 x 12 = 48 windows to clean).
    Fastest washer share = 20/30 x 12 = 8 (8 x 12 = 96 windows to clean).

    This would not share time to anyone that takes too long eg. let us say that instead of 20 secs the slowest guy takes 121 secs:

    Slowest washer share = 10/131 x 12 = 0.92(4 x 12 = 48 windows to clean).
    Fastest washer share = 121/131 x 12 = 11.1(8 x 12 = 96 windows to clean).

    Now the fastest washer would wash all the windows because the slowest person would take too long.

    Back to initial problem....................

    Hence...............

    Total time taken to wash all 144 windows equal :

    Slowest washer share = 48 * 20 = 960 secs.
    Fastest washer share = 96 * 10 = 960 secs

    960secs would be the answer. I did both because the person who took longest would be the total time it took to complete the job as they started cleaning windows the same time.

    This would be how i approach this problem. Now i don't know if you could come up with a faster time to clean all the windows but i will continue to think it out.
    Last edited by Mr. Unstoppable; Aug 20, 2005 at 10:14 PM. Reason: Add content
    "A computer once beat me at chess, but it was no match for me at kick boxing." - Emo Philips -

  5. #25
    Join Date
    Sep 2004
    Posts
    1,905
    Rep Power
    21

    Default

    You are on to something, but I am not onboard until, I see how the calculations can be applied to my two test cases. It requires some decimal handling. So I will see if I get the correct answer in a few.
    Let's act on what we agree on now, and argue later on what we don't.
    Black men leave Barbeque alone if Barbeque don't trouble you

  6. #26
    Join Date
    Jul 2005
    Posts
    75
    Rep Power
    0

    Default

    Crosswire i just added something to my solution. The variable would be integer so if the slowest time share is less than 1 then the fastest person would wash all the window.

    If there are more than 2 window washer the same principle apply. I am sure you could make that adjustment.
    "A computer once beat me at chess, but it was no match for me at kick boxing." - Emo Philips -

  7. #27
    Join Date
    Sep 2004
    Posts
    1,905
    Rep Power
    21

    Default

    You gave the faster washer less time in the second example. You meant to use the inverse?
    the slowest guy takes 121 secs
    Fastest washer share = 121/131 x 12 = 11.1(8 x 12 = 96 windows to clean)

    I think it will work with inverse.
    Let's act on what we agree on now, and argue later on what we don't.
    Black men leave Barbeque alone if Barbeque don't trouble you

  8. #28
    Join Date
    Sep 2004
    Posts
    1,905
    Rep Power
    21

    Default

    I am applying the inverse and the added logic and see if it works.
    Let's act on what we agree on now, and argue later on what we don't.
    Black men leave Barbeque alone if Barbeque don't trouble you

  9. #29
    Join Date
    Sep 2004
    Posts
    1,905
    Rep Power
    21

    Default

    Well I did some calculations. I got through, but I am not onboard with the mathematical solution as yet.

    Case 1...........

    wash times
    {1x950 1x2 48x1}

    or wash times
    {950 2 1 1 1 1 1 1 1 1 1 1 1 1 1 ...}

    rates = 1/wash time
    0.0010526315789473684210526315789474 0.5 1 1 1 1 1 1 ...

    average rate
    48.5010526315789473684210526315789474

    shares = rate/average rate * 50
    0.001085163642677315739213473 0.51545273027172497612639986 1.030905460543449952252799 1.03 1.03 ...

    Condition, use only integer. This works



    Case 2...........

    wash times (corrected from previous post)
    {48x200 1x100 1x1}

    or wash times
    {200, 200, 200,... 200, 200, 200, 100, 1}

    rates = 1/wash time
    0.005 0.005 0.005 ... 0.005 0.005 0.005 0.01 1

    average rate
    1.25

    shares = rate/average rate * 50
    0.2 0.2 0.2 ... 0.2 0.2 0.2 0.4 40

    Condition, use only integer. This works as well

    Almost on board. I will test some more
    Last edited by crosswire; Aug 21, 2005 at 12:06 AM.
    Let's act on what we agree on now, and argue later on what we don't.
    Black men leave Barbeque alone if Barbeque don't trouble you

  10. #30
    Join Date
    Jul 2005
    Posts
    75
    Rep Power
    0

    Default

    Crosswire you forced me to code even though i am on a break. Here is the coded solution that i suggested.

    It should work for some cases.....................

    Code:
    // Name        : Coachdpd
    // Program     : Window Washer
    // Description : A problem that tell the quickest time to get a group of people
    //               to wash the windows of a building.
    // Date        : August 20, 2005
    // Last Updated:  4, 2005
    
    #include <stdio.h>
    #include <conio.h>
    
    #define num 10
    
    void main()
    {
       float height, width, washTime[num] = {0}, totalWashTime = 0,totalTime = 0;
       int jobTime, count = 0, x, y;
    
       do
       {
       	printf("Enter Height of Building: " );
       	scanf( "%f", &height );
    
       	printf("\nEnter Width of Building: " );
       	scanf( "%f", &width );
       }while(height == 0 && width == 0 );
    
       do
       {
       	printf("\nEnter each wash person's time: " );
       	scanf( "%f", &washTime[count] );
          totalWashTime += washTime[count];
          count++;
       }while( count < num && washTime[count - 1 ] != 0 );
       y = count - 2;
    
       for( x = 0; x < count - 1; x++ )
       {
            if( (washTime[ x ] / totalWashTime) *  (height) >= 1 )
          	   jobTime = (washTime[ x ] / totalWashTime) *  (height * width) * washTime[ y ];
    
             if( totalTime < jobTime )
             	totalTime =  jobTime;
    
          y--;
       }
    
       printf("\nTotal Time = %.0f secs", totalTime );
       getch();
    }
    Last edited by Mr. Unstoppable; Aug 21, 2005 at 12:37 AM. Reason: Code adjusted................
    "A computer once beat me at chess, but it was no match for me at kick boxing." - Emo Philips -

Posting Permissions

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