Question
C Programming With our ability to implement user-defined functions only the following will be permitted in the main function: 1. Declaration of variables to be
C Programming
With our ability to implement user-defined functions only the following will be permitted in the main function:
1. Declaration of variables to be passed to functions.
2. Calls to user-defined functions by main.
3. A limited amount of control structures (see chapters 5 and 6) to retain the previous two tasks within the main function. Additionally, each user-defined function may represent a single task in your larger program.
The failure to make a good use of user-defined functions as described here and in the course standards will result in a loss of ALL points on those assignments that require user-defined functions.
Problem: An industrial facility is implementing a new processes which increases their rate of microprocessor unit production but there is some concern that the new process will generate a larger number of defective units. Given the percentage of defective units produced determine the probability that there will R defective units from a sample size of N In addition the program should calculate the probability that there will be no defective units from that same sample. Use Gosper's estimate (formula on right) for factorial where needed in your solution. Example Execution #1: Enter percentage of defective units produced: 20 Enter number of units to sample: 10 Enter number of defective units in sample: 2 Average number of defective units: 20% Selecting 10 units with 2 being defective has a probability of: 0.3024 Selecting 10 units with 0 being defective has a probability of: 0.1049 Example Execution #2: Enter percentage of defective units produced: 25 Enter number of units to sample: 10 Enter number of defective units in sample: 2 Average number of defective units: 25% Selecting 10 units with 2 being defective has a probability of: 0.2819 Selecting 10 units with 0 being defective has a probability of: 0.0550 Example Execution #3: Enter percentage of defective units produced: 15 Enter number of units to sample: 10 Enter number of defective units in sample: 2 Average number of defective units: 15% Selecting 10 units with 2 being defective has a probability of: 0.2763 Selecting 10 units with 0 being defective has a probability of: 0.1924 Example Execution #4: Enter percentage of defective units produced: 45 Enter number of units to sample: 10 Enter number of defective units in sample 10 Average number of defective units: 45% Selecting 10 units with 10 being defective has a probability of: 0.0003 Selecting 10 units with 0 being defective has a probability of 0.0025
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started