I have a degree in Mathematics and Physics from the Danish University Aarhus, comparable to a masters degree with thesis - majoring in Mathematics. In 1991-92 I was a visting scholar at UCLA, Los Angeles, following graduate courses in Applied Mathematics. Since 1992 I have been a teacher in a high school (gymnasium) in Denmark. Special interests: Applied mathematics, graphics and popularizing Mathematics.

MaplePrimes Activity

These are replies submitted by erik10

@tomleslie Yes it works that way, but still is using the properties of the normal distribution, i. e. the mean can be put "outside" which makes it possible to accomplish the job by just creating one single sample. Maybe I have confused the situation by connecting my more general question to this specific problem, which can be solved more easily. I think I will close my question here and get back if I later stumble upon a situation where this shortcut is not possible. 


Thanks to both of you, Carl Love and Acer. Very valuable information indeed.


@Daniel Skoog Thanks for the information, Daniel. 

@Kitonum Thanks a lot, Kitonum. I appreciate it!



@Carl Love Indeed very compact. Just what I was looking for. Thanks a lot!


@acer For the sake of completeness in this specific situation it would however be appropriate to have all possible values of X listed. Obviously the difference only show up for small sample sizes, where a frequency might turn out to be 0. 

@acer Thanks to both of you. It is also apparent that when choosing big samples, your code is qite a lot faster!


@acer In addition to your fine histograms, I wanted to calculate the actual sample frequencies. With your list M of possible values for the Random Variable X I did it this way:

Isn't there an even more simple way of doing it? I mean I was surprised not to be able to find a command in the Statistics package which could give the frequencies of a list of numbers right away. Maybe I overlooked something?


@mmcdara Very illustrative indeed!!

@acer Big thanks to you and mmcdara for a splendid work! It has certainly helped my investigations in the department of Random Variables. I guess it isn't possible to easily calculate the probability distributions of Random Variables built on other Random Variables in general. The possibilities are simply too complex. In the case of finite Sample Space you have however shown a way to search or go through all possible outcomes and that way get to the probability distribution. I think I am empty for more questions at the moment :)

@acer Your way of making an animation was indeed ingenious. So now my questions regarding samples are settled. 

I am still working on building intuition in relation to how Maple handles Random Variables. Beside being able to calculate Mean and Variance, I am interested in calculating probablities (including cumulative ones - CDF). In the present example with the player against the banker I cannot make it work. I receive a FAIL. I guess it happens because it is necessary to "invert the problem" internally and that Maple isn't capable of doing so - directly at least. In the following let X equal the profit in one play, viewed from the Players viewpoint. Manually one need to ask: What are the possible combinations of dice, which will yield the value 3 for X? The answer is (2,5), (3,6), (5,2) and (6,3). Each with probability 1/36, so the correct answer is 4/36. But Maple can't do it directly. Is there a smart non-ad hoc way to make problems like this work? (one which doesn't require the user to know the answer beforehand). I tried the technique with the old Random Variable Y = Dice1+Dice2, and it works! But here Maple doesn't need to do "back-tracking" in order to compute the probabilities ...



Best regards,



@acer That was impressing! I will have to look into that one tomorrow. Thanks a lot!


@mmcdara This is indeed nice. Thank you!

@tomleslie Yes one need to be careful about algebraic expressions involving those calls for random draws :)

Now that histograms for samples of the Random Variable connected to the Player/banker (call it X) is established, I was looking for a way to define or create the Random Variable X in Maple in the hope Maple could itself calculate the theoretical Mean and Variance (not for a sample). I looked at the commands Distribution and RandomVariable in the Statistics package. The few examples in the Help menu didn't help me much, though. Maybe it is not something one should do here?


@tomleslie Certainly I was aware of the reason why my command failed. Nice solution by defining the piecewise function first and then inserting Dice1() and Dice2() in order for the piecewise command to use the same draw in the entire command. 

Interesting what Carl Love tells below, by the way!


1 2 3 4 5 6 7 Last Page 1 of 15