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
0
votes
1 answer

Binomial coefficients using dynamic programming and one dimensional array

Most implementations of binomial coefficient computation using dynamic programming makes use of 2-dimensional arrays, as in these…
0
votes
0 answers

Calculate a term in Pascal's triangle iteratively

I have the following method that needs to be implemented iteratively: public int binom(int n, int k) { if (k < 0 || k > n) { return 0; } if (k == 0 || k == n) { return 1; } return…
Detonator
  • 21
  • 4
0
votes
2 answers

Why is the following code wrong? binomial coefficient

I am doing project euler and i am at problem 15 now, here is a link: https://projecteuler.net/problem=15 . I am trying to solve this with binomial coefficient. Here is a site that explains it: http://www.mathblog.dk/project-euler-15/ . You can find…
Mathijs
  • 177
  • 3
  • 18
0
votes
4 answers

Binomial Coefficients rounding error

I have to calculate in c binomial coefficients of the expression (x+y)**n, with n very large (order of 500-1000). The first algo to calculate binomial coefficients that came to my mind was multiplicative formula. So I coded it into my program…
0
votes
3 answers

How to prove binomial coefficient is asymptotic big theta of two to the power n?

I am stuck at this problem. I think it is equivalent to show 2m choose m is big theta of 4 to the power n, but still find difficult to prove it. Thanks of @LutzL's suggestion. I thought of stirling's approximation before.
xxx_yyyy
  • 63
  • 1
  • 5
0
votes
1 answer

Parse Coefficients of Binomials c++

I am attempting to read in a list of binomials, separated by line in a file given as a command line argument. The file looks like this... numbers.txt 2.1x+1 3x-5.3 -24.1x+24.7 0x-15.5 -12.3x+0 Expected output: input: 2.1x+1 real: 2.1 imag:…
Zach
  • 119
  • 3
  • 17
0
votes
0 answers

Threads Recursion Binominal

I want to calculate N over K (binominal coefficient) in a thread, which opens then another thread and calculates 1 line of the N over K calculation. So each thread opens another thread until the N over K is completely done. Tried now multiple times…
0
votes
7 answers

Double-checked locking for growable array of binomial coefficients

I'm trying to use double-checked locking to maintain an array of binomial coefficients, but I read recently that double-checked locking doesn't work. Efficiency is extremely important so using volatile isn't an option unless it's only inside the…
0
votes
2 answers

point biserial and p-value

I am trying to get a point biserial correlation between a continuous vocabulary score and syntactic productivity (dichotomous: productive vs not_productive). I tried both the ltm packages > biserial.cor (lol$voc1_tvl, lol$synt, use =…
Pietre
  • 21
  • 1
  • 1
  • 6
0
votes
0 answers

Sequence of n numbers - compute all possible k-subsequence of "lucky" numbers

I have a problem with one task, so if you could help me a little bit. Numbers are "lucky" or "unlucky". Number is "lucky" just if every digit 7 or every digit is 4. So "lucky" numbers are for example 4, 44, 7, 77. "Unlucky" are…
Jozef Bugoš
  • 137
  • 1
  • 2
  • 8
0
votes
2 answers

All combination of exclusive connections of nodes

I have a set of 30 nodes, each node can connect to one and only one at a time. Moreover, one node cannot connect to another specific one (say, the one with and id= id+15, e.g. 1-16, 2-17... the rule is not relevant, I can change the association…
RockeJoe
  • 1
  • 1
0
votes
0 answers

How to change the parameters of the binomial distribution used in a binomial glmer?

I wish to assess how being part of a majority helps in emerging as a leader of an animal group. Say I have 10 cases in which I assessed whether the leader came from the majority or the minority. Leader <-…
0
votes
0 answers

Range out of value in gamma fn, how to calculate factorial >200

I am attempting to create a function to calculate the binomial formula, but I keep getting the error "Range out of value in gamma fn" mything <- function(x, n, p) { a = choose(n, x) b = p^x c = (1 - p)^(n - x) d = a * b * c …
Dave
  • 17
  • 3
0
votes
0 answers

How to recognize binomial coefficients(n choose r) in a given input

I'm trying to do a reverse binomial coefficient calculation in which I get a set of random combinations of (n,r), then I must be able to determine any n-Choose-r(n,r) in the set or subsets. For e.g. if user inputs following set: {(1,2,3) (1,2,4)…
mr-ma
  • 199
  • 13
0
votes
1 answer

Generative Function that produces integers sorted by bits set, then value

What is the generative function f_k(n) that produces all integers smaller than 2^k, that are sorted by number of bits set, then by value? Expected output for k = 4: f_4( 0) = b0000 = 0 -------------------- f_4( 1) = b0001 = 1 f_4( 2) = b0010 = …