CS计算机代考程序代写 Practice Question

Practice Question
Let’s now assume that the customers can be divded into 3 segments
• segment 1 (p=0.4): Poisson(1)
• segment 2 (p=0.4): Poisson(3)
• segment 3 (p=0.2): Poisson(5)
Generate the number of clicks for 2000 customers.
In [4]:
import numpy as np
def composition():
u=np.random.rand()
p1=0.4
p2=0.4
if u