top of page

Python Assignments

1) DESCRIPTION

80% of people who purchase car insurance are men. If the owners of 9 car insurance are randomly selected, then find the probability using binomial distribution that exactly X out of them are men

  • Read a number X from a line of input

  • Print the output rounded till 4 decimal point

Example:


Sample Input:

6

Sample Output:

0.1762

2) DESCRIPTION

 If the probability of a profit or loss in an investment is equal, find the probability using geometric distribution that an investor’s k investment is his first profit

  • Take input from the user k

  • Print the ouput and round up the output till three decimal points


Example:

Sample Input:

4

Sample Output:

0.062

3) DESCRIPTION

Conditional Probability

  • The probability of an event which is conditioned or dependent on another event is a Conditional Probability

  • Conditional Probability = P(A|B) = P(A and B)/P(B) 

  • P(A|B) is the probability of event A occurring, given that event B occurs


You have the Member dataset, which is an input data file Members.csv present at the

location /data/training/blackfriday.csv


This dataset contains information about information related to the people . Here’s a brief description of the columns in the sample dataset



Dataset Description:


The dataset contains data of 8 rows and 4 different columns. The columns are:


Gender: whether the particular person is male of female

Height: Height of the person

Weight: Weight of the person

Foot-size: Foot-size of the person


This is a preview of the data under consideration:


Question:

Calculate the probability of members height being more than 5 inches, given that member is female


Input Format:

 The file to be read will be Members.csv, which contains the data as mentioned above. This file is in .csv format.


Example:

Sample Input:

https://media-doselect.com/Members.csv

Sample Output:

0.52

34 views0 comments
bottom of page