Advertisement
Guest User

Untitled

a guest
Nov 15th, 2018
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.01 KB | None | 0 0
  1.  
  2. num<-Rmpfr::mpfr(4142135623730950488016887242096980785696718753769480731766797379907324784621070388503875343276415727 ,10000)
  3.  
  4. count <- c(0, 0, 0, 0, 0, 0, 0, 0, 0, 0)
  5. for(i in 0:99) {
  6. if(num %% 10==0) {
  7. count[1] <- count[1] + 1
  8. }
  9. if(num %% 10==1) {
  10. count[2] <- count[2] + 1
  11. }
  12. if(num %% 10==2) {
  13. count[3] <- count[3] + 1
  14. }
  15. if(num %% 10==3) {
  16. count[4] <- count[4] + 1
  17. }
  18. if(num %% 10==4) {
  19. count[5] <- count[5] + 1
  20. }
  21. if(num %% 10==5) {
  22. count[6] <- count[6] + 1
  23. }
  24. if(num %% 10==6) {
  25. count[7] <- count[7] + 1
  26. }
  27. if(num %% 10==7) {
  28. count[8] <- count[8] + 1
  29. }
  30. if(num %% 10==8) {
  31. count[9] <- count[9] + 1
  32. }
  33. if(num %% 10==9) {
  34. count[10] <- count[10] + 1
  35. }
  36. num <- num%/%10
  37. }
  38. count
  39.  
  40.  
  41. matrice <- matrix(c(0,1,2,3,4,5,6,7,8,9,count[1],count[2],count[3],count[4],count[5],count[6],count[7],count[8],count[9],count[10]), nrow = 2, byrow = TRUE)
  42. matrice
  43.  
  44. text_h0<-chisq.test(matrice)
  45. text_ksi
  46.  
  47. text_h1<-pearson.test(matrice)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement