Questions tagged [binomial-coefficients]

It is the coefficient of the `x^k` term in the polynomial expansion of the binomial power `(1 + x)^n` which is `(n!)/((n-k)!*k!)`.

It is the coefficient of the x^k term in the polynomial expansion of the binomial power (1 + x)^n which is (n!)/((n-k)!*k!).

This family of numbers also arises in many areas of mathematics other than algebra, notably in combinatorics. For any set containing n elements, the number of distinct k-element subsets of it that can be formed (the k-combinations of its elements) is given by the binomial coefficient C(n, k). Therefore C(n, k) is often read as "n choose k".

213 questions
2
votes
1 answer

2 variables in an array

I am trying to create a function in MATLAB which will expand a bracket to the power of n, where n is a natural number. This is what I have so far: function expandb = expandb(x,y,n) z = my_bincoeff1(n);; syms v x y v=1:n+1 for i=1:n+1 …
2
votes
1 answer

Generalized Linear Mixed Model: Using estimable() with glmer() to generate linear combination of coefficients

I have a generalized linear mixed model with a three way interaction, a nested random variable, and a binomial response variable : modelB15=glmer(cbind(resistant, (total-resistant) )~ time*inoc_source*inoc_resistance+ …
2
votes
1 answer

Sage polynomial coefficients including zeros

If we have a multivariate polynomial in SAGE for instance f=3*x^3*y^2+x*y+3 how can i display the full list of coefficients including the zero ones from missing terms between maximum dregree term and constant. P. = PolynomialRing(ZZ,…
Jimx
  • 90
  • 1
  • 7
2
votes
0 answers

Trouble calculating with large binomial coefficients

Intro. I'm trying to plot a hypergeometric distribution with IPython. The probability function of the distribution contains three binomial coefficients. Since the values I will be putting in the coefficients are very large eg. 1e28, I've decided to…
m009
  • 21
  • 1
2
votes
1 answer

Indexing Permutations Having Duplicates

Given an array of length n, I need to print out the array's lexicographic index (indexed from zero). The lexicographic index is essentially the location that the given array would have if placed in a super-array containing all possible permutations…
2
votes
1 answer

Binomial Theorem - algorithm in C

I'm trying to find a solution(fix errors) in my programme which must count the binomial theorem from definition. Firstly I created the definition of "factorial" - "silnia". 1) The algorithm determines the value of SN1 (n,k) of the definition.…
2
votes
3 answers

LISP binomial coefficient, factorial

i´m a newbie in lisp , i try to programm a programm in lisp, that calculate binomial coefficient iterative (factorial) but NOT recursive. i´ve try everthing, global function, local function (factorial)), but my programm doesn´t work, for example…
milk05
  • 21
  • 2
1
vote
1 answer

Java Recursive Binomial Coeffecients using Linked Lists

There is a challenge problem in my compsci UIL class to use tail recursion to get a list of binomial coefficients for a given number . I think I am pretty close but I am having a hard time with base cases. Following is my Code : public static Cons…
1
vote
1 answer

Binomial coefficient for real values

I'm looking for an efficient Java implementation of Binomial coefficients ( choose(n,k) ) defined for all real numbers n and integers k, ie defined as:
fbielejec
  • 3,492
  • 4
  • 27
  • 35
1
vote
2 answers

How do you find the answers of a choose function without using factorials?

I am sorry if this is a duplicate question but I couldn't find any answers. I am currently taking Discrete Math and one of our assignments involves evaluating a choose function. The problem is that the numbers provided exceed the overflow limit for…
1
vote
1 answer

How to perform binomial-coefficient and factorial calculation with more precision?

I was comparing the result of my following python calculation with Mathematica: https://www.wolframalpha.com/input?i=sum+%28500+choose+r+%29%28-1%29%5Er+%2F%28r%21%29+%2C+r%3D0+to+500 import numpy as np from decimal import * import…
1
vote
2 answers

C program to calculate Binomial Coefficient with factorial method

I'm pretty sure it's only a small mistake but I don't know why it is not working..? I would really appreciate if you could help me out! #include int fak(int n) { int fak_n; if (n <= 1) { fak_n = 1; } for (int i =…
1
vote
0 answers

Binomial coefficients modulo square of a prime

Calculate the binomial coefficient: \binom{852 467 439}{426} (nCk) modulo 289 I has used this document: https://web.archive.org/web/20170202003812/http://www.dms.umontreal.ca/~andrew/PDF/BinCoeff.pdf int VpnCk(int n, int k, int p){ int res = 0,…
Minh Hien
  • 263
  • 1
  • 7
1
vote
1 answer

Generating predictions from an aggregated binomial regression

Assessing model accuracy is reasonably easy with Bernoulli outcomes, but I am unsure how to generate meaningful predictions from an aggregated binomial regression. Take this example. We want to model the number of drug counselling sessions (variable…
llewmills
  • 2,959
  • 3
  • 31
  • 58
1
vote
1 answer

double sum in Matlab

I would like to write a Matlab code to calculate the following: \sum_{k=0}^{N-1} \frac{1}{k!} \sum_{i=0}^{k} {k \choose i}(a-1)^{k-i} a^k and my code is: N = 3; a = [3 4]; for k = 0:N-1 f = 0; for i = 0:k f = f + nchoosek(k,i).*…
Mina Kay
  • 13
  • 4