
MICHAEL K. answered 09/13/21
30 Year Finance professional, former floor trader
This is NOT a plain vanilla combinations problem - https://www.mathcelebrity.com/permutation.php?num=16&den=6&pl=Combinations
The prices and budget constraint demand one form or another of brute force to solve. You cannot directly calculate your answer. There exist 8,008 combinations of 6 from 16, but not all of them conform with being < $50,000. Which 6s work is dependent on the 16 specific values.
STEP 1 - identify the 8,008 sets of 6
This process can probably get your answer in a spreadsheet - https://exceloffthegrid.com/list-of-all-possible-combinations-using-power-query/
Here is how to get the list with Python - https://docs.python.org/3/library/itertools.html#itertools.combinations
STEP 2 - Calculate each set's value
Once you have the list, you can calculate the value of each combination and count how many are < $50,000. If you got the list, identifying the value of each item will be a breeze.