How to solve the Monty Hall problem?
Change Opacity along a ListLinePlot
Use Cases with empty cells in the list
Writing compiled functions as fast as Python's Numba
Why are more highly nested lists often not more memory and time-intensive?
Correcting the Color Scale of a MatrixPlot
Verify an inequality of many parameters
How to solve the Monty Hall problem? https://mathematica.stackexchange.com/landing/r/digest?cta=question&id=225238
Problem For purely recreational purposes I would like to solve the Monty Hall problem with Mathematica using the function Probability (dedicated to the calculation of probabilities). About the Monty ... [probability-or-statistics] [symbolic] [syntax]
asked by mlpo https://mathematica.stackexchange.com/landing/r/digest?cta=user&id=11155 12 votes answered by Sjoerd Smit https://mathematica.stackexchange.com/landing/r/digest?cta=user&id=43522
16 votes Change Opacity along a ListLinePlot https://mathematica.stackexchange.com/landing/r/digest?cta=question&id=225337
I'm trying to change the opacity of a line in a ListLinePlot for increasing x-value. E.g. the line should have opacity 1 at beginning and shade than down to opacity along the line. I want to take the ... [plotting] [color] [opacity]
asked by piolio https://mathematica.stackexchange.com/landing/r/digest?cta=user&id=73660 10
votes answered by C. E. https://mathematica.stackexchange.com/landing/r/digest?cta=user&id=731
8 votes Use Cases with empty cells in the list https://mathematica.stackexchange.com/landing/r/digest?cta=question&id=225360
I work with a complex dataset. The most simple form of this list looks like: dat1 = {{a, b, c, {}}, {d, e, f, {1}}, {h, i, j, {2}}} I want to select the nested {} part. Cases[dat1, {___, {a_}} :> ... [list-manipulation] [filtering]
asked by Michiel van Mens https://mathematica.stackexchange.com/landing/r/digest?cta=user&id=9590
9 votes answered by flinty https://mathematica.stackexchange.com/landing/r/digest?cta=user&id=72682
9 votes Writing compiled functions as fast as Python's Numba https://mathematica.stackexchange.com/landing/r/digest?cta=question&id=225277
I want to write some code to simulate a damped oscillator that is just as fast as code written using Numba's @njit decorator. I've written the mathematica code and mine is 20-40x slower than the ... [performance-tuning] [compile] [simulation]
asked by Diffycue https://mathematica.stackexchange.com/landing/r/digest?cta=user&id=46327 9
votes answered by xzczd https://mathematica.stackexchange.com/landing/r/digest?cta=user&id=1871
16 votes Why are more highly nested lists often not more memory and time-intensive?
https://mathematica.stackexchange.com/landing/r/digest?cta=question&id=225540
I would expect more highly nested lists, being deeper and more complex than flatter lists, to take up more space (bytecount) and take more time and memory to operate on in general. Consider the ... [list-manipulation] [functions] [performance-tuning] [programming] [memory]
asked by Just Some Old Man https://mathematica.stackexchange.com/landing/r/digest?cta=user&id=12697 7 votes
answered by Henrik Schumacher https://mathematica.stackexchange.com/landing/r/digest?cta=user&id=38178
10 votes Correcting the Color Scale of a MatrixPlot https://mathematica.stackexchange.com/landing/r/digest?cta=question&id=225186
I did a MatrixPlot of a set of values that range between 0 and 1. I got the following first plot with no problems: As we can see from the legend, the values range between 0 and 1. Now, I am doing ... [plotting] [matrix] [legending]
asked by Naps https://mathematica.stackexchange.com/landing/r/digest?cta=user&id=73570 7 votes answered by C. E. https://mathematica.stackexchange.com/landing/r/digest?cta=user&id=731
5 votes Verify an inequality of many parameters https://mathematica.stackexchange.com/landing/r/digest?cta=question&id=225380
I've got an inequality of 10 non-negative parameters (arising from a 5x5 matrix) and would like to verify whether it holds. I tried the following, which doesn't seem to work: con = Thread[ {(k + ... [equation-solving] [matrix] [inequalities] [parameters] [resolve]
asked by Vicky https://mathematica.stackexchange.com/landing/r/digest?cta=user&id=73675 6 votes
answered by flinty https://mathematica.stackexchange.com/landing/r/digest?cta=user&id=72682
4 votes