4 ms·
How are they used and how should they be used?
by patrec 3y ago
How are they used and how should they be used?
- fartsucker69 3y agoin permutations the ordering of the individual elements is important (a different order of exactly the same elements is a different permutation), but it's irrelevant in uber shaders. they should just say combinations (different elements are toggled on and off).
- Filligree 3y agoYes. With combinations, you get a combinatorial explosion. With permutations, you get—IIRC, the factorial?—which is much, much worse. Mistaking permutations for combinations isn’t a small error.
- hashhar 3y agoIIRC with combinations you get factorials (n!) while with permutations you get n^n.
- Sharlin 3y agoNope. Combinations are subsets: you either include or exclude each element. So 2^n. With permutations, you have n options for the first element, (n-1) options for the second, and so on. Thus n! possibilities total.
- adrian_b 3y agoWith permutations without repetitions you get factorials (n!) while with permutations with repetitions you get n^n. More precisely, when taking N objects out of M, the number of permutations is always computed by multiplying N factors, which are either all equal to M when repetitions are allowed (i.e. the power M^N) or they are decreasing by one at each factor when the extracted objects must be unique (i.e. M*(M-1)*(M-2) ...), which gives the factorial in the case of N taken out of N. With combinations either with or without repetitions you also get a product of N factors, but each factor is much smaller, being a ratio of two integers, instead of the integer that is the numerator. This is usually written in a form that is useless for actual computation, as the ratio between a factorial and the product of other two factorials (which differ between the two kinds of combinations). The sum of all combinations without repetitions is 2^N (when repetitions are allowed, the sum is infinite).
- hashhar 3y agoWelp, no wonder I had to redo my engineering mathematics course. Thanks for the correction.
- deleted 3y ago[deleted]
- Sharlin 3y agoA permutation is any of the possible ways to turn a set into an ordered list. For example, the set {1,2,3} has the following permutations: [1,2,3], [1,3,2], [2,1,3], [2,3,1], [3,1,2], [3,2,1]. A set of n elements has n! (n factorial) permutations: you have n options to pick the first element, n-1 to pick the second element, and so on. A combination of a set is one of its subsets, including the set itself and the empty set. The set {1,2,3} has the following subsets: {}, {1}, {2}, {3}, {1,2}, {1,3}, {2,3}, {1,2,3}. A set of n elements has exactly 2^n combinations; for each element you either include or exclude it.
- patrec 3y agoAh, sorry, I meant the correct an incorrect usages for "occlude" and "albedo".