- Read, modify, and print the elements of lists, tuples, sets and dictionaries. Find out the differences among them.
- Given a list lst1=[1,2,3,4,5]. Write a program to copy the list lst1 to another list lst2, and then multiply each element in lst2 with 2. Print lst1 and lst2. (Answer should be lst1=[1,2,3,4,5] and lst2=[2,4,6,8,10])
- Write a python program to find a largest and smallest element in a given list. Suppose list contains the numbers [5,2,8,9,15,3,22,7].
- Write a python program to print prime numbers in a given range. Suppose given range is 10 to 20, the answer would be 11,13,17,19.
- Write a python program to find lcm and gcd of any two given numbers.
- Write a program to read an english sentence and count the frequency of occurance of each alphabet in the sentence. For example given a sentence : Rama is a good boy. Output: a:3, b:1, d:1, g:1, i:1, m:1, o:3, r:1, s:1, y:1
Implement and plot the following probability distributions in python programming language.
• Binomial distribution
Example you should use to solve:
The Stanley Cup playoff in professional hockey is a seven-game series,
where the first team to win four games is declared the champion.
The series, then, can last anywhere from four to seven games
(just like the World Series in baseball). Calculate the likelihoods that
the series will last four, five, six, or seven games.
Assume that (1) each game is an independent event and (2) the two teams
are evenly matched.
• Uniform distribution
• Normal distribution or Gaussian distribution
• Gamma distribution
• Poisson distribution
Example
A medical study recently documented that 905 mistakes were made among the
289,411 prescriptions written during one year at a large metropolitan
teaching hospital. Suppose a patient is admitted with a condition serious
enough to warrant 10 different prescriptions. Approximate the probability
that at least one will contain an error.
• Exponential distribution
• Bernoulli Distribution