Tag Info

New answers tagged

0

The chance of 1 pixel would be 1 in 16777216. The chance of 2 pixels would be (1/16777216) * (1/16777216). So the chance of all of them would be (1/16777216) ^ (320*240). Not very likely at all :) I'd stick with the lottery...


1

As explained in the comments, this is really the iteration of a transformation of distributions, not random variables, and the technique used to find the fixed points in the other question can be adapted to solve the asymptotics. To be brief (since this is a rehashing of arguments already explained), the sequence of generating functions ...


4

This problem was recently solved in a slightly more general form using the concept of throwing $m$ balls into $n$ boxes: We throwing $m$ balls to $n$ cells.... Consider $n$ boxes (the fixed list in our case). We now select $m$ items from the list at random (with replacement) -- or by throwing $m$ balls into $n$ boxes. That problem found the expected ...


24

Let $X_k\in \{0, 1\}$ indicate if entry $k$ is unmarked (in which case $X_k=1$). Then the expected number of unmarked items $X$ in an array of $N$ is $$\mathbb{E}(X) = \mathbb{E}\left(\sum_{k=1}^N X_k\right) = \sum_{k=1}^N\mathbb{E}(X_k) = N \, \left(1-\frac{1}{N}\right)^N \approx N \, e^{-1}.$$ The expected number of marked items is therefore ...


28

No, your program is correct. The probability that a particular element is not marked at all, is about $\frac{1}{e}$. This comes from the poisson-distribution which is a very well approximation for large samples (400k is very large). So $1-\frac{1}{e}$ is the fraction of marked elements.


0

If you can afford prior decomposition of the polytope into symplexes then choose a random symplex with probability distribution corresponding to symplexes' (hyper)volumes, then choose a point randomly within a symplex. Will work also for concave and not connected polytopes (sets of polytopes).


3

It is rather common, when one needs a single "random" large constant that doesn't need to have any special properties (aside possibly from being too simple), to use digits from popular numbers. $\pi$ is the most common, I think, but the golden ratio rates as being a popular number so I would be unsurprised to see it used too.


6

If you look at the code you find that the routine is from Numerical recipes. And if you look there you find the comment:According to Knuth, any large MBIG, and any smaller (but still large) MSEED can be substituted for the above values. In fact the NR routine is derived from Knuth's subtractive generator IN55 (described in Seminumerical Algorithms 3.6), ...


-3

I'm very rusty, but I'd say if you want the probability that a number is lower than your current pick, you'd use the following formula, where A = the maximum number in the set and B is the number you picked: P(lower) = 1 - (A-(B-1))/A So if you were picking from 1 to 10 and picked 9, the probability of picking a lower number would be 1 - (10-(9-1))/10, or ...


11

Picking a number at random from an infinite set makes perfect sense. It just can't be done uniformly over all points. You would have to specify the probability of (in your case, the natural numbers) choosing each and every natural number. That is, for every $n\ge 1$ you must specify a probability $p_n\ge 0$. The only requirement is that $\sum_np_n=1$. Now, ...


1

What's the point? If you have a random number generator g, you can write your own random number generator h that returns n1,n2,... for the first N calls and thereafter returns the same as g. But to answer your question: if the PRNG is any good, then you will have to brute-force it, which will be impractical if N is more than about four or five.


2

Actually, one is not interested in $P(Y<c/u(X))$ but in $P(Yu(X)\lt c)$, and this is $$P(Yu(X)\lt c)=\int_{t}^{\infty}f_X(x)F_Y(c/u(x))dx +\int_{0}^{t}f_X(x)dx.$$ Thus, the factor $$ \int_{c/u(x)}^{\infty}f_Y(y)dy $$ in the second part of the RHS is not useful. Note that, if $x\lt t$, $u(x)\lt0$ hence $c/u(x)\lt0$ and, since $f_Y(y)=0$ for every $y\lt0$, ...


1

The probability of picking red $8$ times in a row is $\frac{1}{3^8}$. The probability of picking blue $8$ times in a row is the same, as is the probability of green $8$ times in a row. So the probability of some colour $8$ times in a row is $3\cdot \frac{1}{3^8}$. For the somewhat more general problem that you mention, suppose we pick a ball $8$ times in ...


0

More directly: $EX = {B(a+1,b) \over B(a,b)}= { \Gamma(a+1) \Gamma(b) \over \Gamma(a+b+1)} { \Gamma(a+b) \over \Gamma(a) \Gamma(b) } = { a\over a+b } $ (using the fact that $\Gamma$ satisfies the functional equation $\Gamma(x+1) = x \Gamma(x)$).


1

(b)}\left(\frac{\Gamma(a+1)\Gamma(b)}{\Gamma((a+b)+1)}\right)\int_{0}^{1}\left(\frac{\Gamma((a+b)+1)}{\Gamma(a+1)\Gamma(b)}\right)x^{(a+1)-1}(1-x)^{b-1}=\frac{\Gamma(a+b)}{\Gamma(a)\Gamma(b)}\left(\frac{\Gamma(a+1)\Gamma(b)}{\Gamma((a+b)+1)}\right)=\frac{\Gamma(a+b)}{\Gamma(a)\Gamma(b)}\left(\frac{a\Gamma(a)\Gamma(b)}{(a+b)\Gamma(a+b)}\right)=\frac{a}{a+b}$$ ...


0

Could also use a monte carlo approach. Pick two random numbers ($x$ and $y$) and define a function ($f$) that gives you the pdf. If $f(x)\geq y$ then accept the point, otherwise pick again. Then it's just a matter of finding the right scaling for the function you use (I'm not familiar with the Java Random class).


1

Pick a random number between 0 and 1, and calculate $\lfloor-\log_2(x)\rfloor$


0

$\large\tt C++$: #include <cstdlib> using namespace std; const double RANDMAX1=double(RAND_MAX) + 1.0; inline double rand01() // Return random in [0,1) { return rand()/RANDMAX1; } // Return random in [minVal,maxVal) double randMinMax(double minVal,double maxVal) { const double d=maxVal - minVal; double x; do x=minVal + rand01()*d; while ( ( ...


1

If exists an integer number between minFloat and maxFloat this should work: let min = ceil(minFloat) let max = floor(maxFloat) F(minFloat, maxFloat) = floor(r * (max - min + 1) + min)


0

It's just $${1\over x}\sum_{i=0}^{x-1}i^k.$$ Are you looking for anything more specific than that? There is a closed form, but it involves Bernoulli numbers.


0

$$Ef(x) = \int P(\xi)\cdot\xi\ d\xi = \int_0^{x-1}\frac{1}{x-1} \cdot \xi\ d\xi = \frac{1}{x-1}(\frac 1 2 \xi^2)\Big|_0^{x-1}$$ $$Ef(x)^k = \underbrace{\int_0^{x-1}...\int_0^{x-1}}_{k\text{ integrals}} (\frac{1}{x-1})^k x_1...x_k\ dx_1 ... dx_k$$


1

If you have $0 \le u \le 1$ you get: $$u=F_X(x)=I_{\alpha_3}(\alpha_1,\alpha_2)$$ $$⟹\alpha_3=\alpha_3(u)=\mathrm{betaincinv}(u,\alpha_1,\alpha_2)$$ $$⟹x=F_X^{−1}(u)=(b−a)\alpha_3(u)+a$$


2

Yes, the joint cumulative distribution function $F_{X,Y}(x,y)$, that is, the probability that $X\le x$ and $Y\le y$, is the product of the individual cdf $F_X(x)$ and $F_Y(y)$. If $X$ and $Y$ have continuous distributions with density functions $f_X(x)$ and $f_Y(y)$, then the joint density function $f_{X,Y}(x,y)$ is the product of the individual density ...


0

To $a):$ You get $P(X\le 1500)=F(1500)=1-e^{-\frac{3}{2}}.$ So $P(X\ge 1500)=1-F(1500)=e^{-\frac{3}{2}},$ which is the probability that a bulb lasts $1500$ hours or more. Now you need to consider a binomial distribution $Y\in B(10,e^{-\frac{3}{2}})$ and get $P(Y\ge 7).$ That is: $$P(Y\ge ...


0

Start by finding the prob that a bulb does not last 1500 hours. : p=$\int_0^{1500} \frac{1}{1000}*e^{\frac{-1}{1000}*x}$. Find $q=1-p.$ Prob that atleast 7 bulbs function function for 1500 or more= $\sum _{i=7 to 10}(^{10}C_{i})q^{i}p^{10-i}$ Prob that a bulb does not last more than 2000 hours, r= $\int_{0}^{2000} \frac{1}{1000}*e^{\frac{-1}{1000}*x}. $ ...


0

"Radical" in this context has nothing to do with $\sqrt{}\ $. Rather, it's the adjective from radix, which is another word for base, as in base-10, base-2, and so on. You're taking the expansion to base $b$ --- the expansion with radix $b$ --- and writing it backwards --- "inverting" it.


2

The problem is actually fairly complicated, and I would refer you to the article "A unified approach to word occurrence probabilities" (link) for an exhaustive analysis. But we can approximate the result more simply. Note that the expected number of occurrences (counting overlaps) is trivial to obtain: there are $N-n+1$ possible starting positions, and the ...


0

Making the simplifying assumption that 11-digit phone numbers can have any digit in any place, it's just under $1\%$ (about $0.9951046\%$). There are $10^{11}$ possible "phone numbers" only one of which is the "magic" number, so the probability of not seeing the phone number for any one 11 digits string is $\frac{10^{11} - 1}{10^{11}}$. However, with one ...



Top 50 recent answers are included