Skip to main content
1-Visitor
August 15, 2014
Solved

Matrices conundrum

  • August 15, 2014
  • 2 replies
  • 8552 views

Hi all,

I completed an introductory course on mathcad a few years back, but these sort of logical problems scrambles my brain, so if anyone could help me out I would be much abliged!

I have a problem whereby I have 25 different powder based flavourings of foods, each flavour is made up of a selection between 7-15 ingredients from a range of 51 different ingredients. Set flavourings are directed to three different extruders, 8 of these flavourings are directed to extruder A, 15 to extruder B, and 2 to C.

I’m looking to find the number of any combination of ingredients for any setup of all three extruders.


I have attempted it in Excel using Pivottable and select the three flavouring individually, which is fine if I need to know a specific setup, but it would take some considerable time to manually choose each combination of flavouring if I wanted to find the combination with the most ingredients.

I presume it is possible to display the results in a matrix format where the function was applied to all combinations. Also following this I will be adding data such as the combined weight of the mixes to determine maximum batch weight and selected ingredients. It would also be nice if i could display it in a 3D plot.

Regards,

James

Best answer by Werner_E

AlanStevens wrote:

Werner Exinger wrote:

Where does your 252 come from?

2*14*9=252. Thats the number of possibilities to chose three flavours - one flavour from each extruder.

Ah! I see; the extruders always use just one of the allocated flavours. Must be so obvious to James, but wasn't to me!

Neither to me. But if I am correct about that interpretation, I guess that James is looking for something like the attached.

EDIT: There was an error in the function which should count the number of differernt ingredients - corrected

2 replies

25-Diamond I
August 15, 2014

James Butler wrote:

Hi all,

I completed an introductory course on mathcad a few years back, but these sort of logical problems scrambles my brain, so if anyone could help me out I would be much abliged!

I have a problem whereby I have 25 different powder based flavourings of foods, each flavour is made up of a selection between 7-15 ingredients from a range of 51 different ingredients. Set flavourings are directed to three different extruders, 8 of these flavourings are directed to extruder A, 15 to extruder B, and 2 to C.

I’m looking to find the number of any combination of ingredients for any setup of all three extruders.


I have attempted it in Excel using Pivottable and select the three flavouring individually, which is fine if I need to know a specific setup, but it would take some considerable time to manually choose each combination of flavouring if I wanted to find the combination with the most ingredients.

I presume it is possible to display the results in a matrix format where the function was applied to all combinations. Also following this I will be adding data such as the combined weight of the mixes to determine maximum batch weight and selected ingredients. It would also be nice if i could display it in a 3D plot.

Regards,

James

I am not really sure what you are looking for.

In the first part you say that you are interested in the number of combinations, but in the second part you say you want to see a table and maybe even a 3D-plot.

For chosing 7 to 15 ingredients to make up one flavor you have about 5.2*10^12 combinations to do so.

To chose 25 flavor from these you have approx. 4.7*10^292 combinations.

You sure don't want to see all of those in a table. So I possibly miss the point as to which combinations of what you want to count and/or display.

Or do you mean that you simply want to know how to distribute given 25 flavors to the three extruders in the 15-8-2 way. Here you still have about 1.5*10^8 ways to do so.

When you write about your attempt in Excel you mention the selection of three flavors - how does this number relate to the problem you have setup above?

You are talking about a function which results you want to display in matrix format - which function? That function would have two input arguments (which ones?) and one output (which?).

Then you write that you want to add additional data like weight and do a 3D-plot. Do you really mean "add" data or do you have "replacing" data in mind? You already have a function with two inputs and one output. If you really add one data you have something which could only be displayed in 4D!

Maybe it will be a good idea to setup a worksheet with some data to play with and to demonstrate how you would like the result to look like. That way we could also see what version of Mathcad this question relates to.

1-Visitor
August 15, 2014

Yea sorry, i its quite difficult to explain my thought train, expecially when i am not familiar with these programs or how to explain in the right terminology.

I've insered images of the excel doc where I originally attempted to solve this problem (not sure if i can attach a full .xlsx doument), hopefully this gives you an indication of what i am dealing with.

Capture1.PNG

Capture3.PNGSelection of three flavours, one from each of the extruder lines so if i can somehow display the permutations/combinations* in a matracies then apply the function to this data to find the number of ingredients in each array, and then organise these to see which have the highest number of ingredients.

Capture2.PNG

25-Diamond I
August 15, 2014

James Butler wrote:

Yea sorry, i its quite difficult to explain my thought train, expecially when i am not familiar with these programs or how to explain in the right terminology.

Just try normal math terminology.

I've insered images of the excel doc where I originally attempted to solve this problem (not sure if i can attach a full .xlsx doument),

You can, but I guess it won't help as motivation to look at hidden Excel cell formulas is rather low, especially as you write that this is not the solution of your problem (we still don't know what problem) but just a partial attempt.

hopefully this gives you an indication of what i am dealing with.

Unfortunately not. You haven't answered a single of the (implicit or explicit) questions.

Selection of three flavours, one from each of the extruder lines s

What do you know about the flavors available. Is the distribution of the 25 flavours to the three extruders known? If yes, we would have just 240 possible set of three flavors. You have to clearly state the problem, the condition and assumptions first. Again setting up a worksheet with variables, vectors or matrices to give us an idea of what information can be assumed as "given" may help. Then we can look for what you are trying to find out.

so if i can somehow display the permutations/combinations* in a matracies then apply the function to this data to find the number of ingredients in each array, and then organise these to see which have the highest number of ingredients.

Again, what kind of permutations/combinations? In what way you would like the result displayed im matrices (meaning of rows, columns and elelement value)? What function?

19-Tanzanite
August 15, 2014

I'm not sure I fully understand, but, in Mathcad-speak, there are combin(25,8) = 1081575 ways of choosing 8 from 25 flavourings to send to A. For each of these there are combin(17,15) = 136 ways of choosing 15 from the remaining 17 flavourings to send to B (the remaining two go to C). In total therefore there are 1081575*136 = 147094200 combinations to be condsidered. That's a lot to tabulate!

Alan

1-Visitor
August 15, 2014

Ok, lets break this problem down, the image below shows the 25 flavourings, both beef and chicken on EXtruder 3, 14 flavours on 2 and 9 on EX 1. Am i correct at saying there are 252 combinations? If so is there a way of showing it in a 3D matrix?

Now each of these flavours comprises of a set ingredients, and I want to find a way of relating functions to the '252' combinations, so that I don't have to have to assess them individually.

Tbh if this doesn't make sense now I think I'm out of my depths and I should probably brush up on my maths before I take it any further. But thanks for your input, its been a great help in knowing my limitations

Capture5.PNG

19-Tanzanite
August 15, 2014

There are 300 combinations for EX3 alone!

There are 25 different flavours that could go in the "top slot" in Ex3, For each of these there are 24 other flavours that could go in the 2nd slot in Ex3. This would give 25*24 = 600 combinations. However, we need to divide this by 2, to get 300, as each pair of flavours would occur twice in Ex3. For example, one combination would have Chicken in the top-slot and Beef in the 2nd-slot; while another combination would have Beef in the top-slot and Chicken in the 2nd-slot.

Where does your 252 come from?

Alan