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

Calculate probabilities for set binomial outcomes provided with probabilities for each event in set? Excel

The problem is as follows: Let's say there will be "X" independent events in my binomial tree, and I know the probability of all "X" events being a "1" or a "0" outcome. How can I use excel to calculate the probability of every possible sum total?…
0
votes
7 answers

How to Extract Positive and Negative Integers from a String

I need to extract both positive and negative integers from a binomial expression in String form. Then those numbers will be assigned to an array. This string: "(-22x+43)^2" would become this array: [-22, 43, 2] Or, This string: "(x-22)^-2" would…
Slot Machine
  • 71
  • 1
  • 9
0
votes
2 answers

Multinomial sets

I'm having a problem figuring out this problem, it is similar to combining sets of non-unique letters, but is slightly different. Let k, m, and n be positive integers. We have nm balls, m colors, n balls, and k uniquely labeled bins. How many…
COner
  • 77
  • 1
  • 7
0
votes
0 answers

Add coefficient constraint such as upper limit to probit/logit/glm for a binomial model in R

I want to fit a binomial model using glm package in R however I'm looking for negative values for some of the coefficients. I also have categorical independent variables which are converted to factors. I was wondering if there is any way to add that…
Frank
  • 41
  • 2
0
votes
2 answers

Binomial coefficient recursive function in C - brings wrong result, why?

beginner here trying to understand the source of the bug. I have written this recursive function for finding the binomial coefficient between two numbers which is apparently correct in concept. However, for these two numbers, n =4 and k=2, I should…
franx
  • 57
  • 6
0
votes
0 answers

Solve the MLE for Binomial Distribution

This problem is about how to write a log likelihood function that computes the MLE for binomial distribution. The exact log likelihood function is as following: Find the MLE estimate by writing a function that calculates the negative…
R Newbie
  • 57
  • 6
0
votes
3 answers

how to calculate binomial coefficents with non-integer numbers

I know how to calculate binomial coefficients for choose(5,2), but now I want to know if there is a function that I can calculate choose(5,2.1) in python or R programming language?
Yaphet
  • 21
  • 1
0
votes
2 answers

Using glmnet on binomial data error

I imported some data as follows surv <- read.table("http://www.stat.ufl.edu/~aa/glm/data/Student_survey.dat",header = T) x <- as.matrix(select(surv,-ab)) y <- as.matrix(select(surv,ab)) glmnet::cv.glmnet(x,y,alpha=1,,family="binomial",type.measure =…
Alex
  • 2,603
  • 4
  • 40
  • 73
0
votes
0 answers

Most efficient way of computing double sum of function nchoosek in Matlab

I want to implement the following function in Matlab, Pnk: Following, I want to implement a different function, which uses a double sum over different values of n and k inputted in the Pnk function and another function In: I am having trouble…
Peter Lawrence
  • 719
  • 2
  • 10
  • 20
0
votes
1 answer

Time limit exceeding in calculating binomial coefficients (Pascal's Triangle)

The question was to calculate the number of binomial coefficients not divisible by a given prime number. For example: For num = 5 and prime = 5, the output should be: countingBinomialCoefficient(num, prime) = 17 N = 0: [1] N = 1: [1, 1] N = 2: [1,…
FlarrowVerse
  • 197
  • 2
  • 13
0
votes
1 answer

Binomial coefficients - Division by zero error

The "main" code works to calculate every single binomial coefficient, unless (n = k + 1). It is mind boggling - it says there is a division by zero error but I cannot see why. the error occurs in the main function ( d = n2 / c ). Any idea why? def…
K-I
  • 3
  • 2
0
votes
0 answers

How to calculate with greater precision in R for binomial distribution

I am trying to calculate the probability of guessing 70 or more correct answers on a 100 question test with 4 answer choices (so 25% chance of guessing correctly on each answer) to illustrate that even a "C" student actually does quite well compared…
0
votes
1 answer

Binomial coefficient recursive solution in C

Why is my solution to binomial coefficient crashing? I've really tried to learn recursion, but I still think I am not clear about about it. I wonder if anyone can help me learn about recursion, and how to think recursively? Even when I write a good…
Mobassir Hossen
  • 247
  • 4
  • 16
0
votes
1 answer

Plotting binomial glm with interactions in numeric variables

I want to know if is possible to plotting binomial glm with interactions in numeric variables. In my case: ##Data set artificial set.seed(20) d <- data.frame( mating=sample(0:1, 200, replace=T), behv = scale(rpois(200,10)), condition =…
Leprechault
  • 1,531
  • 12
  • 28
0
votes
2 answers

Binomial coefficient

I've been looking around trying to find a simple binomial coefficient algorithm, to no avail. The problem is the language I'm using for class is a bit... odd. A lot of it is using Yacc and Lex. Anyways we did an example in class: n=12; p=1;…
user475353