## probability theory – Random Walk in \$mathbb{R}^2\$, \$R_n\$ is distance from origin at time \$n\$, \$tau=text{inf}{n:R_n>r}.\$ Show that \$mathbb{E}(tau)

We have a random walk which starts from the origin at time $$n=0$$. At each time step, $$n$$, we take a step of length $$1$$ in a random direction $$Theta_n sim text{Uniform}(0,2pi)$$. We have to show that $$mathbb{E}(tau).

Now I know that if we can show that $$exists Nin mathbb{N}$$ such that $$mathbb{P}(tau leq n+N| mathcal{F_n})>0$$ then $$mathbb{E}(tau). The problem is I am not sure how we could do this since we are dealing with continuous random directions (rather than discrete directions on a lattice where we know that the probability of making a certain number of consecutive steps in the same direction is positive)?

## co.combinatorics – Is there are good algebraic model of random n-hypergraphs?

Suppose $$F$$ is a finite field and $$-1$$ is a square in $$F$$. Let $$E$$ be the binary relation on $$F$$ where $$(a,b) in E$$ iff $$a – b$$ is a square. Then $$(F,E)$$ is called a Paley graph. Paley graphs are well-known algebraic models of random graphs (indeed Paley graphs are “quasi-random” in a precise sense).

I am curious to know if there is also a “finite field model” for random $$n$$-hypergraphs. It would be natural to ask for a quasi-random algebraic family of $$n$$-hypergraphs, but apparently there are multiple notions of quasi-randomness for hypergraphs, and I don’t know anything about them, so I don’t want to be more precise.

## Probability question, choosing a random integer number from [0, a]

Every time choosing a random integer number from [0, a], what is the probability of after k times, the sum of all chosen numbers is greater or equal to b.

## memory – My PC gets frequent random blue screens

As the title says, my PC gets random, frequent blue screens.
My PC is overclocked to the minimal overclock preset, which is handled by a knob on my motherboard.
I stress tested my PC using a program called Aida64 extreme. It only/always occurs when stress testing the “FPU”
Stress testing any of the other components (GPU, SSD, CPU, Memory) does not cause a blue screen to occur. Any advice on what the problem might be?

PC specs: Cooler Master 750w PSU MSI MEG Z390 GODLIKE NZXT kraken x63 I9 9900K MSI RTX 2080s gaming X trio Corsair Vengeance pro 3200MHz Fractal Design R6 Samsung 970 EVO

## SMO, Random forest and Bayes net algorithms: why does Random forest perform better?

I analyzed a dataset using those 3 different algorithms.
As I can see, Random forest performs better in most cases.
My dataset is composed of 4000 instances of two classes (class A 2000 elements, class B 2000 elements).
I use 207 metrics to classify the instances, but I also use the first 20 or 10 best metrics for InformationGain.
My question is: why sometimes an algorithm performs better than another one (in this case I’m only comparing this 3).
I read about them but I would like to have a complete scenario of why in some case RF is better than Bayes net and why sometimes is the opposite. And why SMO is always worst than the other two, in my experiences. Thank you so much!

## random – Function to spot randomness and/or predict future data

Does Mathematica have a good function to show if a series of discrete data are random or have some hidden periodicity about them? Am I correct in thinking Fourier analysis is best suited for that. What about predictability of future data points, is there a different function for that?

Here’s an example of a data series which I tried to randomly make more predictable:

``````data = {11, 11, 12, 7, 14, 10, 13, 10, 11, 9, 9, 11, 7, 10, 10, 10, 9,
13, 8, 10, 12, 7, 14, 9, 11, 5, 9, 8, 11, 14, 9, 10, 6, 5, 10, 12,
10, 16, 9, 11, 9, 11, 10, 8, 14, 13, 15, 9, 14, 7, 5, 13, 9, 12, 17,
17, 14, 10, 10, 11, 9, 12, 11, 7, 10, 6, 10, 16, 12, 8, 9, 12, 10,
11, 10, 14, 8, 12, 12, 10, 7, 11, 14, 13, 9, 13, 13, 7, 13, 11, 8,
8, 8, 8, 14, 18, 16, 12, 8, 8, 7, 11, 8, 8, 14, 13, 9, 12, 12, 10,
15, 9, 12, 10, 11, 8, 8, 12, 7, 9, 10, 8, 9, 9, 11, 9, 13, 7, 11, 7,
8, 12, 8, 11, 9, 13, 7, 13, 11, 11, 8, 12, 9, 7, 14, 16, 9, 8, 11,
9, 12, 6, 12, 10, 10, 12, 4, 12, 8, 16, 11, 13, 12, 15, 8, 11, 10,
12, 11, 16, 13, 11, 5, 10, 8, 15, 12, 8, 13, 8, 12, 12, 14, 11, 8,
10, 12, 13, 10, 10, 11, 8, 12, 8, 17, 7, 16, 7, 13, 8, 11, 8, 14, 9,
7, 11, 11, 5, 13, 11, 8, 13, 10, 8, 14, 6, 14, 11, 8, 10, 12, 14,
10, 8, 13, 13, 8, 10, 14, 11, 13, 11, 10, 9, 16, 7, 14, 11, 12, 8,
11, 9, 11, 8, 9, 5, 7, 9, 17, 10, 14, 9, 12, 5, 7, 8, 12, 11, 9, 9,
12, 7, 12, 5, 10, 12, 16, 6, 11, 12, 4, 13, 4, 6, 8, 11, 10, 8, 11,
8, 6, 7, 13, 13, 9, 10, 12, 10, 13, 14, 8, 10, 7, 10, 10, 10, 12, 8,
8, 5, 10, 9, 8}
``````

Then graph it: `ListLinePlot[data]`

The I try to plot the Fourier as such:

``````ListLinePlot[Abs[Fourier[data]], DataRange -> {1, 300}]
``````

I notice above that frequencies of roughly 35, 130, 170, and 265 spike up. Does this tell me that the data is periodic around those frequencies? If so it means it will repeat at these periods in the future?
I notice if I use more random data, I do not even get nice peak frequencies at all.

Does Mathematica have a better way of doing this? I think I could have used that function in a more efficient way, or are there better ones to use? Am I supposed to use TimeSeriesForecast[], or Predict[], or others? If so, can you show me with example how to do this.

## product identification – Help me identify these 20-sided dice with random numbers from 4 to 72

I went and Googled for the numbers, and the first (and currently only) result was US patent 7815191B2 titled “Equals: the game of strategy for the basic facts”. The abstract reads:

“An open rectangular prism with rotating cubes on dowel rods, two 12-sided dice, and three 20-sided dice invented with an accompanying method of use to function as a game to assist students in remembering the basic math facts including addition, subtraction, multiplication, and division.”

and further on, in the “detailed description of the invention”, the dice are described as follows (emphasis mine):

“5. The dice: The 12-sided dice are a different color from the 20-sided dice. The numbers are clear so that there is a way to understand the difference between the numbers on the dice. Dice 1 and 2 are dodecahedrons. Dice 3, 4, and 5 are icosahedrons.

• A. Dice 1 printed numbers: 1, 2, 3, 4, 5, 6, 7, 8, 9, 3, 5, & 7
• B. Dice2 printed numbers: 1, 2, 3, 4, 5, 6, 7, 8, 9, 4, 6, & 8
• C. Dice3 printed numbers: 4, 5, 7, 10, 12, 15, 16, 18, 20, 21, 24, 28, 35, 36, 42, 49, 54, 56, 64, & 72
• D. Dice 4 printed numbers: 1, 2, 3, 6, 8, 9, 12, 14, 18, 24, 25, 27, 30, 32, 36, 40, 45, 48, 63 & 81
• E. Dice 5 printed numbers: 4, 6, 8, 9, 12, 16, 21, 25, 27, 28, 32, 35, 36, 42, 48, 49, 54, 56, 64, & 72″

So I guess that’s where they’re from.

Ps. While there seem to be quite a few math games named “Equals” (such as this one), searching for the full title of the patent works better and turns up a bunch of sites that sell (or at least used to sell) the game in question.

Alas, it seems like the game’s original web site (playequals.com) no longer works, but the Wayback Machine does have an archived copy.

There also (thanks, Someone_Evil) appears to be a new site located at playequals.jimdofree.com which includes some YouTube videos (#1, #2) demonstrating the gameplay — although, alas, apparently only the simplest game mode, using only the two 12-sided dice. The site even has a combined PDF product flyer for all of its products, which contains the best picture of the actual game that I’ve been able to locate so far, including all of the dice:

## java – Generate unique random strings considering collisions

I’m coding random strings generator. It’s working, but I’m not sure if this is efficient.

``````/**
* @param n          total number of strings to generate
* @param length     length of generated strings
* @param charsetStr charset to be used when generate
*/
public static List<String> generateRandomStrings(int n, int length, @NonNull String charsetStr) {
if (n < 1 || length < 1 || charsetStr.length() < 1) {
throw new IllegalArgumentException(String.format("Illegal argument(s): %d, %d, %s", n, length, charsetStr));
}

//remove duplicate chars
Set<Character> charset = new HashSet<>(charsetStr.length());
StringBuilder sb = new StringBuilder();
for (int i = 0; i < charsetStr.length(); i++) {
char c = charsetStr.charAt(i);
sb.append(c);
}
}
charsetStr = sb.toString();

BigDecimal caseNum = BigDecimal.valueOf(charsetStr.length()).pow(length);
BigDecimal nBd = BigDecimal.valueOf(n);
if (caseNum.compareTo(nBd) < 0) {
throw new IllegalArgumentException(
String.format("Number of possible strings cannot exceed the requested size: (length of '%s') ^ %d < %d", charsetStr, length, n));
}

ArrayList<String> results;
if (nBd.divide(caseNum, 1, RoundingMode.HALF_UP).compareTo(BigDecimal.valueOf(5, 1)) < 0) {
//when fill factor is below 50%
//generate until target size is reached
results = new ArrayList<>(n);
while (results.size() < n) {
}
return results;
}

// when fill factor is above 50%
// pre-generate all possible strings
results = new ArrayList<>(caseNum.intValue());
generateAllPossibleStrings(results, "", charsetStr, length);

// then shuffle the collection and pick target sized sublist
Collections.shuffle(results);
return results.subList(0, n);
}

public static void generateAllPossibleStrings(@NonNull List<String> results, @NonNull String prefix, @NonNull String charset, int length) {
if (prefix.length() >= length) {
return;
}

for (int i = 0; i < charset.length(); i++) {
generateAllPossibleStrings(results, prefix + charset.charAt(i), charset, length);
}
}
``````

Any advice would be grateful, but my main focus here is the collisions. I’m using `org.apache.commons.lang3.RandomStringUtils` to generate strings if `n` is less than 50% of the number of all possible strings(let’s call it “fill factor”). If not, to avoid unnecessary collisions, I generate all possible strings using `generateAllPossibleStrings`, then shuffle the result and get a sublist from it.

The reason I used 2 methods for generating strings are:

• If the fill factor is low(like 1~2%), using `generateAllPossibleStrings` seemed overkill. So I used `org.apache.commons.lang3.RandomStringUtils`, hoping collisions not matter much.
• If the fill factor is high(like more than 90%), using `org.apache.commons.lang3.RandomStringUtils` seems inefficient since a lot of collisions will occur as time goes by. So I used `generateAllPossibleStrings` in this case, dropping without any collision looks more efficient than generating.

There is no big reason why I choose 50% as a diverging point; I just used my hunch. This too may need to be fixed.

How can I make this more time-efficient?

## geometric probability – Distribution of line segment intersections in random pointsets

let $$P$$ be a set of $$n$$ points that are uniformly distributet inside the unit square ore unit circle, and $$L=lbraceell_{ij}rbrace := lbrace lbrace alpha p+ (1-alpha q)rbrace,|,0lealphale 1;, p,qin Prbrace$$ the set of line segments connecting pairs of points.

How are the numbers $$operatorname{card}(lbrace ell_{hk}| lbrace h,krbracesubseteq P,setminuslbrace p,qrbracerbrace)$$ of line-segments that intersect $$ell_{pq}$$ distributed?

## algorithms – Check if a linear function or an affine function can be a pseudo random function

Let $$G = {0, cdots , p-1 }$$ be a field. Let $$K = G^{m times n}$$ and $$F:K times G^n to G^m$$ be a family of functions.

For $$A in G^{m times n}$$ and $$x in G^n$$ we have $$F(A,x) = Ax$$.

I need to check if $$F$$ is a secure pseudo random function.

We say that PRF $$H: K times X to Y$$ is $$(T, epsilon)$$-secure if for every algorithm $$B: X to {0,1}$$ of size $$T$$ it follows:
$$|P(B^{H_k()} = 1) – (B^{R()} = 1)| le epsilon$$
where $$H_k(x) = H(k,x)$$, $$R:X to Y$$ is a random function, and $$B^{S()}$$ means $$B$$ has oracle access to the function $$S$$.

Now, back to the question. Since the matrix $$A in G^{m times n}$$, we can take $$m times n$$ base elements of $$G^{m times n}$$, and check that for elements in $$G^m$$ if they are in $$Ax$$.

I tried to describe the following adversary B:

on input $$x in G^m$$ and access to oracle $$Z()$$, A will querry $$Z$$ on $$x$$, then it will somehow check if $$x$$ is in the image. But I am not sure how to do this.

Help would be very appreciated!

There is also the same question but with $$K = G^{m times n} times G^m$$ and $$F:K times G^n to G^m$$, $$F((A,b), x) = Ax+b$$.