Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about programming within the scope defined in the help center.
Closed 6 years ago.
Improve this question
Suppose you have a deck of 100 cards, with the numbers 1-100 on one side. You select a card, note the number, replace the card, shuffle, and repeat.
Question #1: How many cards (on average) must you select to have drawn the same card twice? Why?
Question #2: How many cards (on average) must you select to have drawn all of the cards at least once? Why?
(thanks, it has to do with random music playlists and making the option to not repeat the shuffle, as it were)
Q1: Relates to Birthday paradox problem
As you see in the collision problem section(in wikipedia link above), your question maps exactly.
Cast as a collision problem
The birthday problem can be generalized as follows: given n random integers drawn from a discrete uniform distribution with range [1,d], what is the probability p(n;d) that at least two numbers are the same? (d=365 gives the usual birthday problem.)
You have a range [1,100] from which you select random cards. The probability of collision(two selected cards are the same) is given as p(n;d) = ...
Further down, we have formula for average/expected number of selections as
Q(100) gives your answer.
Related
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about programming within the scope defined in the help center.
Closed 7 hours ago.
Improve this question
Need some help with a homework question.
I suck at math and our prof does not show us how to break down equations into R code at all, nor does she discuss R at all, but expects us to use it. Can someone show me how to work out this problem in R? A classmate and myself have been working on homework all day and we're exhausted and I've got a migraine setting in. Any help is much appreciated!
A population consists of N=10 primary units, each of which consists of Mi=6 secondary units. A two-stage sampling design selects 2 primary units by simple random sampling (without replacement) and 3 secondary units from each selected primary unit, also by simple random sampling. The observed values of the variable of interest are 7, 5, 3 from the first primary unit selected and 4, 2, 3 from the second primary unit selected.
The population mean per secondary unit was 4.
Estimate the variance of the estimator above.
Not sure where to start
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about programming within the scope defined in the help center.
Closed 2 years ago.
Improve this question
The problem sounds like this:
There are 8 white marbles and 10 red marbles in a bowl. Each action consists of taking one marble from the bowl and putting it back into the bowl. The question is: What is the probability that at the FIFTH time you are taking a marble out of the bowl, this would be the FIRST red marble that you took?
I tried to simplify a bit this problem and thinking only of the SECOND time. Therefore, I think the answer would be 8/18*10/18. (The probability of having the first one white and the second one red.) Could be this extended to the FIFTH case as well? (8/18)^4*10/18? I am not sure if I am missing something or not.
Thank you in advance!
This is a geometric aleatory variable (let's call it X) because you have a succession of N independent Bernoulli aleatory variables, with probability of success 10/18, so you have:
P(X=5) = (1-10/18)^4 * (10/18)
Because if you have a geometric aleatory variable Y with probability of success p then:
P(Y=k) = [(1-p)^(k-1)]*p
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about programming within the scope defined in the help center.
Closed 8 years ago.
Improve this question
So I have a lot of points, kind of like this:
animalid1;A;time
animalid1;B;time
animalid1;C;time
animalid2;A;time
animalid2;B;time
animalid2;A;time
animalid2;B;time
animalid2;C;time
animalid3;A;time
animalid3;B;time
animalid3;C;time
animalid3;B;time
animalid3;A;time
What I want to do is to first of all make R understand that the points A,B,C are connected. Then I want to get comparisons of movement from A to C and how long time it takes, how many steps were used, etc. So maybe I have a movement sequence like ABC on 20 animals and then ABABC on 10 animals and then ABCBA on 5 animals. I want to get some sort of statistical test done to see if the total time is different between these groups, and so on.
I bet this has been done before. But my Google skills are not good enough to find it.
Look at the msm package (msm stands for Multi State Model). Given observations of states at different times it will estimate probabilities of transitions and average time in the different states.
Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 9 years ago.
Improve this question
I was wondering if this would be considered a fractal or just a recursive shape. It seems like it is to me, but our lab says "However, it is not just enough that the shape was generated by some recursive process, because there are shapes you could generate recursively which are not fractals," but it also explains more. To me, it seems like it is, but I just wanted to make sure.
Thank you very much!
No, it is not a fractal, because it doesn't demonstrate self-similarity. See: http://mathworld.wolfram.com/Fractal.html
A fractal has recursive properties, but not all recursive figures are fractals.
Here's what my rule of thumb is to decide whether a shape is a fractal or not:
Zoom into the object by a factor of X (say).
Count how many copies of the original object are in the zoomed-in version, let's call it N.
The dimension of the object is the logarithm of N, to the base X.
Eg: Zoom into a square by a factor of 2, you'll have 4 copies of the square that "fit inside" the larger square. Since log 4 (base 2) is 2, hence this is a 2D object.
Look at the Koch curve:
Zooming in 3x will give you 4 copies of the original curve, hence its "dimension" is log 4 (base 3), which is a number between 1 and 2... a fractional dimension, (hence the name fractal).
Applying this rule to your recursive figure, if you zoom in 2x, you will still see the original figure (N = 1). Its dimension works out to be log 1 (base 2), which is zero.
Since zero is not a fraction, therefore your figure is not a fractal.
Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 9 years ago.
Improve this question
I've passed by this article:
http://gauravtiwari.org/2011/12/11/claim-for-a-prime-number-formula/
and this paper:
http://www.m-hikari.com/ams/ams-2012/ams-73-76-2012/kaddouraAMS73-76-2012.pdf
They say that there is a formula that when I give it (n) then it returns nth prime number. Where in other articles they say that no formula discovered so far that does such thing.
If the formula exists indeed, then why from time to time they discover the largest prime number known ever, It would be very simple using the formula to find a larger one.
I just want to ensure that such formula exists or not.
Conceptually it is very simple to test that a given number n is a prime number: just check for all smaller numbers 'm' (larger than 1) whether 'm' divides 'n' without remainder. If
such an 'm' exists 'n' is not a prime number.
Then, to find the k-th prime number you just iterate this procedure until you found the k-th number which is a prime. So yes, such a formula exists.
But, executing the above procedure is very inefficient. So even having this formula (and in real cases you would use more intelligent variants), it can take literally ages before you get an answer. And that is why more efficient variants and tricks are used to find large prime numbers.