Results 1 to 5 of 5

Thread: Challenge: Sets whose Elements Sum to...

  1. #1

    Thread Starter
    pathfinder NotLKH's Avatar
    Join Date
    Apr 2001
    Posts
    2,397

    Question Challenge: Sets whose Elements Sum to...

    Code:
    Given:
    	You have 13 variables, F_0 thru F_12, that represent 13 distinct sets of numbers.
    	These Variables, The Number of elements in their sets, and the sums of the 
    	elements in their sets are listed below:
    		F(n)		#Elements		Sums(Of their elements)
    		F(0)		#=1			Sum=0
    		F(1)		#=6			Sum=22
    		F(2)		#=3			Sum=50
    		F(3)		#=3			Sum=41
    		F(4)		#=6			Sum=58
    		F(5)		#=6			Sum=147
    		F(6)		#=6			Sum=156
    		F(7)		#=6			Sum=203
    		F(8)		#=3			Sum=177
    		F(9)		#=3			Sum=168
    		F(10)		#=6			Sum=295
    		F(11)		#=6			Sum=286
    		F(12)		#=6			Sum=227
    
    
    
    	The sets can only use the numbers 0 thru 60, and cumulatively, these numbers
    	are used once and only once across the entire sets of variables.
    
    So for example,
    	Consider:
    		F(8)		#=3			Sum=177
    	This identifies that:
    		F(8) is the sum of 3 numbers that add to 177
    
    	Since the range of all possible numbers that F(8) can draw from is 0->60 
    	{or for that matter, Any of the F variable sets};
    		And since the TOP(3) Values, 58,59,60 sum to 177
    	We know that F(8) MUST BE {58,59,60}
    		[if any of the distinct elements for F(8) were less than 58, 
    		then it would require a number greater than 60 to also be 
    		an element, which is beyond the allowed range.]
    	And at this point we also know that the numbers 58 59 and 60
    	Cannot be used by any other Variable set other than F(8), which simplifies
    	the analysis of the remaining F sets.
    
    Therefore:
    	Either
    		Determine the 2 possible sets of numbers for F(4)
    	OR
    		Tell me why F(4) has either more or less than 2 solution sets.

    Enjoy!

  2. #2
    Frenzied Member
    Join Date
    Jun 2006
    Posts
    1,098

    Solution: Sets whose Elements Sum to...

    Similar to the proof given as an example, that F(8) = {58,59,60}, the collective sum of the 42 numbers in sets F(5) through F(12) is 1659. This can only be the sum of the numbers 19 through 60, inclusive, thereby limiting the range for the remaining sets to 0 through 18.

    The first three each have only one solution:
    F(0) = {0}
    F(1) = {1,2,3,4,5,7}
    F(2) = {15,17,18}

    This leaves us with 9 numbers for F(3) and F(4), and two possible solutions for those sets:
    F(3) = {11,14,16}
    F(4) = {6,8,9,10,12,13}
    -OR-
    F(3) = {12,13,16}
    F(4) = {6,8,9,10,11,14}

  3. #3

    Thread Starter
    pathfinder NotLKH's Avatar
    Join Date
    Apr 2001
    Posts
    2,397

    Re: Challenge: Sets whose Elements Sum to...

    lol.

    Very Good!


    Now,

    Can you generically code this?
    {Up to the 11,12,13,14 point anyways}

    I'll start with the prelim setup:

    {vbnet}

    VB Code:
    1. Public Class Form1
    2.     Dim SUPERFAMS_CELLCOUNTS() As Integer
    3.     Dim FAM_SOL() As Integer
    4.     Dim SUPER_FAMCOUNT As Integer
    5.     Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
    6.         SUPER_FAMCOUNT = 12
    7.         ReDim SUPERFAMS_CELLCOUNTS(SUPER_FAMCOUNT)
    8.         ReDim FAM_SOL(SUPER_FAMCOUNT)
    9.  
    10.         SUPERFAMS_CELLCOUNTS(0) = 1
    11.         SUPERFAMS_CELLCOUNTS(1) = 6
    12.         SUPERFAMS_CELLCOUNTS(2) = 3
    13.         SUPERFAMS_CELLCOUNTS(3) = 3
    14.         SUPERFAMS_CELLCOUNTS(4) = 6
    15.         SUPERFAMS_CELLCOUNTS(5) = 6
    16.         SUPERFAMS_CELLCOUNTS(6) = 6
    17.         SUPERFAMS_CELLCOUNTS(7) = 6
    18.         SUPERFAMS_CELLCOUNTS(8) = 3
    19.         SUPERFAMS_CELLCOUNTS(9) = 3
    20.         SUPERFAMS_CELLCOUNTS(10) = 6
    21.         SUPERFAMS_CELLCOUNTS(11) = 6
    22.         SUPERFAMS_CELLCOUNTS(12) = 6
    23.  
    24.         FAM_SOL(0) = 0
    25.         FAM_SOL(1) = 22
    26.         FAM_SOL(2) = 50
    27.         FAM_SOL(3) = 41
    28.         FAM_SOL(4) = 58
    29.         FAM_SOL(5) = 147
    30.         FAM_SOL(6) = 156
    31.         FAM_SOL(7) = 203
    32.         FAM_SOL(8) = 177
    33.         FAM_SOL(9) = 168
    34.         FAM_SOL(10) = 295
    35.         FAM_SOL(11) = 286
    36.         FAM_SOL(12) = 227
    37.  
    38.     End Sub

  4. #4

    Thread Starter
    pathfinder NotLKH's Avatar
    Join Date
    Apr 2001
    Posts
    2,397

    Re: Solution: Sets whose Elements Sum to...

    Quote Originally Posted by Logophobic
    The first three each have only one solution:
    F(0) = {0}
    F(1) = {1,2,3,4,5,7}
    F(2) = {15,17,18}

    Hmmm,,,,


    I'll look it over, but I'm not sure that you can initially easily say that about F(2). {Without considering F4 and F3 first} {Although you are absolutely correct}
    At least, in My algorythm, the sequence of consideration is F0, F1, F4, F3, Then F2, ie... I'm looking at the Bot_Sums(N)

    Got Milk, err,,, a summerization of why you say that?

  5. #5

    Thread Starter
    pathfinder NotLKH's Avatar
    Join Date
    Apr 2001
    Posts
    2,397

    Re: Challenge: Sets whose Elements Sum to...

    Similar to the proof given as an example, that F(8) = {58,59,60}, the collective sum of the 42 numbers in sets F(5) through F(12) is 1659. This can only be the sum of the numbers 19 through 60, inclusive, thereby limiting the range for the remaining sets to 0 through 18.
    Ahh. Now that I've reread, Yep!
    You went the Top_Sums route, whereas I go the Bot_Sums route first.

    Good Job!

    Still,

    Given the initial conditions,

    {Challenge #2}

    What are the minimal sets that each F can draw from to build their sets?

    For Example,

    As You indicated,

    F4 is a subset, a combination, of 6 out of the 8 numbers in the set: {6 8 9 10 11 12 13 14}

    And, This is the Minimal set that will produce ALL of the solutions for F(4)

    What are the equivalent sets for all the other F's?

Posting Permissions

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



Click Here to Expand Forum to Full Width