Laboratory of Microbial Genomics and Big Data (강원대학교 미생물유전체빅데이터 연구실)

R: Statistics - Number of Cases (Combination) - Hand Shaking - by Eun Bae Kim (11/30/2018)
 Visits : 497,878 ( Your IP 3.147.77.51 )
 

 1: 
 2: 
 3: 
 4: 
 5: 
 6: 
 7: 
 8: 
 9: 
 10: 
 11: 
 12: 
 13: 
 14: 
 15: 
 16: 
 17: 
# If there is 1 person, no case of hand shaking is possible.
# If there are 2 persons, 1 case of hand shaking is possible.
# If there are 3 persons, 3 cases of hand shaking are possible.
# If there are 4 persons, 6 case of hand shaking are possible.
# nCn-1 = n*(n-1)/2
par(mfrow = c(1, 2))
x=1:10
y=c(0, 1, 3, 6, 10, 15, 21, 28, 36, 45)
plot(x, y)
lines(x, y, lty=21, col="red")

x=1:100
y=x*(x-1)/2
plot(x, y)
lines(x, y, lty=21, col="red")
text(20, 4000, "y=x*(x-1)/2")



Figure 1. R: Statistics - Number of Cases (Combination) - Hand Shaking


Kangwon National University