Advertisement
anechka_ne_plach

Untitled

Oct 2nd, 2023
1,182
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.65 KB | None | 0 0
  1.         bin_1_val = np.repeat(np.arange(0, a_max + 1)[None, :], (a_max - a_min + 1), axis=0)
  2.         bin_1_ns = np.arange(a_min, a_max + 1)
  3.         bin_1_ps = np.full_like(np.zeros((a_max - a_min + 1, 1)), p1)
  4.         bin_1_prob = binom.pmf(bin_1_val, bin_1_ns[:, None], bin_1_ps)
  5.  
  6.         bin_2_val = np.repeat(np.arange(0, b_max + 1)[None, :], (b_max - b_min + 1), axis=0)
  7.         bin_2_ns = np.arange(b_min, b_max + 1)
  8.         bin_2_ps = np.full_like(np.zeros((b_max - b_min + 1, 1)), p2)
  9.         bin_2_prob = binom.pmf(bin_2_val, bin_2_ns[:, None], bin_2_ps)
  10.  
  11.         c_probs = scipy.signal.convolve(bin_1_prob[:, :, None], bin_2_prob[:, None, :])
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement