I would like to know the probability of each number coming out in a raffle in which we have from 1 to 25 and are drawn 15 numbers.
would be 1/15 or 1/25, or another percentage?
Similar problem:
What is the probability of getting two five consecutive with a six-sided die? The probability of each independent event is equal to 1/6. This gives us 1/6 × 1/6 = 1/36, 0.027 or 2.7%.
Probability of each number coming out in a raffle is 1/25.
It is similar to the example you mentioned. Probability of getting a number from rolling dice is 1/6 whether you roll the dice once or multiple times.
Related
A random generator produces values from the list: 0, 1, 2 (with equal probabilty for all three values).
How to get a random number, 0 or 1, with equal probability, from no more than ten uses of the generator.
Your goal is ultimately to roll a 2-sided die given only a 3-sided die, using a fixed number of rolls of the 3-sided die.
However, this is impossible no matter how many rolls you do, since 2 does not divide 3 (and both are prime numbers). The best you can do here is keep rejecting 2's (and the probability of getting n 2's in a row is 1/3^n, a probability that shrinks rapidly with increasing n).
More generally, it's impossible to roll a k-sided die using a p-sided die using a fixed number of rolls of the p-sided die unless "every prime number dividing k also divides p" (see Lemma 3 in "Simulating a dice with a dice" by B. Kloeckner.
See also the following questions:
Expand a random range from 1–5 to 1–7
Frugal conversion of uniformly distributed random numbers from one range to another
Best way to generate U(1,5) from U(1,3)?
With the edit, in order to shrink the range, you can do a few things
discard rolls of 2
if you are certain to roll an even number of times, choose 2 to be 0 or 1 before every other roll
(1/3) * .5 + (2/3) * .5
I have been working on the algorithm for this problem, but can't figure it out. The problem is below:
In a tournament with X player, each player is betting on the outcomes of basketball matches in the NBA.
Guessing the correct match outcome earns a player 3 points, guessing the MVP of the match earns 1 point and guessing both wrong - 0 points.
The algorithm needs to be able to determine if a certain player can't reach the number 1 spot in this betting game.
For example, let's say there are a total of 30 games in the league, so the max points a player can get for guessing right is (3+1)*30=120.
In the table below you can see players X,Y and Z.
Player X guessed correctly so far 20 matches so he have 80 points.
Players Y and Z have 26 and 15 points, and since there are only 10 matches left, even if they guess correctly all the remaining 10 it would not be enough to reach the number 1 spot.
Therefore, the algorithm determined that they are eliminated from the game.
Team
Points
Points per match
Total Games
Max Points possible
Games left
Points Available
Eliminated?
X
80
0-L 1-MVP 3-W
30
120
10
0-40
N
Y
26
0-L 1-MVP 3-W
30
120
10
0-40
Y
Z
15
0-L 1-MVP 3-W
30
120
10
0-40
Y
The baseball elimination problem seems to be the most similar to this problem, but it's not exactly it.
How should I build the reduction of the maximum-flow problem to suit this problem?
Thank you.
I don't get why you are looking at very complex max-flow algorithms. Those might be needed for very complex things (especially when pairings lead to zero-sum results and order/remaining parings start to matter -> !much! harder to do worst-case analysis).
Maybe the baseball problem you mention is one of those (did not check it). But your use-case sounds trivial.
1. Get current leader score LS
2. Get remaining matches N
3. For each player P
4. Get current player score PS
5. Eliminate iff PS + 3 * N < LS
(assumes parallel progress: standings always synced to all players P have played M games
-> easy to generalize though)
This is simple. Given your description there is nothing preventing us from asumming worst-case performance from every other player aka it's a valid scenario that every other player guesses wrong for all upcoming guesses -> score S of player P can stay at S for all remaining games.
Things might quickly change to NP-hard decision-problems when there are more complex side-constraints (e.g. statistical distributions / expectations)
I've been practicing some probabilities for last few weeks around 10/week usually did the job, however as the topics got harder I've started struggling and now I'm completely stuck. I've been looking online and i did find similar examples but nothing to touch my case in particular. I will continue looking for an answer so even if u can't answer my specific cases links to online literature will be appreciated.
answers are welcome, however i would rather be more interested in explanation of how a problem works.
urn contains m white and k black balls. two players are drawing the balls one after another without putting them back into the urn. the winner is the first person to draw white ball. what is the probability that second player will be the winner? (k=4, m=4)
women tend to vote with probability of a, men tend to do the same with probability of b. the probability c tells us that if we take a couple one of them will not go voting. what are the chances that at least one of them will vote? (a=0.49, b=0.61, c=0.75)
we are sending a message of n bytes. to obtain higher chance of sending entire message without ruining it we use k different wires. What is the probability of sending an entire message through one of the wires without ruining it, if the probability of ruining any of the bytes at any of the wires is p. (p=0.06, n=7, k=6)
the basketball game finals play to N wins. after m + n games the result is m : n. what is the probability of winning the finals for the lagging(the team that's behind) team if it is known that the leading team wins each match with a probability of p? (m=3 n=2 N=5 p=0.36)
sorry for my English and any help will be appreciated
Just A
So Given m = k and both = 4. And each player takes a ball out per turn. Given the worst case scenario 4 good balls will be picked (K) there will be 2 turns of both players picking the black ball then the first player will be guaranteed the white ball next turn. Therefore you need to work out the probability for the first two turns.
Turn 1
- P1 turn 1 Chance for black= 4/8
- P2 turn 2 Change for white = 4/7
Therefore turn 1 chance = (4/8)*(4/7). = 28.57%
Turn 2
- P1 turn 1 Chance for black= 2/6
- P2 turn 2 Change for white = 4/5
Therefore turn 2 chance = (4/6)*(4/5). = 26.664% but to get to turn 2 is a 28.57% chance
Therefore its the first probability add the second probability given the first case occurs. So 28.57% + (26.44%*28.57%)= 36.12%
The third case is a always lose. Top tip then be the first player!
Turn 3 Instance win for player 2 therefore a loss. = 0%
I have been thinking of this problem for some time now,I came across this in one of the lectures of Probabilistic graphical Model.https://class.coursera.org/pgm/lecture/preview
Question is pretty straight forward:
There are two coins one is normal other one is biased towards Heads 9 out of 10.
We pick one coin and toss it, the teacher's claim is if Heads shows up the first time then probability of Head showing again would be high.
All we can tell that second coin is more likely to be selected by Bayes.
But in my opinion both should be independent
Can anyone help me with that?
To completely define the process, let us add that each coin has porbability 1/2 of being picked.
Let X1 and X2 be the first two tosses. "Heads shows up the first time" is written "X1=H".
We have:
P(X2=H | X1=H) = P(X2=H & X1=H) / P(X1=H)
P(X1=H) = 1/2 × 1/2 + 1/2 × 9/10 = 14/20 = 0.7
P(X1=H & X2=H) = 1/2 × (1/2)² + 1/2 × (9/10)² = 53/100
So, P(X2=H | X1=H) = 53/70 ≃ 0.757 > 0.7
This means P(X2=H | X1=H), the probability of getting Heads at the second toss given that Heads showed up at the first, is higher than the probability of Heads showing up at the first toss.
To support intuition, you can consider another case:
we pick one coin and toss it, Tails shows up the first time. So you think that it's "probably" not the biased coin that has been picked. Conversely, if Heads shows up, then having picked the biased coin is more probable. And if so, then getting Heads is more probable.
Or yet another process: you pick a coin, but not at random: you have a higher probability of picking the biased coin. Then you do a single toss. Heads more likely for this toss.
So I've been working on a problem in my spare time and I'm stuck. Here is where I'm at. I have a number 40. It represents players. I've been given other numbers 39, 38, .... 10. These represent the scores of the first 30 players (1 -30). The rest of the players (31-40) have some unknown score. What I would like to do is find how many combinations of the scores are consistent with the given data.
So for a simpler example: if you have 3 players. One has a score of 1. Then the number of possible combinations of the scores is 3 (0,2; 2,0; 1,1), where (a,b) stands for the number of wins for player one and player two, respectively. A combination of (3,0) wouldn't work because no person can have 3 wins. Nor would (0,0) work because we need a total of 3 wins (and wouldn't get it with 0,0).
I've found the total possible number of games. This is the total number of games played, which means it is the total number of wins. (There are no ties.) Finally, I have a variable for the max wins per player (which is one less than the total number of players. No player can have more than that.)
I've tried finding the number of unique combinations by spreading out N wins to each player and then subtracting combinations that don't fit the criteria. E.g., to figure out many ways to give 10 victories to 5 people with no more than 4 victories to each person, you would use:
C(14,4) - C(5,1)*C(9,4) + C(5,2)*C(4,4) = 381. C(14,4) comes from the formula C(n+k-1, k-1) (google bars and strips, I believe). The next is picking off the the ones with the 5 (not allowed), but adding in the ones we subtracted twice.
Yeah, there has got to be an easier way. Lastly, the numbers get so big that I'm not sure that my computer can adequately handle them. We're talking about C(780, 39), which is 1.15495183 × 10^66. Regardless, there should be a better way of doing this.
To recap, you have 40 people. The scores of the first 30 people are 10 - 39. The last ten people have unknown scores. How many scores can you generate that are meet the criteria: all the scores add up to total possible wins and each player gets no more 39 wins.
Thoughts?
Generating functions:
Since the question is more about math, but still on a programming QA site, let me give you a partial solution that works for many of these problems using a symbolic algebra (like Maple of Mathematica). I highly recommend that you grab an intro combinatorics book, these kind of questions are answered there.
First of all the first 30 players who score 10-39 (with a total score of 735) are a bit of a red herring - what we would like to do is solve the other problem, the remaining 10 players whose score could be in the range of (0...39).
If we think of the possible scores of the players as the polynomial:
f(x) = x^0 + x^1 + x^2 + ... x^39
Where a value of x^2 is the score of 2 for example, consider what this looks like
f(x)^10
This represents the combined score of all 10 players, ie. the coefficent of x^385 is 2002, which represents the fact that there are 2002 ways for the 10 players to score 385. Wolfram Alpha (a programming lanuage IMO) can evaluate this for us.
If you'd like to know how many possible ways of doing this, just substitute in x=1 in the expression giving 8,140,406,085,191,601, which just happens to be 39^10 (no surprise!)
Why is this useful?
While I know it may seem silly to some to set up all this machinery for a simple problem that can be solved on paper - the approach of generating functions is useful when the problem gets messy (and asymptotic analysis is possible). Consider the same problem, but now we restrict the players to only score prime numbers (2,3,5,7,11,...). How many possible ways can the 10 of them score a specific number, say 344? Just modify your f(x):
f(x) = x^2 + x^3 + x^5 + x^7 + x^11 ...
and repeat the process! (I get [x^344]f(x)^10 = 1390).