# Questions tagged [probability-theory]

Challenges which involve computing probabilities for random variables and stochastic processes.

63 questions
Filter by
Sorted by
Tagged with
167 views

### Calculate the probability of getting this hand in n tries [closed]

Imagine there is a card game where the primary objective of the game is to get 4 of one card in your hand. Game mechanics Each player starts of with 10 cards in their hand. The remaining 32 cards (...
724 views

### Yet another coin flipping problem

Problem Starting with a set of 10 coins at the start where all coins are tails up, and given n number of integers $x_1, x_2, x_3... x_n$ representing n rounds of coin flipping. At each round, we ...
195 views

### A Suitable Mission — The Professor's Revenge

Summer Klerance turned in her term assignment for this challenge. Her professor was miffed (but also amused) when he overheard a disgruntled classmate of Summer's saying she got her answers by ...
451 views

### A Suitable Mission

Summer Klerance, a senior in college, is what her teachers refer to as GBL*. Students in her probability class have been assigned individual problems to work on and turn in as part of their final ...
1k views

### Odds that a string of N digits contains two or more of the same

I have to fill in 2fa codes all day. They're 6-digit strings. One day I noticed that not once did any of these codes contain 6 unique digits, like 198532 There was always at least one double, like ...
2k views

### Calculate the probability of getting to the target first (exactly)

Consider the following probability puzzle. We start with a string of bits all set to 0. At each step we choose a bit uniformly and independently at random and flip it. The value your code has to ... 2k views

### Lucky dice rolls

Lucky dice rolls In pen and paper roleplaying games dice are used for various chance calculations. The usual way to describe a roll is $n\textbf{d}k$ where $n$ is the number of dice and $k$ is ...
1k views

### Penney-Conway odds

Background Penney's game is a two-player game about coin tossing. Player A announces a sequence of heads and tails of length $n$, then player B selects a different sequence of same length. The ...
256 views

### Estimate the mean minimum Hamming distance

Task Inputs $b \leq 100$ and $n \geq 2$. Consider $n$ binary strings, each of length $b$ sampled uniformly and independently. We would like to compute the expected minimum Hamming distance ... 2k views

194 views

### Talent rolls in DSA

Some friends and I have played some DSA (a mainly german tabletop RPG much like D&D). I was wondering what the chance on passing rolls are, so you will have to write some code to calculate it. ...
291 views

### Card pair probability

Given a deck consisting of N copies of cards with integer values [1,M] for a total of N*M cards, compute the probability that a card with the value of 1 is adjacent to a card with the value of 2. ...
3k views

### 1/N probability

Because there are not enough simple code-golf challenges: Create an optionally unnamed program or function that, given (by any means) an integer 1 ≤ N ≤ 10000, outputs your language's True value with ...
337 views

### Guess the hidden communities

Background This challenge is about the stochastic block model. Basically, you are given an undirected graph, where the nodes represent people, and the edges represent social connections between them. ...
569 views

### Who's that probability distribution?

Introduction In this challenge, you are given a list of nonnegative floating point numbers drawn independently from some probability distribution. Your task is to infer that distribution from the ...
2k views

### "i" have "i" chance of occuring

Design a random number generator where the i th number has i% chance of occurring for all 0 < i < 14. 0 should have exactly 9% chance of occurring. The seed for the generator should be the ...
334 views

### Implement an API for probability distributions

Introduction In this challenge, your task is to implement a collection of simple functions that together form a usable mini-library for simple probability distributions. To accommodate some of the ...
283 views

### Probability to clear the board or win

In the game Hearthstone there is a playing board containing friendly and enemy minions, and two heroes - yours and the enemy's. To generalize and simplify, we will assume it's your turn, the opponent ...
314 views

### Simple single-player board game, expected score distribution

This is the first problem I've posted here; please post criticisms in comments. Summary A game board consists of a starting space, an ending space, and between them are ...
340 views

### Knockout probabilities

Knockout is a basketball game where players take turns shooting. It is played as a sequence of two-player contests, each of which has the possibility of "knocking out" one of those players. Suppose ...
894 views

### Probabilities - how high can you go?

I previously asked a question for how to compute a probability quickly and accurately. However, evidently it was too easy as a closed form solution was given! Here is a more difficult version. This ... 1k views

### Calculate a probability exactly and quickly

[This is a partner question to Calculate a probability exactly ] This task is about writing code to compute a probability exactly and quickly. The output should be a precise probability written as a ...  