Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

need to write in python spyder The binomial coefficient (?) is an integer equal to nx (n-1) x (n -2) x x (n -k+1) when

image text in transcribedneed to write in python spyder

The binomial coefficient (?) is an integer equal to nx (n-1) x (n -2) x x (n -k+1) when k > 1, or (0) = 1 when k-0. a) Using this form for the binomial coefficient, write a user-defined function binomial(n,k) that calculates the binomial coefficient for given n and k. Make sure your function returns the answer in the form of an integer (not a float) and gives the correct value of 1 for the case where k0. b) Using your function write a program to print out the first 20 lines of "Pascal's triangle." The nth line of Pascal's triangle contains n +1 numbers, which are the coefficients (0), (1), and so on up to (z). Thus the first few lines are 121 1331 14641 c) The probability that an unbiased coin, tossed n times, will come up heads k times is ()/2". Write a program to calculate (a) the total probability that a coin tossed 100 times comes up heads exactly 60 times, and (b) the probability that it comes up heads 60 or more times

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Hands-On Database

Authors: Steve Conger

2nd Edition

0133024415, 978-0133024418

More Books

Students also viewed these Databases questions