title: Simulate experiment with R Programming
body: <p>I am new in R programming. I need to solve 1 problem in R. I need to simulate the following experiment in R. 
  A poker hand consists of 5 cards dealt from a conventional pack of 52 cards, the order of the cards not being important. Find the probability that a given hand has at least one king and at least one queen. </p>
  
  <p>I know how to find for atleast 1 king but not for  at least one king and at least one queen. for atleast 1 king code is : </p>
  
  <pre><code>deck&lt;- rep(1:13 , each=4)
  #here J=11 , Q=12, K=13
  nhands &lt;- 1000
  Xk&lt;- c(rep(-1, nhands))
  for( i in 1:nhands){
  hand &lt;- sample( deck , 5 , replace= FALSE)
  numberofK&lt;-0
  for( j in 1:5){ # count Kings
  if( hand[j] == 13){
  numberofK &lt;- numberofK +1
  }
  }
  #print(numberofK)
  Xk[i] &lt;-numberofK
  #print(hand)
  }
  table(Xk) /nhands
  </code></pre>
  
  <p>Can anyone please help me in coding the required 1.. Thanks</p>