Plotting functions and coordinates, Mathematica

Click For Summary
SUMMARY

This discussion focuses on plotting functions and coordinates in Mathematica, specifically using the Show function to overlay a probability function with Monte Carlo simulation results. The user demonstrates how to plot a quadratic function alongside a list of points using the Plot and ListPlot functions, providing a sample code snippet. Additionally, the conversation touches on the effectiveness of different programming languages in generating pseudo-random numbers, highlighting the simplicity of software-generated numbers compared to hardware solutions.

PREREQUISITES
  • Familiarity with Mathematica's plotting functions, specifically Plot and ListPlot
  • Understanding of the Show function for combining graphics
  • Basic knowledge of Monte Carlo methods for simulations
  • Awareness of random number generation techniques in programming
NEXT STEPS
  • Explore advanced features of Show in Mathematica for complex visualizations
  • Learn about Monte Carlo simulations and their applications in probability
  • Investigate different random number generation algorithms across programming languages
  • Research hardware random number generators and their effectiveness compared to software methods
USEFUL FOR

This discussion is beneficial for data scientists, mathematicians, and developers using Mathematica for visualizing data and simulations, as well as anyone interested in random number generation techniques.

freefaller
Messages
10
Reaction score
0
Hi all.

Is there a way to plot both functions and coordinates/points on the same graph in Mathematica? The various functions for plotting each seem very incompatible. I would like to compare a probability function to Monte-Carlo-method simulation results.

Also, out of curiosity, do different programming languages have "better" pseudo-random number generation techniques or does it not really make a difference?

Thank you.
 
Physics news on Phys.org
data = Table[{x, x^2}, {x, 0, 2}];
Show[
Plot[x^2, {x, 0, 2}],
ListPlot[data],
Graphics[Text["(1,1)", {1, 1}, {-1, 0}]]
]

will show a graph, points and a coordinate.
If you need to you can change point size, color, background, dashing and a thousand other visual effects.

There are expensive hardware random number generators you can buy.

I've wanted someone to think of a cheap hardware hack that would generate a few random bits a second from the radioactive decay of a smoke detector, but I haven't found anyone interested in doing that.
 
Thanks Bill! It works nicely.

I'm self-taught so I ignored Show[]'s existence. Now I know.

That's an interesting hack, although I guess for most purposes computer-generated numbers work fine ... and are simpler to obtain.

Thanks again
 

Similar threads

  • · Replies 6 ·
Replies
6
Views
2K
  • · Replies 13 ·
Replies
13
Views
2K
  • · Replies 3 ·
Replies
3
Views
2K
  • · Replies 2 ·
Replies
2
Views
3K
  • · Replies 3 ·
Replies
3
Views
4K
  • · Replies 3 ·
Replies
3
Views
9K
  • · Replies 1 ·
Replies
1
Views
3K
  • · Replies 5 ·
Replies
5
Views
3K
  • · Replies 8 ·
Replies
8
Views
3K
  • · Replies 1 ·
Replies
1
Views
5K