<｜begin▁of▁sentence｜>### Instruction:
Given the parameters N=10 (total number of nodes), n=3 (initial clique size), p=0.5 (probability to connect to each neighbor), and q=0.2 (probability to connect to the source node), how can you generate a random graph using the partial duplication model as described in NetworkX?
### Response:
import networkx as nx

# Using the partial duplication model to create a random graph
N = 10  # Total number of nodes
n = 3   # Number of nodes in the initial clique
p = 0.5 # Probability of joining each neighbor of a node to the duplicate node
q = 0.2 # Probability of joining the source node to the duplicate node

# Create the random graph
random_graph = nx.partial_duplication_graph(N, n, p, q, seed=42)

# Draw the graph
import matplotlib.pyplot as plt
nx.draw(random_graph, with_labels=True)
plt.show()
<|EOT|>
