![]() |
Complex Program with matplotlib - Python Challenge - Printable Version +- Python Forum (https://python-forum.io) +-- Forum: Python Coding (https://python-forum.io/forum-7.html) +--- Forum: General Coding Help (https://python-forum.io/forum-8.html) +--- Thread: Complex Program with matplotlib - Python Challenge (/thread-9427.html) |
Complex Program with matplotlib - Python Challenge - maggie_b - Apr-08-2018 I had this on my programming exam last week. I still don't get desired outcome. ![]() How would you solve it? 1 Randomly generate 10^4 points (x_i, y_i) where x_i and y_i are uniformly distributed on interval [-1,1]. 2 Figure out: How many of these points are inside uniform circle M and calculate ratio R=4M/N. 3 In created script.py repeat this for different seeds (of a generator). 4 Export your file into file.dat in which there has to be two columns- seed and R. 5 In the same script show (for one random seed) earlier generated points: Points inside uniform circle are coloured red and outside ones are coloured blue. 6 Nicely arrange the result with added legend. 7 Export the graph into file graph.pdf. Hint: use Matplotlib for points 5, and 6. RE: Complex Program with matplotlib - Python Challenge - Larz60+ - Apr-08-2018 please show the code that's not working so we can point out where changes should be made. |