April 23rd, 2017, 11:47 PM  #11 
Senior Member Joined: Feb 2016 From: Australia Posts: 1,322 Thanks: 453 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, 01:37 AM  #12 
Senior Member Joined: Sep 2015 From: Southern California, USA Posts: 1,413 Thanks: 717  
April 24th, 2017, 06:09 AM  #13 
Math Team Joined: Oct 2011 From: Ottawa Ontario, Canada Posts: 10,485 Thanks: 693  
April 24th, 2017, 09:25 AM  #14 
Senior Member Joined: Sep 2015 From: Southern California, USA Posts: 1,413 Thanks: 717  
April 24th, 2017, 09:38 AM  #15  
Math Team Joined: Oct 2011 From: Ottawa Ontario, Canada Posts: 10,485 Thanks: 693  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, 09:51 AM  #16  
Senior Member Joined: Sep 2015 From: Southern California, USA Posts: 1,413 Thanks: 717  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 10:15 AM.  
April 24th, 2017, 10:36 AM  #17 
Math Team Joined: Oct 2011 From: Ottawa Ontario, Canada Posts: 10,485 Thanks: 693 
YUK! I'm remaining faithful to Miss UBasic...

April 24th, 2017, 11:46 AM  #18 
Math Team Joined: Oct 2011 From: Ottawa Ontario, Canada Posts: 10,485 Thanks: 693 
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, 01:26 PM  #19 
Senior Member Joined: Sep 2015 From: Southern California, USA Posts: 1,413 Thanks: 717  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 01:34 PM. 
April 24th, 2017, 05:27 PM  #20  
Math Team Joined: Oct 2011 From: Ottawa Ontario, Canada Posts: 10,485 Thanks: 693  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 04:09 PM 
Geometry or weights?  mydisguise08  Geometry  2  September 2nd, 2009 04:07 PM 
Find previous weights from current weights & percent change  billiboy  Applied Math  4  June 15th, 2009 11:26 PM 
keyword relativity datatype weights and algorithm  totus  Applied Math  4  February 28th, 2009 09:08 PM 