+ Reply to Thread
Results 1 to 4 of 4

Evenly distribute numbers

Hybrid View

  1. #1
    Registered User
    Join Date
    10-12-2012
    Location
    Huntsville, AL
    MS-Off Ver
    Office 2010
    Posts
    2

    Evenly distribute numbers

    Ok so we use Median() on the array of numbers to get the mean and STDDEV() to get the standard deviation. I dont quite see how to do the second part programmaticly.

    Thanks,
    Captain


    Quote Originally Posted by shg View Post
    Okay ...

    Suppose you have N*M people having mean and deviation {A,S}, to be divided into N groups of M people each.

    Find the M-subset of N that gives {a,s} closest to {A,S}, make that a group, and remove them from the list.

    Repeat until done.
    Original thread here http://www.excelforum.com/excel-gene...f-numbers.html
    Last edited by arlu1201; 05-06-2013 at 02:25 AM.

  2. #2
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678

    Re: Evenly Distribute Groups of Numbers?

    Aside from wanting a result like B3 wanted, what is your reason for needing to do this?
    Entia non sunt multiplicanda sine necessitate

  3. #3
    Registered User
    Join Date
    10-12-2012
    Location
    Huntsville, AL
    MS-Off Ver
    Office 2010
    Posts
    2

    Re: Evenly Distribute Groups of Numbers?

    I have 8 processors in my computer and I have some heavy computation to do. Sadly the process is not multithreaded. So I need to evenly distribute the 53 processes across all 8 processors. Each process has different processing time.

    I planned to do this by dividing the processes into 8 groups and writing 8 scripts that will run on one processor each.

    if you wanted a smaller example lets take 8 processes on 4 processors:


    Processing Time Process Name
    100 A
    20 B
    10 C
    9 D
    8 E
    60 F
    2 G
    1 H

    If this table was the values that I am working with and I had 4 processors then I would want these results:

    Processor Group Process Name Summed weight
    1 A 100
    2 F 60
    3 B,G,H 23
    4 C,D,E 27

    Do you see any way to do this?

    I have done some macro programming also but I'm having a hard time figuring out how to do it even in a macro.

    Thanks,
    Kirk









    Quote Originally Posted by shg View Post
    Aside from wanting a result like B3 wanted, what is your reason for needing to do this?
    Last edited by captain118; 05-05-2013 at 12:21 AM. Reason: I missed the E when figuring the results table.

  4. #4
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678

    Re: Evenly Distribute Groups of Numbers?

    That's a totally different problem. B3 wanted groups that had a common average AND common SD. All you want is a more or less common total time, a massively simpler problem.

    Conceptually, sort the times from largest to smallest. Assign each process in turn to the least-loaded CPU.

           --B--- ---C--- --D-- E -F-- -G-- -H-- -I--
       7    Task  # Tasks Group     1    2    3    4 
       8   Task1      99     1     99    0    0    0 
       9   Task2      98     2     99   98    0    0 
      10   Task3      90     3     99   98   90    0 
      11   Task4      84     4     99   98   90   84 
      12   Task5      78     4     99   98   90  162 
      13   Task6      76     3     99   98  166  162 
      14   Task7      64     2     99  162  166  162 
      15   Task8      62     1    161  162  166  162 
      16   Task9      61     1    222  162  166  162 
      17   Task10     61     2    222  223  166  162 
      18   Task11     56     4    222  223  166  218 
      19   Task12     51     3    222  223  217  218 
      20   Task13     48     3    222  223  265  218 
      21   Task14     47     4    222  223  265  265 
      22   Task15     42     1    264  223  265  265 
      23   Task16     42     2    264  265  265  265 
      24   Task17     40     1    304  265  265  265 
      25   Task18     39     2    304  304  265  265 
      26   Task19     34     3    304  304  299  265 
      27   Task20     16     4    304  304  299  281 
      28   Task21     16     4    304  304  299  297 
      29   Task22     16     4    304  304  299  313 
      30   Task23     15     3    304  304  314  313 
      31   Task24     13     1    317  304  314  313
    The formula in D8 and copied down is

    =MATCH(MIN(F7:I7), F7:I7, 0)

    The formula in F8 and copied down and across is

    =SUMIF($D$7:$D8, F$7, $C$7:$C8)
    Last edited by shg; 05-05-2013 at 01:31 AM.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1