Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- p = var('p')
- h(x) = 1-(1-p)**x
- g = sage.plot.graphics.Graphics()
- g += plot(h(x).subs(p=0.2), x, 1, 10, color='green', xmin=1, legend_label='$p=0.2$')
- g += plot(h(x).subs(p=0.5), x, 1, 10, color='blue', xmin=1, legend_label='$p=0.5$')
- g += plot(h(x).subs(p=0.8), x, 1, 10, color='red', xmin=1, legend_label='$p=0.8$')
- for i in range(1, 10+1):
- g += point2d((i, h(i).subs(p=0.2)), color='green')
- g += point2d((i, h(i).subs(p=0.5)), color='blue')
- g += point2d((i, h(i).subs(p=0.8)), color='red')
- g.save('geometric.svg')
- g.show()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement