I have been given 25 objects numbered from 1 to 25 and a set S = {-2, -1, 0, 1, 2}. I have to choose a random number from the given set and add it to all objects from 1 to 5. Again choose a random number and add it to objects from 15 to 25 and again choose a random number and add it to objects from 5 to 12, indexing of objects is 1 based.What will be the expected sum of all objects after all 3 turns?
120455
I have been given $25$ objects numbered from $1$ to $25$ and a set $S = \{-2, -1, 0, 1, 2\}$. I have to choose a random number from the given set and add it to all the objects. I have to do this $5$ times. What will be the expected sum of all objects after all $5$ turns?
14218
$n+k-1 \choose k$  ${{n+k-1}\choose{k-1}}$  ${{n+k-1}\choose{n}}$  So I've been using $n+k-1 \choose k$ to r pick k objects from n objects allowing repetitions. In the following question though   How many ways are there to pick r objects from n objects when  repetitions are allowed and either both the first and the second  objects appear exactly once or both do not appear?   I was told that     If you want to select r objects from n and the order doesn't matter   and each object can be reapeted than the general formula is: ${{n+k-1}\choose{k-1}}$ or ${{n+k-1}\choose{n}}$   and now I'm just a bit confused on the difference between them, and the usage  cases. I am a beginner so a simple explanation would be appreciated!
121526
You toss a fair die three times. What is the expected value of the largest of the three outcomes?   My approach is the following: calculate the probability of outcome when $\max=6$, which is $$P(\text{at least one $6$ of the three rolls}) = 1 - P(\text{no }6) = 1 - (5/6)^3$$ and then calculate the probability of outcome when $\max=5$, which is $$P(\text{at least one $5$ of the three rolls &amp; $5$ is max}) = 1 - P(\text{no $5$ &amp; $5$ is max}) = 1 - (4/6)^3.$$  I wonder if this approach is right.
85499
From an urn with numbers $1,...,n$ we draw $k &lt; n$ numbers without replacement.   Let $X_i$ be the $i$-th draw. The random variable is their sum $X=\sum_{i=1}^kX_i$.  I have already calculated the expected value of the sum, which is   $$\Bbb{E}[X]=\sum_{i=1}^k\Bbb{E}[X_i]=k\frac{n+1}{2}$$ because each $\Bbb{E}[X_i]=\frac{1}{n}\sum_{i=1}^n i=\frac{n+1}{2}$.  Now the variance of the sum would be $$Var[X]=\Bbb{E}[X^2]-\Bbb{E}[X]^2$$  I have read that the variance of a sum is the sum of variances if the random variables are independent, it does not seem to be the case here, as previous draws determine future draws.  Is there an elegant way to determine the first summand of the variance?    Edit: I am trying it the ugly way.  $\Bbb{E}[X^2]=\Bbb{E}[(\sum_{i=1}^kX_i)^2]=\Bbb{E}[\sum_{i=1}^k \sum_{j=1}^k X_iX_j]=\sum_{i=1}^k \sum_{j=1}^k \Bbb{E}[X_iX_j]$  To know $\Bbb{E}[X_iX_j]$ we would have to know $\Bbb{P}(X_iX_j=k)$, meaning we would have to know the number of ways to write a number as the product of two factors $1\leq X_i, X_j \leq n$... I am pretty sure I am off the track here, as I do not see a way to do it for a general $n$.    Am I wrong to regard the $X_i$ instead of the $X$, which are independent, as two draws of $k$ balls would be independent? Then $\Bbb{E}[X^2]=\Bbb{E}[X]\Bbb{E}[X]$
650
What is the best way to randomize the order of a generic list in C#? I've got a finite set of 75 numbers in a list I would like to assign a random order to, in order to draw them for a lottery type application.
53473
I have one white ball, one yellow ball, one red ball, one black ball. I put the four balls in a nontransparent box. I pick a ball from the box to see its color and put it back to the box.  Assuming picking is random, how many times on average do I need to pick in order to see all four colors?  If I'm lucky, I only need to pick four times. If I'm out of luck, I may get red, red, red, red, red, red,....  But what is it on average?
2129
Started with an algorithms problem which says item is sold in 3 different sizes of boxes. These 3 boxes have 6, 9, 20 items each. Input is n, figure out if you can buy exactly n items.   It got me thinking that there is a number m, if n &gt;= m then you always can buy n items. If you generalize number of items in a box into s1 s2 s3 ... sy, number of boxes to buy into k1 k2 k3 ... ky, number of items you want to buy into n.  k1*s1 + k2*s2 + ... + ky*sy = n  How do I find the value m, if n &gt;= m there's always gonna be k1, k2, ..., ky which satisfies above equation. So that the algorithm can say yes you can without doing anything if n is large enough.
37252
A student prepares for an exam by studying a list of 12 problems. She can solve 9 of them. For the exam, the instructor selects 7 problems at random from the 12 on the list given to the students. What is the probability that the student can solve 5 of the 7 problems on the exam?  I am really confused by this problem. My first initial thought was to do:  (5 chose 7)(7 chose 0)/ (12 chose 7)  I am not 100% sure about this though.
117427
Suppose we have 'n' Stars and 'k' bins. We have to distribute 'n' stars in 'k' bins (using k-1 bars) such that bins can be empty. We can do this in $\binom {n+k-1}{k-1}$ = $\binom {n+k-1}{n}$ ways. But Sometimes we use another notation $\left({{k}\choose {n}}\right)$ to represent $\binom {n+k-1}{k-1}$, Which says 'k multichoose n'. But normally as n > k, then how can we choose more objects from less objects i.e. n from k. So, I think It has to be like this $\left({{n}\choose {k}}\right)$.
39841
How to use the  method?  Say I want to find number of combinations I can get with $x_1+x_2+x_3+x_4=22$,  where $x_i\in\mathbb{N}$.  Is this the correct time to apply the method?  This is being repurposed in an effort to cut down on duplicates, see here:     and here:
64845
In how many ways can we choose $r$ numbers from $\{1,2,3,...,n\}$,   In a way where we have no consecutive numbers in the set? (like $1,2$)
33744
To each vertex of a pentagon,we assign an integer $x_{i}$ with sum $s=\sum x_{i}&gt;0$. If x,y,z are the numbers assigned to 3 successive vertices and if $y&lt;0$,then we replace $(x,y,z)$ by $(x+y,-y,y+z)$.This step is repeated as long as there is a y&lt;0.Decide if the algorithm always stops.
29781
I have the following problem: A class has 20 students, 16 females, 4 males. Find all possibilities of choosing 6 students so that at least one is male.  I did the following, pick one male from the 4, you have 4 possibilities, then you are left with 19 students, pick 5, so I get 4*${19}\choose{5}$ possibilities.  However, one can notice that if you want no one to be male, then the possibilities are ${16}\choose{6}$, so, one could argue that the solution is instead ${20}\choose{6}$ - ${16}\choose{6}$.  So, which is solution is correct, and why?  $$4* {{19}\choose{5}}$$  or $${{20}\choose{6}} - {{16}\choose{6}}$$
28043
There is a party with 20 people, and everyone writes their name down   on a piece of paper and puts it into a bag. The bag is mixed up, and   each person draws one piece of paper. If you draw the name of someone   else, you are considered to be in his "group". What is the expected   number of groups after everyone draws?   So basically if we have a loop where each person draws someone else's name, and the last person draws the first person in that list's name, we have a group. Not quite sure how to approach this problem.  Thanks for any help.
114497
Calculate $$A={1\over {n\choose 0}}+ {1\over {n\choose 1}}+ ...+{1\over  {n\choose n}}$$  and  $$B={1\over {n\choose 0}}- {1\over {n\choose 1}}+ ...+{(-1)^n\over  {n\choose n}}$$     My idea for $A$ is some probabilistic reasoning. Color the sets $$\{\}, \{1\}, \{1,2\}, \{1,2,3\},...\{1,2,...,n\}$$ and ask our self what is the probability that I choose colored set among all sets. Clearly this is exactly ${n+1\over 2^n}$ and on the other side it is $A$:  probability that I take empty set is ${1\over {n\choose 0}}$,   probability that I take colored set with 1 element is ${1\over {n\choose 1}}$  probability that I take colored set with 2 elements is ${1\over {n\choose 2}}$  and so on ...   So $A ={n+1\over 2^n}$. But I have no idea how to attack $B$.
113008
Four dice are thrown, what's the probability that:  a) None of them fall higher than three?  b) None of them fall higher than four?  c) That four is the highest number thrown?  So for a, I wanna think about the denominator first. There are 6 possible outcomes for each dice, and we have four dice. So we're technically picking r out of n objects, aka picking 4 possible values out of 6. So the denominator/sample space should be $6^4$ right?  Now this is where I'm getting tripped up. Order technically shouldn't count, because we only care about the quadruplets that don't have a value higher than 3. I might be wrong, maybe I am, but could someone explain a bit more? My professor stated that typically in the sample space/denominator, we want order to count.   So I'm trying to think of the numerator now, so we want to find the probability that no values appear higher than 3, so some events that can occur are: $(1, 1, 2, 3), (1, 2, 2, 3), (1, 1, 1, 1)$ etc. Again, I can't see why order should count here, because if we only are concerned about what appears rather than how they appear, then we can say $(1, 1, 2, 3)$ is equal to $(1, 2, 1, 3)$? So if order does not count, and we have replacement, then does this lead the case where we use $$\binom{n-1+r}{r}$$to find out the probability?   I'm pretty sure if I can do a), I could prob do b), but if someone could maybe lead me in the right direction for c) I would appreciate that too!
82881
Before reading the Wikipedia article, my idea to calculate the probability was as follows:  $1-\left(\frac{364}{365}\right)^{_nC_{2}}$  Basically, I thought to compare all combinations of pairs ($_nC_{2}$) and require them to have different birthday ($\frac{364}{365}$). It gave a very similar result to the wiki method, but is slightly different and I can't tell how  my way of thinking is wrong.  Can anyone tell me what I'm missing?