EBK MATLAB: AN INTRODUCTION WITH APPLIC
EBK MATLAB: AN INTRODUCTION WITH APPLIC
5th Edition
ISBN: 8220102007642
Author: GILAT
Publisher: YUZU
bartleby

Concept explainers

bartleby

Videos

Textbook Question
Book Icon
Chapter 7, Problem 40P

In lottery the player has to guess correctly r numbers that are drawn out of n numbers. The probability, P, of guessing m numbers out of the r numbers can be calculated by the expression:

P = C r , m C ( n r ) , ( r m ) C n , r

where C x , y = x ! y ! ( x y ) ! . Write a user-defined MAILAB function that calculates P. For the function name and arguments, use P=ProbLot-tery (m, r, n). The input arguments are m. the number of correct guesses:

r, the number of numbers that need to be guessed: and n. the number of numbers available. Use a subfunction inside ProbLottery for calculating

Cx,y.

(a) Use ProbLottery for calculating the probability of correctly selecting 3 of 6 numbers that are drawn out of 49 numbers in a lottery game.

(b) Consider a lottery game in which 6 numbers are drawn out of 49 numbers. Write a program in a script file that displays a table with seven rows and two columns. The first column has the numbers 0, 1, 2, 3, 4, 5, and 6, which are the number of numbers guessed correctly. The second column show the corresponding probability of making the guess.

Blurred answer
Knowledge Booster
Background pattern image
Electrical Engineering
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, electrical-engineering and related others by exploring similar questions and additional content below.
Recommended textbooks for you
Text book image
College Algebra
Algebra
ISBN:9781305115545
Author:James Stewart, Lothar Redlin, Saleem Watson
Publisher:Cengage Learning
Text book image
Algebra & Trigonometry with Analytic Geometry
Algebra
ISBN:9781133382119
Author:Swokowski
Publisher:Cengage
Text book image
College Algebra (MindTap Course List)
Algebra
ISBN:9781305652231
Author:R. David Gustafson, Jeff Hughes
Publisher:Cengage Learning
Text book image
Glencoe Algebra 1, Student Edition, 9780079039897...
Algebra
ISBN:9780079039897
Author:Carter
Publisher:McGraw Hill
Text book image
Algebra: Structure And Method, Book 1
Algebra
ISBN:9780395977224
Author:Richard G. Brown, Mary P. Dolciani, Robert H. Sorgenfrey, William L. Cole
Publisher:McDougal Littell
Text book image
Intermediate Algebra
Algebra
ISBN:9780998625720
Author:Lynn Marecek
Publisher:OpenStax College
Finding Local Maxima and Minima by Differentiation; Author: Professor Dave Explains;https://www.youtube.com/watch?v=pvLj1s7SOtk;License: Standard YouTube License, CC-BY