Advertisement
dvdg6566

Untitled

Jun 12th, 2018
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 2.39 KB | None | 0 0
  1. arr = []
  2. def val(n):
  3.     if(n==1):
  4.         return
  5.     x = 1
  6.     for i in arr:
  7.         x *= i
  8.     x = 1-x
  9.     print(len(arr),x)
  10.     arr.append(x)
  11.     val(n-1)
  12.  
  13. arr.append(0.5)
  14. val(101)
  15.  
  16.  
  17.  
  18.  
  19. 1 0.5
  20. 2 0.75
  21. 3 0.8125
  22. 4 0.84765625
  23. 5 0.8708648681640625
  24. 6 0.8875407504383475
  25. 7 0.9001878332503175
  26. 8 0.910150301881584
  27. 9 0.9182232701335544
  28. 10 0.9249107036812041
  29. 11 0.930549106102856
  30. 12 0.9353725327659683
  31. 13 0.9395492422870542
  32. 14 0.9432035363951234
  33. 15 0.9464293746731435
  34. 16 0.9492991865710539
  35. 17 0.9518697590534108
  36. 18 0.9541862791469875
  37. 19 0.9562851761653852
  38. 20 0.9581961619882766
  39. 21 0.959943722860787
  40. 22 0.9615482281990405
  41. 23 0.9630267669536735
  42. 24 0.9643937869155715
  43. 25 0.9656615893257853
  44. 26 0.9668407157734162
  45. 27 0.9679402539038356
  46. 28 0.9689680812235861
  47. 29 0.9699310612065322
  48. 30 0.9708352022866974
  49. 31 0.9716857877123553
  50. 32 0.9724874823298251
  51. 33 0.9732444209583768
  52. 34 0.9739602819682294
  53. 35 0.9746383488834035
  54. 36 0.9752815622307635
  55. 37 0.9758925633965151
  56. 38 0.9764737318961061
  57. 39 0.9770272171870024
  58. 40 0.9775549659371755
  59. 41 0.9780587454912569
  60. 42 0.9785401641406744
  61. 43 0.9790006886957835
  62. 44 0.9794416597710349
  63. 45 0.9798643051240048
  64. 46 0.980269751332144
  65. 47 0.9806590340446394
  66. 48 0.9810331070087258
  67. 49 0.9813928500384683
  68. 50 0.9817390760681592
  69. 51 0.9820725374110036
  70. 52 0.9823939313258836
  71. 53 0.9827039049800412
  72. 54 0.9830030598829806
  73. 55 0.9832919558563222
  74. 56 0.9835711145954293
  75. 57 0.9838410228710658
  76. 58 0.9841021354129192
  77. 59 0.9843548775113484
  78. 60 0.9845996473690333
  79. 61 0.9848368182301914
  80. 62 0.9850667403115757
  81. 63 0.9852897425564976
  82. 64 0.9855061342305518
  83. 65 0.9857162063754945
  84. 66 0.985920233135802
  85. 67 0.9861184729707522
  86. 68 0.9863111697634159
  87. 69 0.986498553836662
  88. 70 0.9866808428851634
  89. 71 0.9868582428314131
  90. 72 0.9870309486128912
  91. 73 0.9871991449067727
  92. 74 0.9873630067978905
  93. 75 0.9875227003950806
  94. 76 0.9876783834005116
  95. 77 0.9878302056361363
  96. 78 0.9879783095309951
  97. 79 0.9881228305727277
  98. 80 0.9882638977263318
  99. 81 0.9884016338229098
  100. 82 0.9885361559208876
  101. 83 0.9886675756419578
  102. 84 0.9887959994837886
  103. 85 0.9889215291113559
  104. 86 0.9890442616285864
  105. 87 0.9891642898318492
  106. 88 0.9892817024466974
  107. 89 0.9893965843491386
  108. 90 0.9895090167726035
  109. 91 0.989619077501681
  110. 92 0.9897268410535971
  111. 93 0.9898323788483352
  112. 94 0.989935759368219
  113. 95 0.9900370483077133
  114. 96 0.9901363087141362
  115. 97 0.990233601119919
  116. 98 0.9903289836670038
  117. 99 0.990422512223917
  118. 100 0.990514240496018
  119.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement