User Tools

Site Tools


b:head_first_statistics:geometric_binomial_and_poisson_distributions

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
b:head_first_statistics:geometric_binomial_and_poisson_distributions [2025/10/06 23:40] – [e.g.,] hkimscilb:head_first_statistics:geometric_binomial_and_poisson_distributions [2025/10/06 23:43] (current) – [e.g.,] hkimscil
Line 1022: Line 1022:
 > </code> > </code>
  
-Q. 한 문제를 맞힐 확률은 1/4 이다. 총 여섯 문제가 있다고 할 때, 0에서 5 문제를 맞힐 확률은?+Q. 한 문제를 맞힐 확률은 1/4 이다. 총 여섯 문제가 있다고 할 때, 0에서 5 문제를 맞힐 확률은? dbinom을 이용해서 구하시오.
 <code> <code>
 p <- 1/4 p <- 1/4
Line 1028: Line 1028:
 n <- 6 n <- 6
 pbinom(5, n, p) pbinom(5, n, p)
 +
 +1 - dbinom(6, n, p)
 </code>  </code> 
 +<code>
 +> p <- 1/4
 +> q <- 1-p
 +> n <- 6
 +> pbinom(5, n, p)
 +[1] 0.9997559
 +> 1 - dbinom(6, n, p)
 +[1] 0.9997559
  
 +</code>
  
 +중요 . . . . 
 +<code>
 +# http://commres.net/wiki/mean_and_variance_of_binomial_distribution
 +# ##################################################################
 +#
 +p <- 1/4
 +q <- 1 - p
 +n <- 5
 +r <- 0
 +all.dens <- dbinom(0:n, n, p)
 +all.dens
 +sum(all.dens)
 +
 +choose(5,0)*p^0*(q^(5-0))
 +choose(5,1)*p^1*(q^(5-1))
 +choose(5,2)*p^2*(q^(5-2))
 +choose(5,3)*p^3*(q^(5-3))
 +choose(5,4)*p^4*(q^(5-4))
 +choose(5,5)*p^5*(q^(5-5))
 +all.dens
 +
 +choose(5,0)*p^0*(q^(5-0)) + 
 +  choose(5,1)*p^1*(q^(5-1)) + 
 +  choose(5,2)*p^2*(q^(5-2)) + 
 +  choose(5,3)*p^3*(q^(5-3)) + 
 +  choose(5,4)*p^4*(q^(5-4)) + 
 +  choose(5,5)*p^5*(q^(5-5))
 +sum(all.dens)
 +
 +(p+q)^n
 +# note that n = whatever, (p+q)^n = 1
 +
 +</code>
 +
 +<code>
 +> # http://commres.net/wiki/mean_and_variance_of_binomial_distribution
 +> # ##################################################################
 +> #
 +> p <- 1/4
 +> q <- 1 - p
 +> n <- 5
 +> r <- 0
 +> all.dens <- dbinom(0:n, n, p)
 +> all.dens
 +[1] 0.2373046875 0.3955078125 0.2636718750 0.0878906250
 +[5] 0.0146484375 0.0009765625
 +> sum(all.dens)
 +[1] 1
 +
 +> choose(5,0)*p^0*(q^(5-0))
 +[1] 0.2373047
 +> choose(5,1)*p^1*(q^(5-1))
 +[1] 0.3955078
 +> choose(5,2)*p^2*(q^(5-2))
 +[1] 0.2636719
 +> choose(5,3)*p^3*(q^(5-3))
 +[1] 0.08789062
 +> choose(5,4)*p^4*(q^(5-4))
 +[1] 0.01464844
 +> choose(5,5)*p^5*(q^(5-5))
 +[1] 0.0009765625
 +> all.dens
 +[1] 0.2373046875 0.3955078125 0.2636718750 0.0878906250
 +[5] 0.0146484375 0.0009765625
 +
 +> choose(5,0)*p^0*(q^(5-0)) + 
 ++   choose(5,1)*p^1*(q^(5-1)) + 
 ++   choose(5,2)*p^2*(q^(5-2)) + 
 ++   choose(5,3)*p^3*(q^(5-3)) + 
 ++   choose(5,4)*p^4*(q^(5-4)) + 
 ++   choose(5,5)*p^5*(q^(5-5))
 +[1] 1
 +> sum(all.dens)
 +[1] 1
 +> # 
 +> (p+q)^n
 +[1] 1
 +> # note that n = whatever, (p+q)^n = 1
 +
 +</code>
 ===== Proof of Binomial Expected Value and Variance ===== ===== Proof of Binomial Expected Value and Variance =====
 [[:Mean and Variance of Binomial Distribution|이항분포에서의 기댓값과 분산에 대한 수학적 증명]], Mathematical proof of Binomial Distribution Expected value and Variance [[:Mean and Variance of Binomial Distribution|이항분포에서의 기댓값과 분산에 대한 수학적 증명]], Mathematical proof of Binomial Distribution Expected value and Variance
b/head_first_statistics/geometric_binomial_and_poisson_distributions.txt · Last modified: by hkimscil

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki