title: How to find the probability of each element in a array getting a certain random variable?
body: <p>I created an array called new array and assigned the vales so the first node in the array is 0 and the rest is 1.</p>
  
  <pre><code>int[] arr = new int[10];
  arr[0] = 0;
   for (int m = 1; m &lt; 10; m++) {
           arr[m] = 1;
      }
  </code></pre>
  
  <p>Then I did a loop to assign a random variable between 0 and 1 to it</p>
  
  <pre><code>for(int i = 0;i &lt; 100; i++){
      U = rnd.nextInt(2);
     int j = rnd.nextInt(10);
      arr[j] = U;
  }
  </code></pre>
  
  <p>I am trying to write a code to find the probability that each element in this array gets assigned the number 0 at least once. The probabilty it will get assigned 0 is .1?</p>