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.
What is the probability that an improperly adjusted machine will produce 6 or more items before being stopped?
What is the average number of items an improperly adjusted machine will produce before being stopped?