# Name for multiset with fractional amounts?

What do you call a set which accepts multiples of the same element, even in fractional amount? Is there even an established for this?

Example from a video game about production chains:

For a carpenter to run at full capacity, you need: 1 carpenter 1 sawyer 0.5 woodcutter 0.25 forestry

And knowing the fractional amount is important to know for example that you can build only 1 forestry to feed 4 carpenters.

There is the "multiset", but definitions I've read all say elements must have an integer count. I've search for keywords like "multiset fractional amounts", "multiset fractional multiplicity", but didn't find anything 😕.

There is the "knapsack" that turned out on occasion, but the problem's definitions also say the elements must have an integer count?

Am I just approaching this the wrong way??

(I'm a 1st year undergrad student in a computer science/programming degree)

• I'm not sure where you read that a multiset must have integer elements. A multiset can have any type of element, and the element is allowed to be repeated in the multiset. – ryan Apr 16 '19 at 0:16

I don't know a standard name for this, but what you've described is representable as a function into $$\mathbb{R}$$.
For your example, if $$X$$ is the set of your things then you can represent your 'fractional multiset' as a a function $$f : X \to \mathbb{R}$$ such that
$$f(x) = \begin{cases} 1 & x = \text{carpenter}, \text{sawyer} \\ 0.5 & x = \text{woodcutter} \\ 0.25 & x = \text{forester} \\ 0 & \text{otherwise} \end{cases}.$$
If you're looking for a way to implement this in a programming language, if you need to store only finitely many things then you could use a map/dictionary data structure. For example in java you could use some implementation of Map<X, Float>