Timeline for Python implementation of a Galton board simulation
Current License: CC BY-SA 4.0
15 events
when toggle format | what | by | license | comment | |
---|---|---|---|---|---|
Apr 27, 2022 at 15:39 | vote | accept | Schmuddi | ||
Apr 27, 2022 at 15:39 | comment | added | Schmuddi |
This answer contains two suggestions that I consider clear improvements: (1) separation of plotting from simulating (I admit that I was too lazy for that), (2) use of choice instead of randint which is probably more readable, and also a bit faster. I can also see how replacing the random functions by homegrown functions would be useful for testing, but I'd be hesitant to add them as arguments to the public interface of the class initializer. I'm not a fan of Fraction for this task, though – I'd rather switch to integers and integer division to avoid rounding issues.
|
|
Apr 25, 2022 at 14:00 | comment | added | Reinderien | Whether or not they're auto-notified (I don't remember), the safest policy is to @ them in the comments and describe the change. | |
Apr 25, 2022 at 13:52 | comment | added | Arpad Horvath | @Reinderien I don't know the best practices of this stackexchange page. I'm used to the normal stackoverflow style. I just need to add new thoughts any time I have one as UPDATE1, UPDATE2, ...? But how will the author now when is it an update? He won't be notified if I change the answer, right? | |
Apr 25, 2022 at 13:45 | history | edited | Arpad Horvath | CC BY-SA 4.0 |
added 2 characters in body
|
Apr 25, 2022 at 13:10 | history | edited | Reinderien | CC BY-SA 4.0 |
added 1 character in body
|
Apr 25, 2022 at 13:09 | comment | added | Reinderien | The Q&A value of this answer is diminshed if you don't also carry over verbatim your suggested code from Github. | |
Apr 25, 2022 at 12:25 | history | edited | Arpad Horvath | CC BY-SA 4.0 |
updating answer
|
Apr 23, 2022 at 18:01 | comment | added | Arpad Horvath | @Schmuddi Ok. It seems to be uniform. At leastfor 3 and 4 bins, if we start from each position with the same probabilities, after 2 rows the possibilities will be the same for each bin. And of course it stays true for arbitrary many row pairs. | |
S Apr 23, 2022 at 15:42 | history | suggested | Schmuddi | CC BY-SA 4.0 |
small copy-editing
|
Apr 23, 2022 at 15:39 | comment | added | Arpad Horvath | @Schmuddi I extended the answer without warning. And I'm still not convinced that it is exactly uniform. Actually I like this puzzle, If I have some time, I might think it through. I would start with just 1 or 2 row pairs. | |
Apr 23, 2022 at 15:37 | review | Suggested edits | |||
S Apr 23, 2022 at 15:42 | |||||
Apr 23, 2022 at 15:34 | history | edited | Arpad Horvath | CC BY-SA 4.0 |
Two random functions
|
Apr 23, 2022 at 15:33 | comment | added | Schmuddi |
While I think that this is the right way to handle boundary cases, the position -= d * 2 line is actually that part of the code where I'm wondering most about the formal correctness of my code. For what it's worth, running the simulation with 10,000,000 beads doesn't suggest any deviation from uniformity. The two most extreme bins don't show a lower frequency than their immediate neighbors, which suggests to me that the position -= d * 2 doesn't break uniformity after all.
|
|
Apr 23, 2022 at 15:18 | history | answered | Arpad Horvath | CC BY-SA 4.0 |