4 ms·
If X1...Xn are independently uniformly distributed between 0 and 1 then: P(max(X1 ... Xn) < x) = P(X1 < x and X2 < x ... and Xn < x) = P(X1 < x) P(X2 < x) ..
by prof-dr-ir 2y ago
If X1...Xn are independently uniformly distributed between 0 and 1 then:
P(max(X1 ... Xn) < x) =
P(X1 < x and X2 < x ... and Xn < x) =
P(X1 < x) P(X2 < x) ... P(Xn < x) =
x^n
Also,
P(X^{1/n} < x) = P(X < x^n) = x^n
I guess I am just an old man yelling at clouds, but it seems so strange to me that one would bother checking this with a numerical simulation. Is this a common way to think about, or teach, mathematics to computer scientists?
- coliveira 2y ago> it seems so strange to me that one would bother checking this with a numerical simulation I believe that some people know programming but have little experience with mathematics, so the first thing they'll think about is to "check" numerically that something is true. Which in reality doesn't prove anything, so people should better spend the time to learn some math for these situations.
- ValentinA23 2y ago"you can't learn maths on your own, you need a master" My math teacher during my second year in university, who also happened to be a chaos theorist working on cool stuff such as cryptography via chaos synchronization. He was by far the worst teacher I ever had in terms of mental calculation abilities, but he was also the more advanced. I remember a conversation where he explained how he would always implement his algorithms at least twice, on entirely different software and hardware stacks.
- mistercow 2y agoI have, on many occasions, thought that I had an analytical solution to a problem pinned down, then checked it numerically and found that I'd made a mistake. It seems weird that there's any hostility towards a perfectly useful tool for checking your work.
- monadINtop 2y agoNot the person you're replying to but I would assume their point was to highlight the distinguishing feature of mathematics - the fact that it's not only possible to completely prove something to be true, but in fact is the only thing you can actually do (yes I know about experimental math etc). But yeah that doesn't necessarily mean anything for pedagogy or just having fun and so on.
- mistercow 2y agoThe thing is, it’s only possible to “completely prove something to be true” in math contingent on your accurate interpretation of the steps of the proof and of its outcome. The proof as a platonic ideal is infallible, but in reality, it gets fed into a fallible meat computer, and in practice, even very smart and careful people do make mistakes, often at the individual level, but sometimes as an entire community. Two famous examples were apparent proofs of the four color theorem in the late 19th century, each of which were widely accepted for over a decade before being shown incorrect. We have better tools nowadays, obviously, but these still only increase confidence, which is exactly what running simulations does.
- DoctorOetker 2y agofair enough, hence the upvote, but then again, a formal verifier would refuse to follow the erroneous step in your derivation...
- Vinosawd 2y agoSimilarly, P(min{X1, X2, ..., Xn} < x) = P(X1<x or X2<x ... or Xn < x) = P(not(not(X1 < x) and not(X2 < x) ... and not(Xn < x))) = 1-P(not(X1 < x) and not(X2 < x) ... and not(Xn < x)) = 1-P(not(X1 < x))⋅P(not(X2 < x)) ... ⋅P(not(Xn < x)) = 1-(1-P(X1 < x))⋅(1-P(X2 < x)) ... ⋅(1-P(Xn < x)) = 1-(1-x)^n which curve, in the [0, 1]^2 square, is just x^n rotated around (1/2; 1/2) by 180 degrees.
- cowsandmilk 2y agoAs a mathematician, one of the first programs I wrote was to numerically calculate pi by random number generation in a box and seeing percentage of points that were in the circle. It was a fun introduction to programming. So, I found it to be the opposite, numerical simulations were a way to teach mathematicians programming.
- tedunangst 2y agoSimulations can give answers to problems that don't have analytical solutions, and it eliminates one step from the decision tree.
- Gunax 2y agoThanks! This is helpful.
- mturmon 2y agoI think OP just kind of enjoys these little simulations. It’s rewarding (to some) to see mathematical predictions actually work out. As a probability nerd myself, I was yelling at my browser for him to take the difference between the true CDF and the empirical CDF. I.e., not just the plot where “analysis” CDF overlaps empirical CDF, but the difference between the two, scaled up by some number…say, the square root of the number of samples? ;-) Then we would have a realization of a discretized Brownian bridge, a kind of rescaled Brownian motion. And then we could have all kinds of fun looking at where the maximum difference falls (it will usually not be near the endpoints), and the size of the set adjacent to the maximum, and the local behavior of the process around the maximum (it’s expectation should be “cusped”, not smooth, although other processes will be smooth there). Some of those topics are really rather advanced, and they are all accessible by simulation if you follow your nose.
- mistercow 2y agoThe point of running numerical simulations is that when they come out wrong, you learn something. If you simulate this, for example, and get a different answer, you’ve learned that you’ve misunderstood the claim. In other cases, a numerical simulation giving a wrong answer can quickly tell you that your apparently valid reasoning contains a mistake. That’s really useful, because subtle reasoning errors are really easy to make, and math is full of fun false proofs. A wrong simulation is strong evidence that you’ve misunderstood something, and so by necessity, a correct simulation is (weaker) evidence that you’ve understood correctly.