<｜begin▁of▁sentence｜>### Instruction:
Suppose we want to simulate a small-world phenomenon with a simple random graph model. We have 10 individuals and there is a 50% chance that any two individuals know each other. How can we generate and visualize such a random network?
### Response:
import networkx as nx
import matplotlib.pyplot as plt

# Use the erdos_renyi_graph API to generate a random graph
# n is the number of nodes, p is the probability of edge creation
G = nx.erdos_renyi_graph(n=10, p=0.5, seed=42)

# Draw the graph
nx.draw(G, with_labels=True)
plt.show()
<|EOT|>
