Tag Info

New answers tagged

1

Depending on how many of these you want to generate, a fairly simple approach is to use Markov Chain Monte Carlo sampling; this can be used in practice to uniformly sample many combinatorial structures such as Latin squares; see, for example, Jacobson and Matthews (1996). Here's a solution which works in the more general situation that, for each cell in the ...


2

This is a very broad area. Statistical tests can only rule out strings on the basis that they are "statistically unlikely to have been generated by a true random generator". Some keywords are NIST Tests, DieHard tests. Look at the Crypto and/or Theoretical Computer Science stackexchange sites and there will be posts tagged randomness or randomness testing. ...


2

First, the graph must be undirected (if it's directed and there exists an edge from $a$ to $b$ but not from $b$ to $a$, then if $X_1 = a$ and $X_2 = b$, it is impossible to have $X_{n-1} = b$ and $X_n = a$. Let $d(x)$ be the out degree of node $x$: $$P(X_i = x_1, \ldots, X_n = x_n | X_0 = x_0) = \prod_{i \in [0, n)} d(x_i)^{-1}$$ $$P(X_i = x_{n-1}, ...


0

If the modulus sign means a normal mathematical modulus, then I think the key has to be wrong. (I don't see the reason why you need it, as square will take care of the sign anyway, unless we are working with complex variables. ) If we assume that h,b,k,c are independent variables in very general terms. $$ E[y^2]= E[th^2 + b^2+k^2+c^2 +2bk+2bc+2bh \sqrt t ...


1

Building on Michael Hardy's answer. I use the notation $\bar h = E(h)$ and $\bar k = E(k)$ for readability. Since $h,k$ are independent, $E(hk) = \bar h \bar k$. By definition, $E(h^2) = \sigma_h + \bar h^2$ and $E(k^2) = \sigma_k + \bar k^2$. We have, $$\begin{align*}E((\sqrt{t}h+k)^2)& =E(th^2+2\sqrt{t}hk + k^2)\\ &= ...


2

The probability that he hits the target on this 11th attempt is $0.8$ - you're assuming that past (independent, we assume) events have an effect on the outcome of the event. On the other hand, the probability of that specific sequence of events, $10$ failures and $1$ success, is $$(0.2)^{10}(0.8) = 8.2\times10^{-8}$$


2

$\newcommand{\E}{\operatorname{E}}\newcommand{\var}{\operatorname{var}}$ It follows from independence that $\E(hk)=\E(h)\E(k)$. If $\E(h)=\E(k) = 0$ then $\E(h^2)= \var(h)$ and $\E(k^2)=\var(k)$ and we have \begin{align} \E\left((\sqrt{t}\, h + k)^2\right) = \E(th^2 + 2\sqrt t\,hk + k^2) & = t\E(h^2) + 2\sqrt t\E(h)\E(k) + \E(k^2) \\[10pt] & = ...


1

Your question mention an inefficient algorithm generating four independent and uniformly distributed numbers among the integers from 0 to 100 and repeating until their sum is 100. I'll assume you are satisfied with the distribution generated by that algorithm, but you are not satisfied with the performance. Before looking into how to produce the ...


0

The post you are referring to is about differential entropy $h(X)$. It's true that simply relabeling the outcomes of a discrete random variable $X$ cannot change its entropy $H(X) = -\sum_x p(x)\log p(x)$. Differential entropy is a similar quantity, but lacks some of the nice properties of $H(X)$, e.g., it can be negative, it changes with nonzero scaling, ...


0

I don't have much experience at all with computing complexity, but this problem reminded of a result I always loved from combinatorics. It's somewhat easy to show, with the Pigeonhole Principle, that any set of at least 27 non-negative integers has two elements whose sum (or difference) is 50. So why not pick two sets of such size from [0,100], and confirm ...


0

You can apply chaotic time series analysis to the data. There are some useful tools about this subject here. Such implementations try to find positive Lyapunov exponents from the data set based on the studies of Rosenstein et. al. ("A practical method for calculating largest Lyapunov exponents from small data sets") or Wolf et. al. ("Determining Lyapunov ...


0

Yes, your assessment of modulo os correct. You can't compress random numbers. Compression works by removing the non-randomness of the input stream. Because it is non-random, you can reconstruct it at the other end. You could possibly do lossy compression - discard some of the randomness and replace it with pseudo-randomness on the other end that looks ...


0

There is no such thing as being "totally random". For example, consider two experiments. In the first, I draw a value uniformly from $[0,1]$. In the second, I draw it uniformly from $[-1,1]$. Which of these is "totally random"? Also, it is misleading to say that each value is equiprobable, since this is true in every continuous distribution – every ...


7

Generate four random numbers between $0$ and $1$ Add these four numbers; then divide each of the four numbers by the sum, multiply by $100$, and round to the nearest integer. Check that the four integers add to $100$ (they will, two thirds of the time). If they don't (rounding errors), try again...


0

Are computational constraints really an issue? Do you intend to scale this up to higher numbers? Does this method need to be achieved using physical dice, a dice rolling program, Excel, or a programming language? As Thomas Andrews points out, using that method will bias towards something like 50/25/12/12 compared to 25/25/25/25. Why not just roll 4 dice ...


27

No, this is not a good approach - half the time, the first element will be $50$ or more, which is way too often. Essentially, the odds that the first element is $100$ should not be the same as the odds that the first elements is $10$. There is only one way for $a=100$, but there are loads of ways for $a=10$. The number of such sums $100=a+b+c+d$ with ...


0

there may be a need for slightly more precise specification of what kind of sample you want. but to begin with you may feel less uneasy if you sample by picking three numbers at random in $[0,100] \cap \mathbb{Z}$, let us call them $a,b,c$ supposing you have ordered them so that $0 \le a \le b \le c \le 100$ now set: $$ x_1 = a \\ x_2 = b-a \\ x_3 = c-b \\ ...


0

Let $U$ be a random variable uniformly distributed over $[0,1]$. Also, let $F$ is the pdf of an arbitrary distribution. Denote the inverse of $F$ by $F^{-1}$. In our case $F$ is strictly monotonous over $[a,b]$ The first thing that you have to understand is that the random variable $Y=F^{-1}(U)$ will be distributed according to $F$: ...


0

From your application, it seems a uniform distribution might be desirable. If that is the case, you could test the outputs of $S1$ and $S2$ against a uniform distribution using the Kolmogorov-Smirnov test. If one of the algorithms consistently produces lower p-values, discard that and use the other one.


0

First you have to use the cdf of the binomial distribution: $P(X \geq 20)=\sum_{x=20}^{130}{130 \choose x}\cdot \left(0.16\right)^x\cdot\left(0.84\right)^{130-x} $ Applying converse probability $P(X \geq 20)=1-P(X \leq 19)=1-\sum_{x=0}^{19} {130 \choose x}\cdot \left(0.16\right)^x\cdot\left(0.84\right)^{1000-x} $ Approximation of the Binomial ...


1

Yes, the problem is much more with defining a pattern you like than with the random numbers. Taking your alternate even/odd example, each digit has five choices, so you can just generate a random number from $0$ through $4$ for each digit. If the digit is supposed to be an even one, double it. If the digit is supposed to be odd, double it and add $1$. Now ...


0

$x \ mod \ 6 \in \{0,1,2,3,4,5\}$ for all $x \in \mathbb Z$, which is to say that a modulus of 6 partitions the integers into these 6 equivalence classes. Is it true that $x \ mod \ 6$ has a maximum when $x \ = \frac{m}{2} + 1$, or $x = 4?$ Clearly not. $x \ mod \ 6 \in \{0,1,2,3,4,5\}$, and in fact, if we choose $x = 5$, then $x \ mod \ 6 = 5 \ mod \ 6 = ...


1

There are always $n$ integers modulo $n$. When we choose representatives for these, there are a lot of options available. A common choice is $\{ 0,1,\dots,n-1 \}$, for instance. However, any $n$ consecutive integers work. For instance, another relatively common choice is $\{ 1,2,\dots,n \}$. In certain applications, it's desirable to extend in both ...


1

Just expanding Alamos' comment, $$\mathbb{E}[X^k]=\int_{0}^{1}x^k\,dx=\frac{1}{k+1},$$ and assuming that $X$ and $Y$ are independent, $$\mathbb{E}[XY^k]=\mathbb{E}[X]\cdot\mathbb{E}[Y^k]=\frac{1}{2k+2}.$$


0

You have $$F(x) = \left\{ \begin{array}{lr} C\log_e(x/a) ,& \qquad x \in (a,b)\\ C\log_e(b/a)+\gamma C\log_e(x/b) ,& \qquad x \in (b,c) \end{array} \right.$$ So $$F^{-1}(y) = \left\{ \begin{array}{lr} a\exp\left(\frac{y}{C}\right) ,& \qquad y \in (0,C\log_e(b/a))\\ ...



Top 50 recent answers are included