Mryeetmemes

Code that solves P(3, 2)

Apr 11th, 2024
503
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.27 KB | Source Code | 0 0
  1. import numpy as np
  2.  
  3. # Define P(3, 2) function
  4. def p(n, r):
  5.     # Calculate the binomial coefficient
  6.     binomial_coefficient = np.math.comb(n, r)
  7.  
  8.     # Return the binomial coefficient
  9.     return binomial_coefficient
  10.  
  11. # Print the value of P(3, 2)
  12. print(p(3, 2))
Advertisement
Add Comment
Please, Sign In to add comment