April 24th, 2017, 12:47 AM  #11 
Senior Member Joined: Feb 2016 From: Australia Posts: 1,518 Thanks: 506 Math Focus: Yet to find out.  You've posted large lists in other threads. I'm curious if you punch them in manually here, or can Mathematica help with that process?

April 24th, 2017, 02:37 AM  #12 
Senior Member Joined: Sep 2015 From: USA Posts: 1,760 Thanks: 903  
April 24th, 2017, 07:09 AM  #13 
Math Team Joined: Oct 2011 From: Ottawa Ontario, Canada Posts: 11,665 Thanks: 740  
April 24th, 2017, 10:25 AM  #14 
Senior Member Joined: Sep 2015 From: USA Posts: 1,760 Thanks: 903  
April 24th, 2017, 10:38 AM  #15  
Math Team Joined: Oct 2011 From: Ottawa Ontario, Canada Posts: 11,665 Thanks: 740  Quote:
We know 0 appears only once (as first item). So we set count=1, and print a damn 0! So to complete job, we only need alphabet (3,4,7,8 ). (whatever the hell "alphabet" means!)  
April 24th, 2017, 10:51 AM  #16  
Senior Member Joined: Sep 2015 From: USA Posts: 1,760 Thanks: 903  Quote:
Alphabet is just the term for the elements you are making tuples out of. the code (* create the set of possible weights *) ab = {0, 3, 4, 7, 8}; (* now create the possible sets of 6 weights *) wts = Tuples[ab, {6}]; (* remove duplicates *) wts = Map[Sort[#] &, wts] // DeleteDuplicates; (* select those that have total weight <= 20 *) wts = Select[wts, (# /. List > Plus) <= 20 &]; (* remove the zeros *) wts = Map[DeleteCases[#, x_ /; x == 0] &, wts]; (* display the weights *) wts // MatrixForm the language is totally cryptic but once you get used to it and used to thinking in lists it's tremendously versatile Last edited by romsek; April 24th, 2017 at 11:15 AM.  
April 24th, 2017, 11:36 AM  #17 
Math Team Joined: Oct 2011 From: Ottawa Ontario, Canada Posts: 11,665 Thanks: 740 
YUK! I'm remaining faithful to Miss UBasic...

April 24th, 2017, 12:46 PM  #18 
Math Team Joined: Oct 2011 From: Ottawa Ontario, Canada Posts: 11,665 Thanks: 740 
Curious... Limitless number of weights, from 1kg to 9 kg. How many combinations of 6 weights where total weight < 26kg? Order does not matter: like, 111177 and 771111 both qualify. Miss UBasic tells me 129,157 With Mathematica, how long does it take to perform this? 
April 24th, 2017, 02:26 PM  #19 
Senior Member Joined: Sep 2015 From: USA Posts: 1,760 Thanks: 903  what does that mean? is pi one of the weights? how about e? :P Assuming weights 1,2,3,4,5,6,7,8,9 I'm getting nothing close to 129k. I show 994 for the weight set above when all combos must be length 6. Last edited by romsek; April 24th, 2017 at 02:34 PM. 
April 24th, 2017, 06:27 PM  #20  
Math Team Joined: Oct 2011 From: Ottawa Ontario, Canada Posts: 11,665 Thanks: 740  Quote:
994?! How in heck did mathematica come up with that... There are a total of 9^6 = 531441 combinations. Of those, 129157 have digits that add up <26. 1: 111111 2: 111112 3: 111113 ... 129155: 993121 129156: 993211 129157: 994111 Sooo....where did you goof?!  

Tags 
combinations, line, sequences, weights 
Thread Tools  
Display Modes  

Similar Threads  
Thread  Thread Starter  Forum  Replies  Last Post 
Unequal Weights  mathmaniac  Physics  24  February 1st, 2013 05:09 PM 
Geometry or weights?  mydisguise08  Geometry  2  September 2nd, 2009 05:07 PM 
Find previous weights from current weights & percent change  billiboy  Applied Math  4  June 16th, 2009 12:26 AM 
keyword relativity datatype weights and algorithm  totus  Applied Math  4  February 28th, 2009 10:08 PM 