title: List the sample space?
body: <p>I faced this exercise that couldn't solve:
  An urn contains three red balls, two green balls, and one white. Three balls are drawn sequentially without replacement from the urn. Their colors are recorded. List the sample space using R.</p>
  
  <p>I tried:</p>
  
  <pre><code>combn(c(rep("R",3), rep("G",2),"W"),3)
  </code></pre>
  
  <p>but this function does not account for the order of the elements and reads the three R like R1,R2 and R3. As a result there are duplicate lines in the output. </p>
  
  <p>I need the function to produce this sequence:</p>
  
  <pre><code>Ω = {"GGR" "GGW" "GRG" "GRR" "GRW" "GWG" "GWR" "RGG" "RGR" "RGW" "RRG" "RRR" "RRW" "RWG" "RWR" "WGG" "WGR" "WRG" "WRR"}
  </code></pre>