Advertisement
Guest User

Untitled

a guest
Jun 17th, 2019
65
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.61 KB | None | 0 0
  1. N=1 000 000;
  2. {list=vectorv(200);il=0;
  3. for(j=1,#list,
  4. su=0;for(k=1,N,
  5. m1=100+random(2^31); \ use numbers >=100
  6. if( m1 % 2
  7. , m2=(3*m1+1)/2
  8. , m2=m1/2
  9. );
  10. l1=#binary(m1);
  11. l2=#binary(m2);
  12. su += (l2>l1)
  13. );
  14. il++;
  15. list[il] = su / N *100.0; \ put the new result into the list
  16. );
  17. print(list); } \ the aggregation of data for frequencies-table
  18. \ has been done outside of Pari/GP
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement