<p><div><div><div><div data-show-faces="false" data-height="21" data-width="100" data-layout="button_count" data-send="true" data-href="https://www.r-bloggers.com/answer-probability-questions-with-simulation-part-2/"></div></div><div></div></div><div></div></div>
<div>
(This article was first published on <strong><a href="http://www.r-exercises.com/2017/09/20/answer-probability-questions-with-simulation-part-2/"> R-exercises</a></strong>, and kindly contributed to <a rel="nofollow" href="https://www.r-bloggers.com/">R-bloggers)</a> </div>
<p><a rel="nofollow" href="https://i0.wp.com/www.r-exercises.com/wp-content/uploads/2017/09/6155148915_a5729c081d_o.jpg" target="_blank"><img sizes="(max-width: 300px) 100vw, 300px" src="https://i1.wp.com/www.r-exercises.com/wp-content/uploads/2017/09/6155148915_a5729c081d_o-300x300.jpg?resize=300%2C300" alt="" class="wp-image-7962" data-recalc-dims="1"></a></p>
<p>This is the second exercise set on answering probability questions with simulation. Finishing the <a rel="nofollow" href="http://www.r-exercises.com/2017/08/20/answer-probability-questions-with-simulation/" target="_blank">first exercise set</a> is not a prerequisite. The difficulty level is about the same – thus if you are looking for a challenge aim at writing up faster more elegant algorithms.</p>
<p>As always, it pays off to read the instructions carefully and think about what the solution should be before starting to code. Often this helps you weed out irrelevant information that can otherwise make your algorithm unnecessarily complicated and slow.</p>
<p>Answers are available <a rel="nofollow" href="http://www.r-exercises.com/2017/09/20/answer-probability-questions-with-simulation-part-2-solutions/" target="_blank">here</a>.</p>
<p> </p>
<p><strong>Exercise 1</strong><br>
If you take cards numbered from 1-10 and shuffle them, and lay them down in order, what is the probability that at least one card matches its position. For example card 3 comes down third?</p>
<p><strong>Exercise 2</strong><br>
Consider an election 3 candidates and 35 voters and who casts his ballot randomly for one of the candidates. What is the probability of a tie for the first position?</p>
<p><strong>Exercise 3</strong><br>
If you were to randomly find a playing card on the floor every day, how many days would it take on average to find a full standard deck?</p>
<p><strong>Exercise 4</strong><br>
Throw two dice. What is the probability the difference between them is 3, 4, or 5 instead of 0, 1, or 2?</p>
<p><strong>Exercise 5</strong><br>
What is the expected number of distinct birthdays in a group of 400 people? Assume 365 days and that all are equally likely.</p>
<p><strong>Exercise 6</strong><br>
What is the probability that a five-card hand in standard deck of cards has exactly three aces?</p>
<div>
<aside><img src="http://www.r-exercises.com/2017/09/20/answer-probability-questions-with-simulation-part-2/"></aside>
<div><strong>Learn more</strong> about probability functions in the online course <a rel="nofollow" href="http://www.r-exercises.com/product/statistics-with-r-advanced-level/" target="_blank">Statistics with R – Advanced Level</a>. In this course you will learn how to
<ul>
<li>work with different binomial and logistic regression techniques,</li>
<li>know how to compare regression models and choose the right fit,</li>
<li>and much more.</li>
</ul>
</div>
</div>
<p><strong>Exercise 7</strong><br>
Randomly select three distinct integers a, b, c from the set {1, 2, 3, 4, 5, 6, 7}.<br>
What is the probability that a + b > c?</p>
<p><strong>Exercise 8</strong><br>
Given that a throw of three dice show three different faces what is the probability if the sum of all the dice is 8.</p>
<p><strong>Exercise 9</strong><br>
Throwing a standard die until you get 6. What is the expected number of throws (including the throw giving 6) conditioned on the event that all throws gave even numbers.</p>
<p><strong>Exercise 10</strong><br>
Choose two-digit integer at random, what is the probability that it is divisible by each of its digits. This is not exactly a simulation proplem – but the concept is similar make R do the hard work.</p>
<p> </p>
<p>(Picture by <a rel="nofollow" href="https://www.flickr.com/photos/gilzpics/" target="_blank">Gil</a>)</p>
<div>
<h3>Related exercise sets:</h3>
<ol>
<li><a rel="nofollow" href="http://www.r-exercises.com/2017/08/20/answer-probability-questions-with-simulation/" title="Answer probability questions with simulation" target="_blank">Answer probability questions with simulation </a></li>
<li><a rel="nofollow" href="http://www.r-exercises.com/2017/08/31/probabilty-functions-intermediate/" title="Probability functions intermediate" target="_blank">Probability functions intermediate </a></li>
<li><a rel="nofollow" href="http://www.r-exercises.com/2016/03/23/lets-begin-with-something-sample/" title="Lets Begin with something sample" target="_blank">Lets Begin with something sample </a></li>
<li><a rel="nofollow" href="http://www.r-exercises.com/start-here-to-learn-r/" target="_blank">Explore all our (>1000) R exercises</a></li>
<li><a rel="nofollow" href="http://www.r-exercises.com/r-courses/" target="_blank">Find an R course using our R Course Finder</a> directory</li>
</ol>
</div>
	<p>
<div>
<div>To <strong>leave a comment</strong> for the author, please follow the link and comment on their blog: <strong><a href="http://www.r-exercises.com/2017/09/20/answer-probability-questions-with-simulation-part-2/"> R-exercises</a></strong>.</div>
<hr>
<a rel="nofollow" href="https://www.r-bloggers.com/">R-bloggers.com</a> offers <strong><a rel="nofollow" href="https://feedburner.google.com/fb/a/mailverify?uri=RBloggers">daily e-mail updates</a></strong> about <a rel="nofollow" href="https://www.r-project.org/" title="The R Project for Statistical Computing">R</a> news and <a rel="nofollow" href="https://www.r-bloggers.com/search/tutorial" title="R tutorials">tutorials</a> on topics such as: <a rel="nofollow" href="https://www.r-bloggers.com/search/data%20science" title="Data science">Data science</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/Big%20Data" title="Big Data">Big Data, <a rel="nofollow" href="https://www.r-users.com/" title="R jobs">R jobs</a>, visualization (<a rel="nofollow" href="https://www.r-bloggers.com/search/ggplot2" title="ggplot and ggplot2 tutorials">ggplot2</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/boxplot" title="Boxplots using lattice and ggplot2 tutorials">Boxplots</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/map" title="Maps and gis">maps</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/animation" title="Animation in R">animation</a>), programming (<a rel="nofollow" href="https://www.r-bloggers.com/search/RStudio" title="RStudio IDE for R">RStudio</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/sweave" title="Sweave and literate programming">Sweave</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/LaTeX" title="LaTeX in R">LaTeX</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/SQL" title="SQL and databases">SQL</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/eclipse" title="Eclipse IDE for R">Eclipse</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/git" title="git and github, Version Control System">git</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/hadoop" title="Large data in R using Hadoop">hadoop</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/Web+Scraping" title="Web Scraping of google, facebook, yahoo, twitter and more using R">Web Scraping</a>) statistics (<a rel="nofollow" href="https://www.r-bloggers.com/search/regression" title="Regressions and ANOVA analysis tutorials">regression</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/PCA" title="principal component analysis tutorial">PCA</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/time+series" title="Time series">time series</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/trading" title="finance trading">trading</a>) and more...
<img width="1" alt="" src="http://feeds.feedburner.com/~r/RBloggers/~4/Wu3Wd5d8UWQ" height="1"></a></div>