## Can you solve the problem of the shortest route using the Monte Carlo Tree Search?

I think the Monte Carlo Tree Search could be used to find the shortest path, but it seems that this method is only used considering the win / lose results in the simulation step.

If we consider the length of the road as the result of the simulation step, how would the backward propagation work? It seems that one of the nodes along the optimal path could be penalized if a child ends up with a long path in the simulation step.

## Order each column in a list contained in an association (about the replicas of Monte Carlo)

I have an association that contains three 1000×200 matrices.
Each row of a matrix denotes a different set of parameters, while
Each column contains the results of the function for a specific value of x.

I want to sort each column in ascending order, so that the first row now contains the lowest values, while the last row will contain the highest ones.
These rows will be used to create a function that represents the envelope of the different results of a Monte Carlo method.

I tried using Sort, along with Transpose, but the result is messy.

Thanks for the help

## Artificial intelligence – Value of C in the Monte Carlo algorithm.

I have developed the Monte Carlo search algorithm in the tabs.
https://en.wikipedia.org/wiki/Monte_Carlo_tree_search

My question is. What should be the value of C in the equation https://www.geeksforgeeks.org/ml-monte-carlo-tree-search-mcts/?

The general consensus is that you should use a root value (2), but when I use a value of 10 it works, but when I use the root (2) I lose many times.

So, how can I find the best value for C, which best suits my problem?

## pr.probability – Sample of separable importance of Monte Carlo integration

I want to calculate the multivariable integral in the $$R$$ hypercube

$$int_R f (x) dx$$

I use a base method of montecarlo in the importace sample:

$$I_f = int_R f (x) , dx = int_R frac {f (x)} { omega (x)} omega (x) , dx = E left[frac{f(X)}{omega(X)}right]$$

The optimal density function (which minimizes the variance) is:

$$omega (x) = frac {| f (x) |} { int_R | f (z) | , dz}$$

But I do consider a separable density function. I have to prove (and this is my question) that the optimum in this case is (suppose that $$R = [0,1]^ d$$):

$$omega_1 (x_1) = frac { sqrt { int_0 ^ 1 dots int_0 ^ 1 frac {f ^ 2 (x_1, dots, x_d)} { omega_ {x_2} (x_2) dots omega_ {x_d} (x_d)} , dx_2 dots , dx_d}} { int_0 ^ 1 sqrt { int_0 ^ 1 dots int_0 ^ 1 frac {f ^ 2 (x_1, dots, x_d )} { omega_ {x_2} (x_2) dots omega_ {x_d} (x_d)} , dx_2 dots , dx_d} , , dx_1}$$

$$omega (x_1, dots, x_d) = omega_1 (x_1) dots omega_d (x_d)$$

Sorry, my English is not very good.

## Decrease in stochastic advantage in general Monte Carlo algorithms

Recall that a Monte Carlo algorithm is $$p$$-Correct if you give a correct answer with probability at least $$p$$. In the case of decision problems, where the response is binary, repeating the MC algorithm can increase the confidence that a correct answer is obtained.

However, in the case that more than one answer is correct, this confidence may decrease. I wonder how many times $$k$$ Is it necessary to execute an algorithm of this type to obtain a confidence in the response that is less than 50%?

This is what I have done:

Suppose that $$k = 3$$ and I have a 75% correct MC algorithm that generates 5 possible answers, 4 of which are correct and 1 is incorrect. I believe that in this case, the 75% "correction" of the algorithm is divided among all the possible correct answers, so that each correct answer has a "probability" of 75% / 4.

Suppose that the correct answers are $$a, b, c, d$$ and an incorrect answer is $$e$$.

In this case, if I list all the possible combinations of outputs of an MC algorithm that I execute $$k = 3$$ Sometimes, I get a list of tuples $$(a, a, a)$$, $$(a, a, b)$$… and so on, each of which is associated with a probability that it will occur. For example $$(a, a, a)$$ has probability $$(0.75 / 4) ^ 3$$ of happening and $$(a, a, e)$$ has probability $$(0.75 / 4) ^ 2 * 0.25$$.

So, if I build a table associating each possible tuple with its probability of occurrence, and add up the probabilities of all the events in which the algorithm would yield the correct answer by majority vote (the ties are divided by random selection), this should give me the final "Confidence" of the algorithm. In this case, I get numbers around 0.65-0.75 (due to the randomness in the draws division).

However, I could not find a $$k$$ which gets this value below 50%.

Any idea if I'm doing something wrong? The help is very appreciated.

## Monte Carlo Algorithms: Is there a problem where two opposing Monte Carlo algorithms can solve it?

I started reading about probabilistic algorithms and Monte-Carlo algorithms. Since a Monte-Carlo can only give a certain answer for True or False, I was wondering if it is possible that for the same problemThere are two opposing Monte Carlo algorithms capable of giving a certain response. (On the contrary, I mean that one would be sure when it is FALSE, and the other would be true when it is TRUE)

For example : There is an algorithm based on Monte-Carlo of prime number test that can verify if a number "n" is prime or not. If the answer is FALSE, then "n" is not a prime number (it's a compound number). However, if the answer were TRUE, then "n" COULD be primordial (with some probability). As far as I know, there is no efficient algorithm (Monte-Carlo) able to say with certainty if "n" is a prime number.

## c ++ – Fill a hand with random cards that are not yet stolen – Monte Carlo

I would like to know if there is a more efficient way to accelerate below the code. This function is intended to complete a poker hand game with the rest
Cards with Mersenne Twister for a Monte Carlo simulation.

``````void HandEvaluator :: RandomFill (std :: vector <std :: shared_ptr> & _Set, std :: vector <std :: shared_ptr> & _Dead, unsigned int _Target) {
// Add the cards that are currently in Set as dead cards
for (auto const and CardInSet: _Set)
{
if (CardInSet == nullptr)
break;

}

unsigned int RequiredAmt = _Target - _Set.size ();

unsigned int CardIndex = 0;
std :: uniform_int_distribution Distribution Cards (0, 51);

for (unsigned int Index = 0; Index < RequiredAmt; Index++)
{
while (true)
{
CardIndex = CardsDistribution(MTGenerator);

{
if (ReferenceDeck[CardIndex]->GetRank () == Dead-> GetRank () && ReferenceDeck[CardIndex]-> GetSuit () == Dead-> GetSuit ())
{
break;
}
}

{
_Set.push_back (ReferenceDeck[CardIndex]);
break;
}
}
}
}
``````

The Visual Studio Profiler had identified that this line

``````                CardIndex = CardsDistribution (MTGenerator);
``````

It is the main culprit of the high computing time. Is Mersenne Twister itself not intended for a Monte Carlo simulation and, instead, should another PRNG be used? Or are there some inefficient lines that I had missed?