Implement more compact syntax for permutations and combinations, or possibly a facility to suggest "proper" function symbols for ones users might try #3045
Replies: 6 comments
-
Can i able to solve this Issue? |
Beta Was this translation helpful? Give feedback.
-
Yeah, so you would like to introduce two new operators to enter permutations/combinations in a more compact way. That would be nice indeed I'm not sure this is a broad enough use case to introduce two new operators though, but we can think this through at least. What operator names would you suggest for both functions? It should be really clear from the names whether this is about permutations or combinations. |
Beta Was this translation helpful? Give feedback.
-
On calculators, combination and permutation numbers are typically written as math.nCr(5,3) // 10
math.nPr(4,2) // 12
math.evaluate(`nCr(5, 3)`) // 10 |
Beta Was this translation helpful? Give feedback.
-
Yes that is right indeed, Maybe we could introduce a solution that gives you an error message with a hint when you enter "nCr": "You used 'nCr' you mean 'combinations'?", having defined a list with aliases and maybe also common typos in function names. Or maybe it's just ok like it is now and we should not over-engineer this 😁 . |
Beta Was this translation helpful? Give feedback.
-
Since this seems to be an open-ended idea (possibly add a facility for "function suggestions"), re-titling and moving to Discussions. |
Beta Was this translation helpful? Give feedback.
-
See also #1764, where essentially the same idea of a "hinting system" came up. |
Beta Was this translation helpful? Give feedback.
-
Just a small feature request: Is it possible to have permutations/combinations in the evaluate() function? Something like
5 choose 3
or5C3
would be nice. Thanks!Beta Was this translation helpful? Give feedback.
All reactions