The Stack Overflow podcast is back! Listen to an interview with our new CEO.

Questions tagged [combinatorics]

Counting or enumerating elements in a set or other finite discrete structure.

345 questions
Filter by
Sorted by
Tagged with
27 views

How can I generate a completely balanced combination

Attaching a code that generates unique combinations of 8 letters but, it still lacks a condition wherein all letters should have equal counts per column. For my code, basically, letter a to h should ...
10 views

How to create matrix of all 2^n binary sequences of length n using recursion in R? [migrated]

I know I can use expand.grid for this, but I am trying to learn actual programming. My goal is to take what I have below and use a recursion to get all 2^n binary sequences of length n. I can do this ...
428 views

Why does the likelihood function of a binomial distribution not include the combinatorics term? [duplicate]

So the likelihood function for a binomial distribution is: Why is the likelihood function above not multiplied by a combinatorics term: n! / (x! * (n - x)!) If the likelihood function is ...
16 views

How many different looking selections can be made?

Problem: Consider 12 balls (3 orange, 3 green, 3 blue, 3 red). We randomly choose 9 balls from the 12. How many different looking selections can be made? I only know that ${12 \choose {3,3,3,3} }$ is ...
24 views

What's the probability that a license plate contains one A and one 7? [closed]

A license plate is composed of 4 letters and 3 digits. Whats the probability that a license plate contains at least one A and one 7?
37 views

Why are probability problems involving combinations often solved indirectly?

Let's say you have a box with 25 cell phones in it, of which 2 are defective. If a person selects 10 cell phones at random, without replacement, what is the probability that both defective cell phones ...
23 views

How to calculate the number of combinations that will add to a specific total

If I have for example 3 variables, and I need them to add to specific total, say 6, how do I calculate the number of combinations that will add to 6. Like 1+1+4=6 and 1+4+1=6 and 2+2+2=6 and 1+2+3=6 ...
43 views

How many times I need to draw k items from a list of n items to get a probability P that each item is selected at least once? [duplicate]

I have seen a few related questions but not exactly what I am looking for (in particular this and this) I think. I may be missing something since I am only a beginner at these counting problems. I am ...
127 views

M buckets out of N have at least one ball

We have N buckets and we start filling them randomly with balls. At the end we know that we have exactly M buckets that have at least one ball in them. Both N and M are given and M < N. What is ...
39 views

Probability 4 places each get an ace when dealt a deck of cards - union approach

Problem: A deck of 52 cards is dealt to 4 players, each receiving 13 cards. What is the probability each player gets an ace. I understand the combinatoric approach, but am unsure why the following ...
70 views

When rolling a die $N$ times, what is the probability of an $X$ appearing before the last $Y$?

So a valid state is when there are both $X$ and $Y$ in the roll sequence, and the lowest index of an $X$ is smaller than the biggest index of a $Y$. In particular, if after $N$ rolls, there is no $X$ ...
20 views

Expected frequency of three-way combination given all two-way combination frequencies

Given an alphabet {A, B, C}, and observed frequencies of each element, a, b, and c respectively; I can calculate the expected frequency of the combination AB as a*b. I want to know how to do the same ...
34 views

Sampling inclusion probability for multiple items

Suppose we sample (uniformly, with replacement) $t$ times a set of $N$ items. What is the probability $x$ that the sample contains $y$ different items? This is representative of a real-life scenario ...
21 views

Mixed order and unordered counting

If you care about ordered or unordered counts you can use nCr or nPr. But If you want a few in a certain order and a few unordered is there a general approach? For example imagine you have 6 red ...
12 views

Markov Chain Monte Carlo for Decryption Purposes

I've been reading the "Markov Chain Monte Carlov Revolution" paper by Diaconis and was intrigued by his application to decryption. I've done some further reading and am now trying to work through ...
25 views

Number of Model Combinations

I have a model selection combinatorics problem. My covariate pool consists of six covariates: A1, A2, A3, B, C and D. However, covariates A2 and/or A3 can only be included if A1 is also included. ...
37 views

probability/counting problem

This is an even question from the textbook so unfortunately there's no solution. Suppose $\DeclareMathOperator{\P}{\mathbb{P}} S = \{1,2,3,4,5,6,7,8\}$ with $\P({s}) = 1/8$. Part C) asks How many ...
38 views

Formulating a mixed integer programming problem with a binary maximization term

Real-world description of the problem: In the US, funding for school lunch programs is given to local school districts by the Federal government. If >=40% of students in a school or group of schools ...
22 views

Probability of group wins in a lottery: Same versus different first digit in a lottery number drawn digit by digit

I want to calculate the probability to win in a certain lottery. These are the rules: In the lottery, participants can participate individually or as a group. Groups can have up to 200 members. Each ...
38 views

Finding the expectation: Draws to get 2 gold coins

Omar has saved 11 precious coins, 7 of which made of gold, in a jar. He draws the coins one by one from the jar, to find the gold coins. If $X$ is the number of coins drawn until he has found the ...
30 views

Drawing six cards from a deck of cards

Six cards are drawn from a well-shuffled deck. You are told that at least an ace (A) is among the cards. What is the probability that there is at least a king (K) or at least a queen (Q)? (A deck ...
50 views

How to solve this combinatorial problem about selecting letters from different groups?

The English alphabet consists of 26 letters, 6 of which (A, E, I, O, U, Y) are vowels and the remaining 20 are consonants. If each letter has the same probability of being chosen, what is the ...
140 views

Probability and Counting

Suppose You are ordering two pizzas.A pizza can be small,medium,large or extra large,with any combination of 8 possible toppings( getting no toppings is allowed, as is getting all 8) How many ...
124 views

How to choose the best combination of covariates in Cox multiple regression?

I am performing a multivariate Cox regression analysis, and would like to find what combination of those covariates best predict my outcome. Say I have a list of candidate genes whose expressions ...
35 views

Item sampling techniques to reduce processing time for questionnaire

I have a well-crafted draft of a questionnaire, containing 240 items. The average processing time is 20 secs per item, so the entire questionnaire would take around 1 hour 20 min to complete. I want ...
20 views

All different size groups to create m groups from n samples

Suppose we have $n$ samples that we want to divide in $m$ groups. How can we get the total number of groups and their sizes (if possible)? Examples: For $n = 6$ and $m = 3$ we would have $3$ groups as ...
19 views

Counting the number of tuples $(i,i',k,k')$ satisfying some conditions

I'm struggling to find the cardinality of a set that will be presented below, as well as an upper bound for it. It is an engaging problem and perhaps not trivial. I will give now the baseline of the ...
122 views

What is the probability of having a pair of doubles when throwing dice?

What is the probability of having a double (two dice will show the same number) when we throw 5 dice (all dice have 6 sides)? My calculations are: ...
9 views

Combinatorics of distinquishable sequences of events

I have found a problem that I can only solve by guessing, but without any systematic solution: 3 distinguishable balls (red, blue, green) 5 distinguishable sites (A, B, C & X, Y) X, Y can ...
14 views

Estimating weights in the assignment problem

How would you learn a function with the emphasis on feature interactions? I have the standard assignment problem: $$\max_{x_{ij}} \sum_{(i, j)} w_{ij} x_{ij},$$ where $w_{ij}$ is the weight of ...
20 views

Find the probability that two samples of F unique items taken from a population of N unique items has at least one common item

What is the probability that two samples of F unique items taken from a population of N unique items has at least one common item?
3 views

Calculating # of possible binary strings given constraint

Consider a random binary string where each bit can be set to 1 with probability $p$. Let $Z[x,y]$ denote the number of arrangements of a binary string of length $x$ and the $x$-th bit is set to 1. ...
21 views

Creating mean variables using all possible combinations of the original variables in r [closed]

I need to create a function that calculate the mean of all possible combinations of a given number of variables, and store the means values as separate variable and the number of variables whose means ...
100 views

sample all pairs without repeats

Assuming I have a very large number of $K$ colored balls and we know the fraction of each color. If we randomly sample all pairs so that all pairs have two balls of different colors then what is the ...
22 views

All combinations choosing 3 items each from 4 unique bags

Trying to do something like expand.grid in R, but as if expand.grid created all combinations of sets of 3 from each factor/group. (E.G.)... ...
139 views

How to set up an event with probability of one seventh from coin tossing?

I have been recently asked in an interview a question that: How to set up an event with probability of one seventh from coin tossing? I couldn't find the correct answer and still don't know the ...
51 views

combinatorics problem: two ways to solve same problem?

Currently i'm struggling alot with combinatorics. The problem: There are four siblings. What is the probability that at least two of them are born in the same month? This question asks to get two ...
23 views

Probability of combination of letters appearing on multiple custom dice

Question: Say I have a set of 24 dice that have different letters on them, what is the chance that in any roll a certain combination of letters appears at least once? Combination I want: {a, a, b, c, ...
39 views

Modified coupon collector: killing traitors problem

You have $n$ people, $m$ of whom are traitors. You keep killing them randomly until all the traitors are gone (which you presumably have some way to verify). On average, how many people $X$ will you ...
16 views

Why is the formula for permutations of size one n!

I am looking at this formula I want to first make sure that I understand the principle. This is saying that, if I wanted to find out all the ways I could order the letter of the alphabet into a 26-...
22 views

Does the multinomial coefficient create combinations or permutations?

I am looking at this formula I just want to make sure I get it. For example, if I want to split a fifty-two card deck into all the possible combinations of four, thirteen card hands, then I get: 52!...
705 views

Probability of normal random variable yielding highest value among other normal variables

Let's say I have a competition with $N$ participants. Each participant yields a score that is normality distributed with unique means and unique variations. Each participant gets to post one score (we ...
31 views

Probability of having a match in an existing database [closed]

Imagine you are an airport authority in CountryLand and you have two passenger types: human passengers and animals. There is no way for you to distinguish between human passengers and animals except ...
58 views

Probability to be present in every subgroup

Assuming you randomly split a set of n elements in $y$ equally sized parts(each has $x$ elements). Now you have a subset of m elements in the set of n elements ($m> (y/2)$). What is the probability ...
31 views

What is the probability that two samples from a source have no overlap?

I picked 29 results from a list of 429 results. I then picked a second group of 27 (with replacement) results from the same list of 429. There was no overlap between the two samples. What is the ...
57 views

How to calculate number of solid color images on the screen of random pixel generator?

Is there a statistical formula/function to calculate number of basic geometric shapes on the displays of random pixel generator? Let's say we have a basic random pixel generator which has 10*10 ...
29 views

Birthday problem extension to unequal probabilities and multiple collisions

Let $p_1, ... ,p_k$ denote the probabilities of drawing bin $1, .. ,k$, where $\sum_{i = 1}^{k} p_i= 1$. My question is if we draw $n$ times, how can I show that the probability of no bin being drawn \$...
48 views

How many pairwise combinations is possible?

I have a dataset regarding a natural language problem that am tackling with machine learning. My goal here is the generate training samples for one of the classes. I do this by doing pairwise ...