Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for Permutations and Combinations calculation #52

Closed
hanani8 opened this issue Jun 17, 2021 · 3 comments
Closed

Support for Permutations and Combinations calculation #52

hanani8 opened this issue Jun 17, 2021 · 3 comments

Comments

@hanani8
Copy link

hanani8 commented Jun 17, 2021

Forgive me if I am missing it, but it seems like we do not have support permutations and combinations calculation, correct?
Can someone confirm this?

I realized this as I was using kalker in my school test. :)

@PaddiM8
Copy link
Owner

PaddiM8 commented Jun 18, 2021

That's correct, but that's something that should probably be supported! Hm, how would you expect this to work with something like kalker? Simple function? Special syntax? Both? I don't have much experience with these.

I realized this as I was using kalker in my school test.

Wow haha, nice!

@hanani8
Copy link
Author

hanani8 commented Jun 24, 2021

I think a simple function is a way to go...
Ex: perm(n, r) equivalent to nPr
comb(n, r) equivalent to nCr

@csicar
Copy link

csicar commented Sep 21, 2021

Simple implementation:

nCr(n, k) = n! / (k! * (n-k)!)
nPr(n, k) = n! / (n - k)!

binompdf(k, n, p) = nCr(n, k) * p^k * (1-p)^(n-k)
binomcdf(k, N, p) = sum(0, k, binompdf(n, N, p))

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants