# ---
# jupyter:
#   jupytext:
#     text_representation:
#       extension: .r
#       format_name: light
#       format_version: '1.5'
#       jupytext_version: 1.14.4
#   kernelspec:
#     display_name: R
#     language: R
#     name: ir
# ---

# # Normal Distribution

# Creating a sequence of numbers between -1 and 20 incrementing by 0.2.  
x <- seq(-1, 20, by = .2)  
# Choosing the mean as 5.0 and standard deviation as 0.5.  
y <- dnorm(x, mean = 5.0, sd = 0.5)   
#Plotting the graph  
plot(x,y)  

# Creating a sequence of numbers between -1 and 20 incrementing by 0.2.  
x <- seq(-1, 20, by = .1)  
# Choosing the mean as 2.0 and standard deviation as 0.5.  
y <- pnorm(x, mean = 2.0, sd = 0.5)  
#Plotting the graph  
plot(x,y)  

# Creating a sequence of numbers between -1 and 20 incrementing by 0.2.  
x <- seq(0, 1, by = .01)  
# Choosing the mean as 2.0 and standard deviation as 0.5.  
y <- qnorm(x, mean = 2.0, sd = 0.5)   
#Plotting the graph  
plot(y,x)  

# Creating a sequence of numbers between -1 and 20 incrementing by 0.2.  
x <- rnorm(1500, mean=80,  sd=15 )    
#Creating histogram  
hist(x,probability =TRUE,col="red",border="black")  

# # Binomial Distribution

# Creating a sample of 100 numbers which are incremented by 1.5.  
x <- seq(0,100,by = 1)  
# Creating the binomial distribution.  
y <- dbinom(x,50,0.5)  
# Plotting the graph.  
plot(x,y) 

# Probability of getting 20 or fewer heads from 48 tosses of a coin.  
x <- pbinom(20,48,0.5)  
#Showing output  
print(x)  

# Finding random values    
x <- rbinom(100,160,0.8)  
#Showing output  
print(x)  



StarcoderdataJupyterScriptsDedupFiltered