RUVIDEO
Поделитесь видео 🙏

Learn Python in Malayalam|Chapter 16 | Probability in Python | Coin toss problem | absolute error

Learn Python in Malayalam|Chapter 16|Probaility in Python| Coin toss problem

This is the 16th video on Learn python in Malayalam. This video clearly explains below topics,
use the below time link to skip to the specific topics

Topics covered in this video
Coin toss program - 00:23
calculating probability - 04:57
plotting absolute error plotting -- 07:53

Program used
# Program for coin toss
import random
def coinToss(number): # defining the function for coin toss
recordList= [] # multiple assignment
for i in range(number): # do this 'number' amount of times
flip = random.randint(0, 1)
if (flip == 0): # here if condition is not neccessory
# print("Heads")
recordList.append(1)
else:
# print("Tails")
recordList.append(0)
print("Coin Toss result is :",str(recordList))
print("No of Heads :",recordList.count(1), "No of Tails :",recordList.count(0))

coinToss(10) # calling the function with 10 flips


# program for calculating probability of coin toss
import random
import matplotlib.pyplot as plt
N = 50
ab_errList = []
recordList= []

for i in range(N): # do this 'number' amount of times
flip = random.randint(0, 1)
if (flip == 0):
# print("Heads")
recordList.append(1)
else:
# print("Tails")
recordList.append(0)
# print("Coin Toss result is :",str(recordList))
print("Value of N is :",N)
print("No of Heads :",recordList.count(1), "No of Tails :",recordList.count(0))
Prob_H = (recordList.count(1))/N
Prob_T = (recordList.count(0))/N
print("Probability of Head is :",Prob_H)
print("Probability of Tail is :",Prob_T)
ab_err = 0.5 - Prob_H
print("Absolute error :",round(ab_err,3))
print("")
ab_errList.append(round(ab_err,3))

# Program for plotting absolute error of coin toss
import random
import matplotlib.pyplot as plt
N = [10, 100, 500,1000,5000,10000,50000]
ab_errList = []
for j in N:
recordList= []

for i in range(j): # do this 'number' amount of times
flip = random.randint(0, 1)
if (flip == 0):
# print("Heads")
recordList.append(1)
else:
# print("Tails")
recordList.append(0)
# print("Coin Toss result is :",str(recordList))
print("Value of N is :",j)
print("No of Heads :",recordList.count(1), "No of Tails :",recordList.count(0))
Prob_H = (recordList.count(1))/j
Prob_T = (recordList.count(0))/j
print("Probability of Head is :",Prob_H)
print("Probability of Tail is :",Prob_T)
ab_err = 0.5 - Prob_H
print("Absolute error :",round(ab_err,3))
print("")
ab_errList.append(round(ab_err,3))

print(ab_errList)
plt.plot(N,ab_errList)
plt.title("N vs Absolute error")
plt.xlabel("N")
plt.ylabel("Absolute error")
plt.show()

For more details check out here : https://iammanuprasad.blogspot.com/

Learn Python in Malayalam Playlist:
https://www.youtube.com/playlist?list=PLmKq-kgKY8uZya3cwcX6otT61NPHXbTK0

Chapter 1 - https://youtu.be/WiyQ8wTsRO0
Introduction to programming
Introduction to Python
Introduction to Google Co-lab
How to setup Google Co-lab

Chapter 2 - https://youtu.be/YFngtW42Mls
Python Identifiers
Lines and Indentation
Multi-Line Statements

Chapter 3 - https://youtu.be/gxalG8Aps0A
Quotation in python
Comments in python
Assigning values to variable

Chapter 4 - https://youtu.be/AaEL_f2RHIk
Data types
Numbers
Strings

Chapter 5 - https://youtu.be/irND35-6BZ0
Data types
Lists
Tuple
Dictionary

Chapter 6 - https://youtu.be/MRfg2QZBHvE
Decision making

Chapter 7 - https://youtu.be/VYXndepcTCM
Loops in Python

Chapter 8 - https://youtu.be/d7Y2D9H4u7c
Functions in python

Chapter 9 - https://youtu.be/hFOTKyYCkdw
Classes in python

Chapter 10 - https://youtu.be/w-_x2vfpJk0
Matrix in python

Chapter 11 - https://youtu.be/-7DB7OEenms
Plotting in Python

Chapter 12 - https://youtu.be/aID_Dlx-oys
File handling in python

Chapter 13 - https://youtu.be/zk6Fcs-NY6I
System linear equation solution
Example with explanation
Program for solving linear equation

Chapter 14 - https://youtu.be/7k5oATBKrd8
differentiation in python
power rule
product rule
multi-variable function
first order differential equation response

Chapter 15 - https://youtu.be/BoEPyohAvtI
integration in python
integration with double integral
integration with triple integral
integration with infinity limit


If you like my video please subscribe my channel and share

Important links & key words

https://www.python.org/
Google COLAB

Music: https://www.bensound.com
Reff : https://www.tutorialspoint.com/python/python_variable_types.htm
https://www.w3schools.com/
https://towardsdatascience.com/taking-derivatives-in-python-d6229ba72c64

ECL 201 SCIENTIFIC COMPUTING LABORATORY
Experiment 9: Coin Toss and the Level Crossing Problem

Что делает видео по-настоящему запоминающимся? Наверное, та самая атмосфера, которая заставляет забыть о времени. Когда вы заходите на RUVIDEO, чтобы посмотреть онлайн «Learn Python in Malayalam|Chapter 16 | Probability in Python | Coin toss problem | absolute error», вы рассчитываете на нечто большее, чем просто загрузку плеера. И мы это понимаем. Контент такого уровня заслуживает того, чтобы его смотрели в HD 1080, без дрожания картинки и бесконечного буферизации.

Честно говоря, Rutube сегодня — это кладезь уникальных находок, которые часто теряются в общем шуме. Мы же вытаскиваем на поверхность самое интересное. Будь то динамичный экшн, глубокий разбор темы от любимого автора или просто уютное видео для настроения — всё это доступно здесь бесплатно и без лишних формальностей. Никаких «заполните анкету, чтобы продолжить». Только вы, ваш экран и качественный поток.

Если вас зацепило это видео, не забудьте взглянуть на похожие материалы в блоке справа. Мы откалибровали наши алгоритмы так, чтобы они подбирали контент не просто «по тегам», а по настроению и смыслу. Ведь в конечном итоге, онлайн-кинотеатр — это не склад файлов, а место, где каждый вечер можно найти свою историю. Приятного вам отдыха на RUVIDEO!

Видео взято из открытых источников Rutube. Если вы правообладатель, обратитесь к первоисточнику.