How do you code Negative Binomial Distribution in R

46 Views Asked by At

How do I code the following questions in R?

When a machine is improperly adjusted, it has probability 0.105 of producing a defective item. Each day, the machine is run until 3 defective items are produced. When this occurs, it is stopped and checked for adjustment.

  1. What is the probability that an improperly adjusted machine will produce 6 or more items before being stopped?

  2. What is the average number of items an improperly adjusted machine will produce before being stopped?