title: How to put 2 for loops inside a for loop
body: <p>So a woman can only have multiple children if she gives birth to a boy - if she gives birth to a girl, she can no longer have any children. I have to create a table showing the results of running 10 simulations, each consisting of the ratio of boys to girls born to 10,000 mothers under this policy. We'll assume that every birth results in a single child (no twins, triplets, etc.), that every child lives, and that the odds of having a boy is 50%.</p>
  
  <p>So far I have:</p>
  
  <pre><code>    for (numSimulation = 0; numSimulation &lt; 10; numSimulation++){;
          for (int mothers = 1; mothers &lt;= 10000; mothers++){;
              int randomNum = randomGenerator.nextInt();
  
              boolean isMale = randomNum % 2 == 0;
  
              if (isMale){
                  numMales++;
              }
              else{
                  numFemales++;
              }}
          femaleToMaleRatio =(double) numFemales / numMales;
  
      }
  
      System.out.printf("Run#  M : F%n");
      System.out.printf("%4d  1 : %.5f%n",numSimulation-9, femaleToMaleRatio);
      System.out.printf("%4d  1 : %.5f%n",numSimulation-8, femaleToMaleRatio);
      System.out.printf("%4d  1 : %.5f%n",numSimulation-7, femaleToMaleRatio);
      System.out.printf("%4d  1 : %.5f%n",numSimulation-6, femaleToMaleRatio);
      System.out.printf("%4d  1 : %.5f%n",numSimulation-5, femaleToMaleRatio);
      System.out.printf("%4d  1 : %.5f%n",numSimulation-4, femaleToMaleRatio);
      System.out.printf("%4d  1 : %.5f%n",numSimulation-3, femaleToMaleRatio);
      System.out.printf("%4d  1 : %.5f%n",numSimulation-2, femaleToMaleRatio);
      System.out.printf("%4d  1 : %.5f%n",numSimulation-1, femaleToMaleRatio);
      System.out.printf("%4d  1 : %.5f%n",numSimulation, femaleToMaleRatio);
  
  }}`
  </code></pre>
  
  <p>Where and what would I have to put in that 3rd loop to make it keep running until it gives birth to a girl? And also how would I show the femaleToMaleRatio distinctive to each numSimuation? Because right now it shows the same number for all 10 runs on my System.out.printf</p>