# Tag Info

## New answers tagged random

1

You can't. It is impossible. There are however good libraries out there for pseudo-random number generation. Here's a list of generators: http://en.wikipedia.org/wiki/List_of_pseudorandom_number_generators Is there a particular programming language you are using?

0

There is no algorithm to generate truly random numbers. An algorithm follows rules (by definition), so its output can't be random.

0

Step 1: Choose a point $(r,s,t)$ uniformly at random in the cube. Step 2: Choose $a,b,c$ uniformly at random from some large interval $[-N,N]$. Set $d=-ar-bs-ct$. Step 3: Generate a bunch of random (uniformly) $(x,y)$ points in the $[0,1]\times[0,1]$ square. Solve for $z$ from your plane equation; if the $z$ is outside $[0,1]$ then throw out. These are ...

1

Hint: When you throw two six-sided dice, you can have $6\times 6=36$ possible results that are equally likely, that is each has a probability of $1/36$. The results can be represented as pairs of the form $(x,y)$, for example $(1,1), (1,2), (2,1)$ etc. Then the probability of each given event is calculated as a fraction where the numerator is the number of ...

0

Hint: In general, since each outcome (possible dice roll, like $(3,4)$ or $(5,5)$) is equally likely, we have $$P(X = i) = \frac{\text{number of outcomes where the sum of the dice is i}}{\text{total number of possible outcomes}}.$$

1

The solutions do not depend on $p$ in $(0,1)$. These are the Poisson distributions and the Dirac mass at $0$. To show this, first recall that, for every random variable $Y$ binomial $(n,p)$ and every $|s|\leqslant1$, the generating function of $Y$ is $$E(s^Y)=(ps+q)^n.$$ Considering $g(s)=E(s^X)$, the identity in distribution in the question translates ...

0

Hint: X will be distributed with the probability mass function such as below $$Pmf(X_1+X_2) = 2.\sum_{k=0}^{n} {n\choose k} {p}^k {(1-p)}^{n-k} = 2*Bin*(X_1,p)$$ Uses the principle of binomial identity ${n\choose k} = {n\choose {n-k}}$ Thanks Satish

3

You have $\alpha_{i+1}=\alpha_{i} X_{i+1}$, where $X_i\sim U(0,\beta)$; so $\alpha_{n}=\alpha_{0}\prod_{i=1}^{n}X_{i}$. The infinite product (and hence $\alpha_n$) diverges to $+\infty$ if its logarithm, $$\sum_{i=1}^{n}\log X_i,$$ does, and by the law of large numbers this occurs almost surely if $E[\log X_i]>0$. Now, $$E[\log ... 5 For a fixed \beta, your algorithm can be stated as follows: Pick \alpha_0 arbitrarily. For each n \ge 1, generate a uniformly random real number X_n in [0, 1] and set \alpha_n = X_n\alpha_{n-1}\beta. Thus each \alpha_n is got by multiplying the previous \alpha_{n-1} by \beta X_i, so$$\alpha_n = \alpha_0\beta^n X_1 X_2 \cdots X_n \tag ...

1

unpredictable numbers, as used in digital security, are essentially random numbers in a practical sense. Creating a random number is actually really hard. When working with computers, a 'random number generator' is actually a 'pseudo-random algorithm', and weaker algorithms will exhibit things we might like in a random number generator, like a nice ...

0

I might be missing something, but in an $\overbrace{n \times n \times \cdots \times n}^m$ Latin hypercube, there are $n$ distinct symbols each occurring exactly $n^{m-1}$ times. Thus, a random cell will contain any given symbol with probability $\tfrac{n^{m-1}}{n^m}=\tfrac{1}{n}$.

2

I think that you're looking for the gallery function. It has over 60 types of test matrices. For the particular case of diagonally dominant matrices, you might look at the 'dorr' option: A = full(gallery('dorr',5,0.01)) You can find the code for most of these matrix generation functions in the matlabroot/toolbox/matlab/elmat/private/ directory, where ...

1

Yes, in general the probability of a random variable $X$ being in the interval from $x_0$ to $x_1$ is given by: $$P(x_0 < X < x_1) = \int_{x_0}^{x_1} f(x)\;dx$$ This represents the area under the graph of the pdf $f(x)$. Also note that it doesn't make sense with a continuous distribution to talk about the probability $P(X=x)$. This is zero because ...

0

Here is the algorithm that works, and it appears to be significantly faster than factoring. This comes from the Handbook of Applied Cryptography, whose notes can be found online here: http://cacr.uwaterloo.ca/hac/

0

"Numerical Methods in Economics" by Kenneth L. Judd gives the construction as Weyl: $x_n=(\{n\sqrt{p_1}\},...,\{n\sqrt{p_d}\})$ Haber: $x_n=\left(\left\{\tfrac{n(n+1)}2\sqrt{p_1}\right\},...,\left\{\tfrac{n(n+1)}2\sqrt{p_d}\right\}\right)$ Niederreiter: ...

0

Consider the sequence of moves, either up ($U$) or right ($R$). One such sequence is $UUUUURRRRR$, another is $URURURURUR$, etc. Because of the boundary conditions, there are always an equal number of $U$s and $R$s. If you reach the top row before reaching $(n, n)$, the last move will be $R$. What is the probability of this occurring? Hint: Further ...

0

Here is yet another way to do it. Set up a Markov chain. The initial state is 00000, representing no observations of any of the 5 types of items. Final state is 11111, representing all 5 items having been observed at least once. So, for example, the state 10101 is the case where you have not seen items 2 or 4, but have seen items 1,3,5, at least once each. ...

4

Hint: Let us first get it wrong. There are $\binom{70}{20}$ ways to select $20$ squares, all equally likely. A choice is favourable if some row is filled. Which row? It can be picked in $\binom{7}{1}$ ways. And then the rest of the squares can be filled in $\binom{60}{10}$ ways. That gives a total of $\binom{7}{1}\binom{60}{10}$ favourables. However, we ...

2

The expected number of rounds until you find an $A$ is $\frac1{0.05}=20$, but that doesn't mean you have found $A$ within $20$ rounds. After $45$ rounds, the probability of failure to collect $A$ is $(1-0.05)^{45}\approx 0.0994<0.1$. The probability that you fail to have collected a $B$ by then is $(1-0.1)^{45}\approx 0.087$. For $C$ it is $\approx ... 0 A tedious way to do it (you will definitely need a computer, not by hand nor calculator), is to use the multinomial distribution. You want to determine$nsuch that the probability \begin{align*}0.1&\ge P(X_1\ge1, X_2 \ge1,\dots,X_5\ge1)=\\&=1-\left[P(X_1=0,X_2\ge1,\ldots,X_5\ge1)+\ldots+P(X_1\ge1,X_2\ge1,\ldots,X_5=0)\right]\end{align*} 0 Getting random serial numbers is simple with a completely uniform distribution - with 16 hex digits, the probability of any particular string is 1/16^16. You can work out the probability of collisions using random strings by looking at birthday attacks or the birthday problem. In general, its a bad idea to generate your serial numbers randomly. You usually ... 0 A linear time invariant system applied to a Gaussian process (such as AWGN) will give a Gaussian output. You've found the covariance function and the mean is also easy to calculate - ifL$is linear, then$E[L(x(t))] = L(E[x(t)])$where$x$is the input (AWGN) and$L$is the system (in this case, convolution with a sinusoid). The proof can be found in any ... 0 x = (x + 78887) % i This (and its y/j equivalent) look to me like examples of simple linear congruential generators, a basic way to generate pseudo random numbers. I'm assuming the 78887 is somehow related to the dimensions of your ocean. random.nextInt() Looks like it just returns a random integer (uniformly distributed with respect to its previously ... 1 For convenience, define$X^\prime\stackrel{\rm{}def}{=} X-\mathbb{E}{X}$,$Y^\prime\stackrel{\rm{}def}{=} Y-\mathbb{E}{Y}$. Then$\operatorname{Var}X^\prime=\mathbb{E}[{X^\prime}^2]=\operatorname{Var}Y^\prime=23, and $$\operatorname{cov}(X,Y)=\operatorname{cov}(X^\prime,Y^\prime)=\mathbb{E}[X^\prime Y^\prime.]$$ Now, by Cauchy—Schwartz, $$\lvert ... 2 Hint: Look at the Cauchy-Schwarz Inequality. A different hint: What is the variance of the sum? 1 If we define Z as tabstop suggested above, we could write$$\begin{aligned}\ P(Z=z) = P\left[((X=z)\cap(Y\leq z))\cup\left(X<z)\cap(Y=z)\right)\right] \\ \ = P(X=z) \cdot P(Y\leq z) + P(X<z)\cdot P(Y=z) \\ \ = \frac{1}{6}\cdot \frac{z}{6}+\frac{z-1}{6}\cdot\frac{1}{6} \\ \ = \frac{2z-1}{36} \end{aligned} $$If we make a 6\times 6 table with the ... 0 You can describe Z via its Cumulative Distribution Function (CDF):$$P(Z\leq z) = P(\max(X,Y)\leq z) = P(X\leq z\text{ and }Y\leq z)$If$X$and$Y$are independent,$P(Z\leq z)=P(X\leq z\text{ and }Y\leq z)=P(X\leq z)P(Y\leq z)\$. You can think of it as having a machine which realizes both X and Y and then compares the realizations and outputs the bigger ...

Top 50 recent answers are included