Survey
* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project
* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project
Inductive probability wikipedia , lookup
Bootstrapping (statistics) wikipedia , lookup
History of statistics wikipedia , lookup
Foundations of statistics wikipedia , lookup
Taylor's law wikipedia , lookup
Law of large numbers wikipedia , lookup
Resampling (statistics) wikipedia , lookup
17 Tutorials on Probability and Statistics Tutorial 5 Regression lines and correlation coefficients (To be done in the classroom and the answers checked in the Computer Lab. using Mathcad in Tutorial 6.) 1. A test on a metal filament lamp gave the following values or resistance (R ) at various voltages (V volts) V 62 75 89 100 120 R 100 118 136 149 176 R and V are connected by an equation of the form R = a + bV. least squares line. Check your answer with Mathcad. (Answer: R = 19.91 + 1.299V) Determine suitable values for a and b by finding the 2. During a test with a thermocouple pyrometer the emf (E millivolts) was measured against the temperature of the hot junction (T oC) and the following results obtained: T 200 300 400 E 6 9.1 12.0 500 600 700 800 900 1000 14.8 18.2 21.0 24.1 26.8 30.2 Calculate the regression line for E on T and hence find the value of E when T = 840 oC. Mathcad (Answer: E = -0.008 + 0.030T; 25.19 mV) Check your answer with 3. Shown below are some file sizes N (kBytes) ) and the times taken (T minutes) to download them over a modem.. N 1320 344 1712 880 768 1472 2160 520 T 3.5 1.0 4.0 2.0 1.0 3.0 4.5 1.5 (a) Calculate the regression line for N on T (b) Calculate the regression line for T on N (c) Find the correlation coefficient. (d) Use Mathcad to check your answers to parts (a) and (b) (Answers:(a) N = 33.80 + 434.4T (b) T = 0.153 + 0.0021N (c) r = 0.9553) 93 Tutorial 6 Regression lines using Mathcad The exercises below are intended to be carried out in the computer laboratory to remind you how to use Mathcad to plot the best straight line through given experimental data points as covered in Engineering Mathematics A. (a) Plotting the laboratory results. current voltage 1 2.1 Here are some laboratory results 2 4.3 3 4 8.6 5.7 5 9.4 6 13.1 7 15.2 Put the current values in one vector and the voltage values in another vector, graph the one vector against the other and format the graph to show points with diamond symbols instead of lines as follows: Type current: then ‘Insert’ ‘Matrix’ with rows =7 and columns =1. Enter your current data Type voltage: then ‘Insert’ ‘Matrix’ with rows =7 and columns =1. Enter your voltage data Move the cursor to an empty part of the screen and type @ Fill in the horizontal and vertical placeholders by typing ‘current’ and ‘voltage’ respectively. Click outside the graph Now double-click on the graph and format trace 1 to ‘type’= points, ‘symbols’= dmnd (diamond) the best straight line is y = mx +c where m s lope( current voltage) m 2.164 c interceptcurrent ( voltage) c 0.314 To plot the line we can add another graph 16 16 12 12 voltage m current voltage c 8 m x c 4 8 4 0 0 2 4 current 6 0 8 0 2 4 current x 6 8 The best straight line through these points is the one shown together with the original points in the graphs above. We have used the special built-in Mathcad functions slope(vx,vy) and intercept(vx,vy) to make this procedure straightforward. See if you can obtain the graphs above– ask the lecturer if you are stuck. You can use this method to find the best straight line for any experimental data points as long as you have reason to believe a straight line fit is what is required. Carry out all the exercises of Tutorial 5 using Mathcad. 94 Tutorial 7 0. Two resistors are taken at random from a packet containing seven resistors: two 1 k , three 10 k and two 100 k . What is the probability that both resistors taken have the same value? (hint: identify all the possible outcomes) Answer: 5/21 1. The chance that an I/C chip is defective is 5%. least one defective in a sample of size (i) 5, (ii) 10. Answer: (i) 0.226, (ii) 0.401 Use the Binomial distribution to find the chance of obtaining at 2. The probability that a 20 watt bulb will fail in a 500-hour life test is 0.001. Use the Poisson distribution to calculate the probability that an illuminated sign made up from 1000 such bulbs will remain lit up for 500 hours (a) with no bulb failures (b) with just one bulb failure Answers: (a) 0.3679 (b) 0.3679 (c) .7538 (c) with less than two bulb failures. 3. The smooth operation of a spacecraft depends upon a mechanism which has a 5% probability of failure. How many such mechanisms should be incorporated in the system to be (i) 99% certain (ii) 99.9% certain and (iii) 99.99% certain, that at least one mechanism will work satisfactorily? Answers (i) 2 (ii) 3 (iii) 4 4. The mean number of telephone calls received in 10 minutes at a firm's switchboard is 5. Assuming a Poisson distribution calculate the probability that in 10 minutes (i) 10, (ii) more than 6, (iii) less than 4 calls are received. Answers: (i) 0.018, (ii) 0.238 (iii) 0.265 5. A PC computer manufacturer gives a guarantee of one year and finds that during this period 1 in 550 machines requires adjustment. In a given year he sells 1525 machines. Calculate the probability of there being exactly 0,1,2,3,4,5 machines requiring adjustment during the guarantee period (use the Poisson distribution). Answers: 0.0625 0.1737 0.2408 0.2226 0.1543 0.0856 6 Of certain electronic components 0.2% of the total is defective. If the articles are packed in cartons containing 200 articles, what proportion of cartons is free of defective goods, and what proportion contains 2 or more defective goods? Answer: 0.6703 0.062 7 How many times must a coin be tossed in order that the probability of observing at least one head is 0.9? Answer: 4 The starred questions * below are for recreation purposes only. 9* A circular coin of diameter 2cm is thrown onto a chessboard 80cm x 80 cm. The centre of the coin falls somewhere on the chessboard. What is the probability the coin is completely within a white square? Answer p = 0.32 10* A game is played with 5 coins. In the first round all the coins are all tossed and any coins showing a Head are removed. The remaining coins go through to the next round. In the next round the remaining coins (all of which are showing Tail) are tossed again and again any coins showing a Head are removed. This process continues and the game ends when all 5 coins have been removed. What is the probability the game ends (a) on or before the third round (b) on or before the m th round? 5 Answer 1 3 (a) 1 0.513 2 1 m (b) 1 2 5 11* A room is in total darkness. In a drawer there are 20 loose gloves comprising 6 pairs of brown gloves and 4 pairs of black gloves. What is the minimum number of gloves that must be taken at random from the drawer to be certain of having one pair of gloves of the same colour? Answer 11 (the answer is not 3) 95 12* You are a participant in a quiz. The quizmaster shows you three closed doors. He tells you that behind one of these doors there is a prize, and behind the other two doors there's nothing. You select one of the doors, but before you open it the quizmaster deliberately (i.e. not by chance) picks out a remaining empty door and shows that there is nothing behind it. The quizmaster offers you a chance to switch doors with the remaining closed door. Should you stick to your choice? Answer: This is a well-known puzzle. The answer is No, do not stick to your choice – double your chances by switching . The following is quoted from http://www.dse.nl/~puzzle/teasers/index.html “In this puzzle, you should not use your intuition, but let your common sense do the job: the chance that your first choice for a door was correct is 1/3; therefore, the chance that your first choice was wrong is 2/3. So the chance that one of the remaining doors is correct is also 2/3. With the help of the quizmaster (who knows which door hides the price, and thus is able to open one of the remaining doors which does not contain the the price), you get to know which one of the remaining doors is incorrect. Now you also know which one of the remaining doors could be correct with a chance of 2/3! Conclusion: You should switch doors, which doubles your chances. For the disbelieving few: consider the situation where there are 1000 doors instead of 3. After you have chosen one door, the quizmaster points out 998 of the 999 doors that are left, that do not contain the prize. Should you switch to the other remaining door? Of course! If, out of 999 doors, the quizmaster (deliberately) leaves that door, chances are very large (999/1000) that it is the right one! For the still disbelieving few: write a computer program which simulates this quiz thousands of times, and you will see that the chances are double if you switch doors. If after all this, you still don't believe it (and trust me, you are not alone), please have a look at the first puzzle (on page 49) and its solution (on page 55) of Martin Gardner's article "A Quarter-Century of Recreational Mathematics" in the Scientific American of August 1998” . Quote Here is a rough and ready Mathcad program that does the job. See if you can figure out how it works. Run it a few times to convince yourself it is better by a factor of 2 to change your mind.. Write a better program. 96 3-door quiz Simulation 1 1 pickagainx ( ) if rnd( x) 2 yourpickx ( ) if rnd( x) 3 2 3 1 pickagain1 ( ) yourpick(1) returns either 1,2 or 3 with equal probability. This is the number of the door you chose at the beginning 1 1 prizeagainx ( ) if rnd( x) prizedoor( x) if rnd( x) 2 3 2 3 1 prizeagain1 ( ) prizedoor(1) returns either 1,2 or 3 with equal probability. This is the number of the door that actually contains the prize and is known to the quizmaster. Play the game n times by calling play(n) below. See if you can figure out how it works. The reult printed out is a vector oftwo elements. The top element tells you how many times you would have won if you had changed your mind. The bottom number tells you how many times you would have won by not chjanging your mind. Usually you win about twice as much by changing your mind play( n) j0 change 0 keep 0 while j n yourchoice yourpick1 ( ) realdoor prizedoor( 1) change change 1 if yourchoice realdoor keep keep 1 if yourchoice realdoor j j 1 ans0 change ans1 keep ans 1951 play( 3000 ) 1049 change your mind don't change your mind 97 TJF 2004 Tutorial 8 For the data sets below find the mean, variance and standard deviations of populations and samples using a statistical calculator. You should also check your answers the long way by using the appropriate formulae to convince yourself that the statistical calculator answers are correct. In practice it is recommended that you always use the statistical calculator in preference to the formulae as the calculator is quicker and offers less chance of error. In Q1 to Q3 find the mean, standard deviation and variance (a) assuming the data represents a population (b) assuming the data represents a sample. Q1. 1, 4, 6, 7, 3, 8, 6 Answer (a) = 5 = 2.267786838 2 = 5.142857143 (b) m = 5 s = 2.449489743 s2 = 6 (note: in practice we do not need all these decimal places, they are given here only for you to confirm the accuracy of the procedure used on your calculator) Q2. 2.67 4.36 5.23 4.16 7.59 3.24 8.12 6.53 Answer (a) = 5.2375 = 1.871722135 (b) m = 5.2375 Q3. Answer (a) ( = (2 = 3.50334375 s = 2.000955129 s2 = 4.003821429 96.5 89.5 90.7 100.6 99.6 98.4 100.8 102.6 103.7 96.5 98.1 103.4 97.9 99.5 102.6 95.9 8.51875 (b) m = 98.51875 ( = 3.98202505 (2 =15.8565235 s = 4.112617788 s2 =16.91362507 Notice that s is always greater than but the relative difference decreases for larger values of n. It is only for smaller values of n that the distinction between s and is noticeable. 98 Tutorial 9 A certain population of fuses labeled ’10 A’ actually has a population mean fusing current = 9.9 A and population standard deviation = 1.2 A . Use normal tables to determine the probability of a fuse blowing with a current (a) less than 7.0 A (b) between 8.0 A and 12.0 A 1. Answer: (a) 0.0078 (b) 0.9028 2. Resistors of a certain type have a mean resistance of 420 with a standard deviation of 12. Determine the percentage of resistors having resistance values between 400 and 430 . Answer: 74.9% 3 A population of resistors is normally distributed with mean μ = 100 and standard deviation σ = 5. A single resistor is chosen at random from the population. Find the probability that it is (i) bigger than 110 Ω (ii) smaller than 95 Ω(iii) lies between 98 Ω and 102 Ω. Four resistors are chosen at random from the same population and the sample mean calculated. Find the probability that the sample mean is (iv) bigger than 110 Ω (v) smaller than 95 Ω (vi) lies between 98 Ω and 102 Ω. Comment on your results Answer: (i) 0.02275 (ii) 0.1587 (iii) 0.3108 (iv) 0.00003 (v) 0.02275 (vi) 0.5762 Comment: the sample mean is more likely to be closer to the true population mean than an individual value. 4. A random sample is drawn from a population with known standard deviation = 2.0. If the sample mean is 25.3 calculate the 95% confidence limits for the population mean if the sample size, n, is (i) 9 (ii) 25 (iii) 100 Answer: (i) 25.3 1.31 (ii) 25.3 0.784 (iii) 25.3 0.392 5. The diameters of a random sample of 100 turned bars were measured and their mean diameter was found to be 18.10 mm. The standard deviation, , for the population is known to be 1.2 mm. At the 99% confidence level what is the estimate of the mean diameter of all turned bars produced? Answer: 18.10 0.31 mm 6. A random sample is drawn from a normal population with known standard deviation = 2.0. The sample mean is 25.3. Calculate the 95% confidence limits on the population mean if the sample size is (a) 9 (b) 25 (c) 100. Answer: (a) 25.3 1.31 (b) 25.3 0.784 (c) 25.3 0.392 7. In a certain population the weights of adults are normally distributed with a mean of 90 kg and a standard deviation of 10 kg. A passenger lift is rated to carry a maximum load of 600 kg. When the load exceeds 600 kg an alarm rings. (a) An adult is selected at random from the population, what is the probability that the individuals weight lies between 85 kg and 100 kg? (b) 6 adults are chosen at random, what is the probability that their mean weight exceeds 100 kg? (c) A random sample of 7 adults enter the lift. What is the probability that the alarm rings? Answer (a) .5328, (b) .00714, (c) .8729 8. The diameter of a sphere is measured 10 times. The mean of these measurements is found to be 53.6 mm with a sample standard deviation of 0.8 mm. Find (i) the 95% and (ii) the 99% confidence limits for the true diameter of the sphere. Answer: (i) 53.6 0.57 mm (ii) 53.6 0.82 mm 99 9. From a large batch of nominal 100 mH coils a random sample of seven coils was taken and the inductance of each coil was measured. The results obtained are given below: 98 95 99 97 101 102 98 For this data calculate the sample mean and sample standard deviation. Find the 95% confidence interval for the population mean. Answer: mean = 98.6, s = 2.37 confidence interval 98.6 2.2 10. Find the 99% confidence interval for question 9 above. Answer: 98.6 3.3 11 Fill in the table below. Check your answers in the lab on Mathcad using the file confidencelimits.mcd on the Faraday server. n (sample size) {significance level) answers for U and L 100 s (sample standard deviation) 5 10 0.05 75.6 3.2 7 0.05 2405 44 12 0.01 50.7 2.1 8 0.01 470 8 15 0.05 U= L= U= L= U= L= U= L= U= L= _ x (sample mean) 12 A certain kind of car battery is known to have a length of life which is normally distributed with mean 1200 days and standard deviation 100 days. How long should the guarantee time be if the manufacture does not want to replace more than 10% of the batteries sold? Answer: 1072 days 100 Tutorial 10 1. The mean lifetime of a sample of 100 fluorescent light bulbs produced by a company is 1570 hours with a standard deviation of 120 hours. If is the mean lifetime of all the bulbs produced by the company, test the hypothesis that =1600 hours against the alternative hypothesis that < 1600 hours., using a level of significance (a) 0.05 and (b) 0.01 Answer: two-tailed test, (you may use normal tables because n = 100 – large sample) u = -2.50 (a) reject Ho at 5% (b) Accept Ho (or withhold decision) at 1% 2. In the previous problem test the hypothesis = 1600 hours against the alternative hypothesis < 1600 hours, using a level of significance (a) 0.05 and (b) 0.01. Answer: One-tailed test, u = -2.50 (a) Reject Ho if u < -1.645 so reject Ho at 5% (b) Reject Ho if u < -2.33 so reject Ho at 1%. Note: decision (b) is not the same as in the previous problem using a two-tailed test. Decisions based on one-tailed tests do not always agree with decisions based on two-tailed tests. This is to be expected since we are testing against a different alternative in each case. 3. A test of the breaking strengths of 6 ropes manufactured by a company showed a mean breaking strength of 3515 kg and a sample standard deviation of 72.3 kg, whereas the manufacturer claimed a mean breaking strength of 3630 kg. Can we support the manufacturer's claim at a level of significance of (a) 0.05 and (b) 0.01 ? Answer: test =3 630 against < 3630 - one-tailed test - t-tables t = -3.90 (a) Reject Ho if t < -2.01 so we reject Ho . (b) Reject Ho if t < -3.36 so we reject Ho . 4. The manufacturer states that the mean lifetime of a light bulb is supposed to be 100 hours. A random sample of six bulbs gave lifetimes of 88 96 110 120 80 94 hours respectively. Test the hypothesis at the 5% level of significance that the bulbs match up to the manufacturer's statement. Answer: two tailed test, t = -0.335, do not reject the claim. 5 A sample of 10 measurements of a capacitor gave a mean of 4.38 F and the sample standard deviation was s = 0.06 F. Calculate the 95% and the 99% confidence limits for the actual capacitance. Answer 95% 4.38 0.043, 99% 4.38 0.062 6. In the past a machine has produced coils with mean inductance 50 mH. To determine whether the machine is in proper working order, a random sample of 10 coils is chosen for which the mean inductance is 53 mH with a sample standard deviation s = 3 mH. Test the hypothesis that the machine is in proper working order using a level of significance of (a) 5% (b) 1%. Answer two-tailed test, t = 3.16, reject null hypothesis 7 A test of the breaking strength of 6 cables manufactured by a company showed a mean breaking strength of 7750 N and a standard deviation of 145 N, whereas the manufacturer claimed a mean breaking strength of 8000 N. Can we support the manufacturer's claim at a level of significance of (a) 5% (b) 1%? Answer one-tailed test t = -4.22, reject in both cases. It is extremely unlikely that the manufacturer's claim is justified . 101 Additional questions without answers 1. When an electronic circuit is working properly it produces voltage pulses with a mean height = 5.0 volts. Twenty pulses were measured at random and the sample mean height was found to be x = 5.1 volts and the sample standard deviation s = 0.1 volts. Carry out a hypothesis test at the 5% level of significance to determine whether the circuit is working properly. 2. When a machine is working properly it produces wire-wound coils with a mean inductance of 100 mH. In order to test if the machine is working correctly a sample of 5 coils was taken and it was found that the sample mean was x 95 mH and the sample standard deviation was s = 3 mH. Carry out a suitable hypothesis test at the 5% level of significance to determine if the machine is working properly. 3.(a) Cartridge fuses from a certain manufacturer are rated to have a fusing current of 10 A. A technician measured the fusing currents for a random sample of 6 fuses with the following results in amperes: 10.5 9.3 10.1 8.2 10.0 9.1 Use a statistical calculator to find the sample mean and sample standard deviation for these results. Carry out a suitable statistical test to determine if the mean fusing current is less than 10 A. 3(b) Another type of fuse has a mean fusing current = 13 A and standard deviation = 1 A. A random sample of six fuses was taken and the fusing current for each was measured; the fusing current for the first fuse in the sample was found to be 10 A. Assuming a normal distribution calculate the probability that the complete sample of 6 fuses will have a mean fusing current less than 12 A. 102 Institut Teknologi Brunei Engineering Mathematics C Past Phase Test 2 Example Name............................................................................................................................... A formula sheet and statistical tables are provided. Q1. Fig. Q1 Each of the four components shown in Fig. Q1 has the same probability, p, of continuing to function for 5000 hours. (a) When p = 0.9 calculate the probability that the complete system will continue to function for 1000 hours. (b) If the probability that complete system functions for 1000 hours is required to exceed 0.64, find the smallest possible value of p. Answers (a) 0.9639 (b) p = 0.6325 Q2. (a) A box contains 10 transistors. 6 of them are good and the other 4 are defective. Two transistors are removed from the box, one of them is tested and found to be good. What is the probability that the other one is also good? (b) A box contains 10 resistors. 6 of them are 1k resistors and the other 4 are 1M resistors. Resistors are drawn at random one at a time and their values checked until all 4 of the 1M resistors have been removed from the box. What is the probability that the fourth 1 M resistor will be the fifth resistor to be removed from the box? Answers (a) 5/9 (b) 12/630 = 4/210 Q3. (a) 10% of the items in a large batch are defective. A sample of 5 items is selected at random from the batch. Use the binomial distribution to obtain the probability that in the sample there will be (i) no defective items (ii) at least two defective items. 103 (b) An illuminated sign is made up incorporating 200 wire-filament lamps. The probability that any lamp will survive for less than 500 hours is known to be 0.002 (i.e. the probability it will survive more than 500 hours is 0.998). Use the poisson distribution to calculate the probability that after 500 hours the sign will have survived (i) with no lamp failures (ii) with two or more lamp failures. Answers (a)(i) (0.9)^5 = 0.59049 (a)(ii) 0.08146 (b) = 200*.002 = 0.4 (b)(i) 0.6703 (b)(ii) 0.0616 Q4. A technician sets up a coil-winding machine with the intention of producing coils having inductance 500 H. A random sample of six coils was taken and the inductance of each coil was measured. The results are given below in H: 495 505 510 520 490 495 (a) Use a statistical calculator to find the sample mean, x , and the sample standard deviation, s. (b) Determine the 95% confidence limits for the population mean. (c) Another technician winds 100 mH coils and a sample of 8 coils was found to have a sample mean x = 95 mH and sample standard deviation s = 5 mH. Carry out a two-tail hypothesis test at the 5% level of significance to determine if the mean value of coils produced by this process is 100 mH Answers (a) x = 502.5 s = 11.292 (b) t = 2.571, 95% Confidence limits 502.5 11.9 104 18. Miscellaneous Examples with Answers. 18.1. 8 resistors are chosen at random from a production line. The resistance of each was measured in ohms with the following results: 101.3 99.8 102.1 97.4 96.3 99.8 101.3 104.2 For this sample calculate the mean and standard deviation and estimate the 95% confidence limits for the mean resistance of the population Answer: 100.275, 2.545, 100.28 ñ 2.13 18.2. A machine is thought to produce small lead weights with a mass of 25 g. To test the working of the machine a sample of 12 weights was taken and found to have a mean of 27 g and a standard deviation of 2.2 g. Test the hypothesis that the machine is in working order using (a) 5% significance level (b) 1% significance level. Answer: Ho : = 25 (a) reject Ho at 5%, (b) reject Ho at 1% 18.3. If 3% of the electric bulbs manufactured by a company are defective, find the probability that in a sample of 100 bulbs (a) 0, (b) 1, (c) 2, (d) 3, (e) 4, and (f) 5 bulbs will be defective. Answer: (a) .04979 (b) .1494 (c) .2241 (d) .2241 (e) .1680 (f) .1008 18.4. In Q18.3 find the probability that (a) more than 5 (b) less than or equal to 2 bulbs will be defective. Answer: (a) .0838 (b) .4232 18.5. For a Student's 't' distribution with 15 degrees of freedom find the value of t such that (a) the area to the right of t is 0.01 (b) the area to the left of t is 0.95 (c) the area to the right of t is 0.10 (d) the area between -t and t is 0.95. Answer: (a) 2.602 (b) 1.753 (c) 1.341 (d) 2.131 18.6. A sample of 10 measurements of the capacitance of a capacitor gave a mean of 111 F and a standard deviation of 1.5 F. Find (a) 95% and (b) 99% confidence limits for the actual capacitance. Answer: 111 1.07 F. 18.7. The manufacturers state that the mean lifetime if a light-bulb is supposed to be 100 hours. A sample of 6 bulbs gave lifetimes of 88, 96, 110, 120, 80, 94 hours respectively. Test the hypothesis at the 5% level of significance, that the bulbs match up to the manufacturers statement. Answer t = -.335, acceptance region: -2.571<t<2.571. Inclined to accept the manufacturers claim. 18.8 Five wire-wound resistors were made by a standard procedure. Their resistances were measured in ohms to be: 2.8 3.0 2.7 3.3 3.1 For this data calculate the mean and sample standard deviation. Use your results to find (a) the 95% and (b) the 99% confidence intervals for the mean of the population of resistors constructed by this standard procedure. Answer mean = 2.98 s = 0.2387 (a) 2.98 0 .30 (b) 2.98 0 .49 105 18.9 Worked example (from Advanced General Statistics by B.C. Erricker, QA 276 ERR, p246) A machine is supposed to produce metal sheets of thickness 0.14 cm. To find if the machine is in proper working order a sample of 10 sheets is taken. The thicknesses are (in cm) 0.1275 0.1350 0.1300 0.1375 0.1325 0.1375 0.1325 0.1400 0.1350 0.1425 Using a level of significance of 5% is the machine in proper working order? Answer to 18.10: We carry out a Hypothesis test, since the washers can be too big or too small a two-tailed test is used. First use the calculator to obtain the mean and sample standard deviation of the given data: mean = 0.1350 s = 0.004564 1. Ho : = 0.1400 H1 : 0.1400 2. = 5% x 0.1350 0.1400 3. t = t = -3.46 s/ n 0.004564 / 10 4. For 9 degrees of freedom at the 5% level the critical values of t are t = 2.26. 5. The value of t is in the critical region. The test is significant at the 5% level. 6. Reject Ho . The machine is not in proper working order. 106 Example of Past End Test Q1 (a) Sketch two cycles of a periodic waveform having odd symmetry and state the Fourier coefficients that are zero as a result of this symmetry. Briefly describe what is meant by (i) even and (ii) half-wave symmetry for periodic waveforms. Illustrate your answer with sketches and in each case state the Fourier coefficients that are zero as a result of symmetry. [6 marks] v(t) volts (b) 20 -3 -2 -1 0 1 2 3 t (s) Fig. Q1(b) For the periodic rectangular pulse train shown in Fig Q1(b) state, with appropriate units, the period, the fundamental frequency and the duty cycle. Use the tables of Fourier series provided to obtain the Fourier series for the waveform in Fig. Q1(b) up to and including the fifth harmonic component (evaluate the Fourier coefficients to three significant figures). Use integration and symmetry to show that when a periodic rectangular pulse train has duty cycle k 1 , where N is a whole number, then every Nth harmonic will be absent from the Fourier series. N (State clearly the integration formulae used). [10 marks] Q2 (c) Find the rms value of the waveform in Fig.Q1(b). The period and amplitude of the waveform in Fig. Q1(b) are now held constant while the duty cycle is adjusted until the rms value is halved. What is the magnitude of the fundamental component after the adjustment has been carried out? [5 marks] A fully rectified voltage waveform, vin (t ) , is approximated by the first three terms of its Fourier series as follows: vin (t ) 19.1 12.7 cos(2000 t ) 2.55cos(4000 t ) . This waveform is applied to a coil of inductance L = 10 mH and internal resistance r = 5 connected in series with a load resistor of resistance 20 . (a) Calculate the corresponding terms in the Fourier series for (i) the current in the circuit and (ii) the voltage across the load resistor. [10 marks] (b) Use the table of Fourier series provided to obtain the next harmonic term in the Fourier series approximation of the fully rectified input voltage, vin (t ) . [5 marks] Answer: (a) v = 15.28+7.933cos(2000t-0.6747)-1.081cos(4000t-1.0121) (b) 1.091cos(6000t) 107 Q3 In a certain passive two-terminal device the voltage ( v volts) and current ( i amperes) are given by v 20 10sin( t ) 5sin(2 t ) and i 2.0 1.41sin( t 0.785) 1.12sin(2 t 1.11) , where = 100,000 rad/s. (a) Calculate the rms current, the power dissipated and the overall power factor. [10 marks] (b) If the two-terminal device is known to be a capacitor shunted by a resistor find the value of the capacitance. [4 marks] Answer: (a) rms current = 2.37 A power 46.23 W o.p.f = 0.907 (b) C = 0.994 μF ( R = 10 ohms) Q4 The resistance, R (ohm), of a certain type of voltage-dependent resistor is expected to vary linearly with the applied voltage, V (volt). An experiment was carried out to measure the resistance at a variety of voltages and the following results were obtained: V (volt) 5 10 R (ohm) 11 24 15 36 20 25 30 42 48 57 Calculate the correlation coefficient between resistance and voltage and test its significance at the 5% level. Are the experimental results consistent with a linear relationship? Show your working to prove that the regression line for R on V is given by R = 5.53 + 1.76 V [15 marks] Answer correlation coefficient r = 0.9876, rcrit = 0.8114 thus r is significant at 5% Q5 (a) A random sample of 6 electrolytic capacitors was taken from a large batch of capacitors all having the same nominal value of 470 F. The capacitance of each was measured with the following results in F: 475 485 460 487 451 495 Use a statistical calculator to find the sample mean and sample standard deviation. Calculate also the 95% confidence limits for the population mean. Comment on your result. Answer xbar = 475.5 s = 16.99, 475.5 17.8 108 [8 marks] (b) When a machine is working properly it produces wire-wound coils with a mean inductance of 100 mH. In order to test if the machine is working correctly a sample of 5 coils was taken and it was found that the sample mean was x 95 mH and the sample standard deviation was s = 3 mH. Carry out a suitable hypothesis test at the 5% level of significance to determine if the machine is working properly. [[9 marks] Answer: t = -3.737, tcrit = 2.776, reject Ho, accept H1 Q6 (a) The IT department in a large company has received some new Optical Character Recognition (OCR) software and carries out experiments to evaluate it. It is found that, on average, the new software introduces two errors per scanned sheet of A4 text. Assuming that the number of errors follow a Poisson distribution find the probability that the software introduces (i) no errors and (ii) two or more errors, when a single sheet of A4 text is processed. When 2 sheets of A4 text are processed what is the probability of there being one or more errors in total? Ideally the manager of the IT department would like to obtain OCR software capable of processing 2 sheets of A4 text with a less than 10% chance of there being one or more errors in total. What is the maximum number of errors per A4 sheet that the software could introduce on average and still meet this target? [10 marks] Answer: (i) 0.1353 (ii) 0.594, per page. (b) for 2 sheets 0.9817, maximum number of errors is 0.0526 errors Printed circuit boards are produced in a small workshop. It is found that on average 20% of the boards produced are defective and have to be scrapped. When 5 boards are produced use the binomial distribution to calculate the probability that (i) no defective boards are produced (ii) two or more defective boards are produced. How many boards should be produced if the probability of getting no defective boards is equal to the probability of getting one defective board? [8 marks] Answer: (i) 0.328 (ii) 0.263 last part , number of boards = 4 109 MATHCAD 1 Harmonics and Fourier Synthesis In Questions 1 and 2 you plot and become familiar with the basic harmonic terms that make up a Fourier series. In Questions 3, 4 and 5 you combine (add together) some harmonic terms to synthesize some standard periodic waveforms. 1. With x = t, plot the following graphs of v versus x for values of x between x = 0 and x = 2 (a) v = sin(t) (e) v = 4sin(3 t) (b) v = cos( t) (f) v = 2sin(4 t) (c) v = sin(t+/2) (d) v = 3sin(2 t) (g) v = 2sin(4 t + 0.2) Notice how the harmonics (d) to (g) perform 2, 3 or 4 cycles compared to the one cycle of the fundamental. Observe the effect of the initial phase in (c) and (g). Observe the different peak values. Try plotting some higher harmonics. Try adding several harmonics together and find the period of the resultant sum (it will be the same as the period of the fundamental). If = 1000 rad/s state the period T for each graph (a) to (g). Now without using Mathcad sketch two cycles of the graph of v = 2sin(5t) (i) v versus x = t and (ii) v versus t 2. Use Mathcad to plot about 2 cycles of the following graphs: (hint: first find the period T and use it to determine a suitable scale for the t axis) (a) v = sin(200t), (b) v = 40sin(40000t) (c) v = 250sin(2*106t) 3. Use Table 1 on page 7 of the Engineering Mathematics 'C' notes to synthesize (i.e. build up) a triangular waveform having peak value V = 10 volts. First plot the fundamental component alone as a function of the variable x = t for values of x from x = -4 to x = 4. Then plot the fundamental plus the next harmonic and so on. Continue this process until your graph is reasonably close to a triangular wave. How many harmonic terms are required to give a reasonable approximation? 4. Repeat the process of Question 3 above to synthesize a square wave of peak value V = 20 volts 5. Repeat the process of Question 3 to synthesize a sawtooth wave with peak value V = 5 volts. 6. Run the Fourier synthesis applets on the Faraday Server (the location of the applets will be given in class). 110 MATHCAD 2 Animation of Fourier Synthesis In part (a) Mathcad is used to synthesise a periodic waveform using N terms, where N can be a large number. In part (b) we animate this process. (a) Synthesis using N terms To synthesise waveforms using a large number of Fourier components it is necessary to obtain the general formula for the Fourier series. To assist with this it is convenient to use the summation symbol on the calculus palette (or press CTRL+SHIFT+4) and fill in the place- holders. For example the following procedure synthesizes a triangular waveform of height V volts to N terms. Type the bold text: :=1 (for simplicity we choose T = 2, hence = 1 ) N:=3 (the number of harmonics to use, start with N = 3 and then increase it) V:=10 (the peak value of the waveform) f(t) := 8V N 1 cos((2n -1)ω t) 2 π n=1 2n -12 (the Fourier series for the triangular wave was obtained from Table 1) Now plot the above function with different values of N and show two complete cycles of the waveform. Notice how the graph approaches a triangular wave as N increases. Repeat this procedure for some of the other waveforms given in the notes on page 7 in Table 1. Exercise: A student tries to synthesise one of the others waveforms in Table 1 by using f (t ) := 2V N n 1 (-1)n sin( n t ) n But finds that when this is plotted out it slopes the wrong way. Which waveform do you think was intended? Find out what is wrong and correct it. Try changing the sin to a cos in the above expression for f(t). Although This is equivalent to simply advancing the phases of the components it has a dramatic effect on the appearance of the synthesised waveform. (b) Animating the results. Animation can be a very useful tool for studying numeric output both directly and visually. You can create animations in Mathcad using a variable called FRAME in your equations. Mathcad creates a video by shooting a sequence of snapshots or frames. One frame is generated, in order, for each value of FRAME in the specified range. For animation you must first create a region whose appearance depends on FRAME. Make sure your worksheet is in automatic mode. Choose Animate from the View menu to open the Animate dialog box. Enclose the region(s) you want to animate in a selection rectangle. In the dialog box, specify starting and ending values of FRAME. Click "Animate." You should see a miniature rendition of your selection inside the dialog box. Mathcad redraws this once for each value of FRAME. This won’t necessarily match the playback speed since at this point, you’re just creating the animation, you’re not playing it back yet. You can play it back after the above procedure is complete. Animate the waveform synthesis of the triangular wave by defining f (t, FRAME ) : 8V 2 FRAME 1 2n 1 n 1 2 cos(( 2n 1) t ) The smallest value of FRAME should be set to 1 in the animation dialogue box.. Experiment to find the best largest value of FRAME to use. Play back the video slowly. Repeat for other waveforms. 111 MATHCAD 3 1. Orthogonality of sinusoids We have seen in class that the sinusoids are orthogonal i.e. when harmonic sines and cosines are multiplied together and integrated over the fundamental period T we either get an answer (area) of zero or T/2 depending on the values of n and m. When n and m are different we get zero. The important results are summarised in Appendix 1 on page 44 of your notes. Use Mathcad to verify the orthogonality relationships in Appendix 1 for sines and cosines as follows: First define any two whole numbers, n and m n:=3 m:=3 Then evaluate the integrals on page 40 (Appendix 1) of your notes. For example find the value of the symbolic integral below (it should equal T/2 because in this case n and m are both the same and equal to 3): T 0 sin(n 2 2 t )sin(m t )dt T T Hint: when entering the integral above Use CTRL + to get the symbolic equals sign 2 symbol '' on page 44 replace it with the equivalent expression T and anywhere you see the Now try changing the values of n and m to show that the above integral is always zero when n and m are different and equals T/2 whenever they are the same. Illustrate this result graphically by plotting sin(nx)* in(mx) over one cycle from x = 0 to x = 2. Repeat for different values on n and m. You should see that when n and m are different the areas above and below the x-axis always cancel out. Try the other integrals on page 44. 2. Symmetry (a) In Question 1 of Tutorial 2 there are six functions and you have been asked to determine if they are even or odd symmetry or neither. Verify your results obtained in the tutorial by plotting the six graphs using Mathcad. (b) Consider the odd function f (t ) : t 2 sin(2t ) . Plot the graph, note the symmetry Use Mathcad to show that a a t 2 sin(2t )dt 0 for any and every value of a. (c) Consider the even function f (t ) : t sin(2t ) . Plot the graph, note the symmetry. Use Mathcad to show that a a a t sin(2t )dt 2 t sin(2t )dt for any and every value of a. 0 Interpret your findings graphically. Now explain why bn = 0 for even functions. 112 3. Plotting Periodic Waveforms The Mathcad function sign(x) returns +1 if x is positive and -1 if x is negative. Sign(x) is useful for plotting periodic waveforms as indicated below where the sawtooth waveform is first plotted and then its Fourier series is found by integration. Work through the following Mathcad document to plot a periodic sawtooth waveform. When you have finished use the same idea to ot a periodic triangular waveform with the period and amplitude of your choice. 113 114 MATHCAD 4 1. Application of Fourier Series to Electrical Circuits. Use Mathcad to synthesize the output voltage, vout(t) for the example on p26 - p33of the Engineering Mathematics C course notes. To do this first enter the following expressions and then plot the graph (with N = 10 terms in the sum) as on page 33 Now reduce the number of terms in the sum, N, and notice that the graph hardly changes even with N = 1 because the higher harmonics actually contribute very little in this case. Notice the reduced ripple with the higher inductance. Now reduce the value of L and estimate the smallest value of L if the ripple peak-to-peak is required to be less than 5% of the d.c. level of the output voltage. Hint draw markers at the dc level 2.5% and change L by trial and error until the output ripple just fits inside. 2. RMS values using Fourier Series. We would like to verify that the formulae given for rms really do work correctly. To do this start a new worksheet and carry out problem 2 on page 35 as follows: 1 T 2 a0 2.4 a1 1.3 a2 2.7 b 1 2.0 b 2 3.1 a3 3.0 a4 0 b 3 1.5 b 4 2.7 i( t ) a0 b 1 sin t b 2 sin 2 t b 3 sin 3 t b 4 sin 4 t a1 cos t a2 cos 2 t a3 cos 3 t a4 cos 4 t T rms ( f ) 1 2 f ( t) d t T 0 rms ( i) 5.131 1 1 a02 a12 a22 a32 a42 b12 b22 b32 b42 5.131 2 2 Notice that the rms has been obtained above using two different methods, one method is by direct integration as on page 34 and the other method uses formula (20) on page 35 of the notes. They give the same answer. You can verify that changing the value of has no effect on the rms. You can also change the values of the Fourier coefficients to find the new rms values. 115 MATHCAD 5 (a) Regression and correlation exercises The built in functions slope(vx,vy) and intercept(vx,vy) mentioned in Tutorial 6 are used for finding regression lines and the function corr(vx,vy) is available for calculating the correlation coefficient. 1 Use Mathcad to find the regression line for V on T using the data given in the course notes on page 64. Plot the data points and the regression line. Your answer should be the same as was obtained in class on p70 i.e. V = 0.102 + 0.115T . 2 Calculate the correlation coefficient between V and T for the data on p64 (use the Mathcad function corr(x,y) , where x and y are vectors containing the x and y data respectively). Your answer should be the same as obtained in class by the long method i.e. r = 0.9901 3. Do the exercises in Tutorials 5 and 6 (b) Binomial Distribution Using Mathcad Mathcad has some useful built-in functions for the Binomial distribution: dbinom(k,n,p) - gives the probabilty density for the binomial distribution i.e. the probability of getting k successes in n trials when the probability of a single success is p. pbinom(k,n,p) gives the cumulative binomial probability distribution i.e the probability of getting k or less successes in n trials. 1. Use Mathcad to find the probability of getting (i) 4 successes in 6 trials, p = 0.5 i.e type dbinom(4,6,0.5) = (ii) 8 successes in 12 trials , p = 0.5 i.e dbinom(8,12,0.5 )= (iii) 8 or less successes in 12 trials, p = 0.1 i.e pbinom(8,12,0.1)= (iv) The probability of getting 4 or more sixes when a die is rolled 10 times. Check your results for (i) and (ii) manually. 2. A coin is tossed 4 times. Use the special built-in functions of Mathcad to find the probability of obtaining (i) no heads (ii) two heads (i) 3 heads or less. Check your results manually. Answer (i) dbinom(0,4,0.5) = 0.062 (ii) dbinom(2,4,0.5)= 0.375 (iii) pbinom(3,4,0.5) = 0.938 3 The probability that an I/C is defective is p = 0.05. A random sample of 5 I/C's are taken. Use Mathcad to find the probability of obtaining (i) no defectives (ii) one defective (iii) more than 2 defectives. Check your results manually. Answer (i) dbinom(0,5,0.05) = 0.774 (ii) dbinom(1,5,0.05) = 0.204 (iii) p(more than two) = 1 - pbinom(2,5,0.05) = 0.001158. 4. The probability that an I/C is defective is p = 0.05. A random sample of 100 I/C's are taken. Use Mathcad and the binomial distribution to find the probability of obtaining (i) no defectives (ii) 5 defectives (iii) more than 5 defectives. Check your results manually. Answer (i) dbinom(0,100,0.05) = 0.005921 (ii) dbinom(5,100,0.05) = 0.18 (iii) p(more than five) = 1 - pbinom(5,100,0.05) = 0.384. 5 A coin is tossed 10 times. Use Mathacad to find the probability of getting (a) 5 heads (b) 6 heads (c) 10 heads (d) less than or equal to 3 heads. (e) plot a bar graph to show the probabilities of r heads 0 ≤ r ≤10. Use your graph to find the most likely number of heads. Check your answers to parts (a) to (d) manually. Answers (a) dbinom(5,10.0.5)=0.246 (b) 0.205 (c) 9.766*10 -4 (d) 0.172 116 (c) The Poisson Distribution Using Mathcad Mathcad has some useful built-in functions for the Poisson distribution: dpois(x,) - gives the probabilty density for the Poisson distribution i.e. P(X = x) ppois(x, ) gives the cumulative Poisson probability distribution i.e P(X x) 1 Use the function dpois(x,) to check the answers to Example 7, p85 2. On average 2% of items are defective. In a sample of 50 items find the probability of obtaining (a) no defective items, (b) 1 defective item, (c). less than or equal to 3 defective items (d) more than 3 defective items Answer (a) dpois(0,1)=0.368 (b) dpois(1,1) = 0.368 (c) ppois(3,1) =0.981 (d) 1-ppois(3,1) = 0.019 3 Draw bar graphs to show the values of dpois(x,2) and ppois(x,2) where x = 0,1,2,3,4,5,6 117 MATHCAD 6 (a) The normal probability density (user-defined) Use Mathcad to provide your own definition of the normal probability density f ( x, , ) : 1 ( x )2 exp( ) 2 2 2 Now use this function to study a normal distribution with mean = 100 and = 5: 1. Plot the graph of f(x,100,5) for values of x from 80 to 120 2. Use symbolic integration (i.e.use CTRL . instead of =) to show that the total area under the graph of f(x,100,5) between x = - and x = is equal to 1. 3. Use numerical integration (i.e use = ) to: (a) show that the area under the graph between x = 105 and x = is 0.1587 (b) find the area between x = 95 and x = 110 (ans. 0.819) (c) find the area to the left of x = 92 (ans. 0.055) 4. Use Table 3 to confirm all your results in part 3. (Hint: first find the u values) (b) The normal probability density (built-in functions) Mathcad has some useful built-in functions for the normal distribution: dnorm(x,,) - gives the probabilty density for the normal distribution i.e. f(x, , ) defined in part (a) x pnorm(x, ,) gives the cumulative normal distribution i.e f ( x, , )dx Use these built-in functions to: 5 Plot the graph of dnorm(x,100,5) for values of x from 80 to 120 and compare it with the graph obtained in part 1 above 6. Confirm your answers to part 3 using pnorm instead of by direct integration 7. Look at the Quicksheet in the Resource Centre that deals with Statistics, Normally distributed Random Variables. This uses the built-in function rnorm(m, ,) to generate a vector of m random numbers from a normal distribution and plots the results on an histogram This procedure can be useful for simulating experimental results. Simulate the experiment of selecting n = 1000 resistors at random from a population of resistors with = 100 and = 5 , draw the histogram. How many resistors were greater than 105 . Check your answer against 3(a). Repeat for other values of n 118 MATHCAD 7 Using Mathcad to find Confidence Limits - when the population variance, , is unknown We have studied in class the important result that the confidence limits for the unknown mean, , of a normal population may be found from sample data using Table 7 for Student's 't', together with the formula _ x t s n The values of the sample mean and the sample standard deviation were obtained in class from the raw data using the special keys on the statistical calculator. The confidence limits were then found manually using Table 7, for Student's 't', and the above formula. This process of entering the raw data and calculating the confidence limits has been automated on Mathcad. A Quicksheet to do this may be found in the Mathcad Resource Centre in 'Statistics', 'Confidence interval for estimating a Normal mean- variance unknown'. A modified version of this Quicksheet has been placed on the Faraday Server at 'Programs', 'Course Handouts', 'HND', 'Maths C', 'Mathcad', 'Docs', 'confidencelimits.mcd'. _ The modified version of the Quicksheet allows the values for x, s, and n to be entered directly by the user without the need for the raw data. The Quicksheet calculates and prints on the screen the Upper and Lower Confidence Limits. The Task 1. Log on to the network (Faraday Server) and open the file 'confidencelimits.mcd' 2. Read the file. See how it works. 3. Use the file to find the following confidence intervals, check all your answers manually using Table 7 for Directed Study. n (sample size) {significance level) answers for U and L 100 s (sample standard deviation) 5 10 0.05 75.6 3.2 7 0.05 2405 44 12 0.01 50.7 2.1 8 0.01 470 8 15 0.05 U= L= U= L= U= L= U= L= U= L= _ x (sample mean) 119 MATHCAD 8 Hypothesis Tests Using Mathcad. We have studied in class the standard procedure for carrying out a Hypothesis test to test a population mean when the variance is unknown (see Engineering Mathematics C notes, Example 15, p87). This process of entering the raw data and carrying out a Hypothesis test has been automated in a Mathcad Quicksheet located in the Mathcad Resource Centre in 'Statistics', 'Hypothesis test for a normal mean-variance unknown'. A modified version of this Quicksheet has been placed on the Faraday Server at 'Programs', 'Course Handouts', 'HND', 'Maths C', 'Mathcad', 'Docs', 'hypothesis.mcd'. _ The modified version of the Quicksheet allows the values for x, s, , n and the value of the population mean 0 to be tested to be entered directly by the user without the need for the raw data. The Quicksheet carries out the Hypothesis test and shows the results on the screen. Both one- and two-tailed tests are catered for. The Task 1. Log on to the network (Faraday Server) and open the file 'hypothesis.mcd' 2. Read the file. See how it works. 3. Use the file to carry out the Hypothesis test of Example 15, page 87. 4. Do Tutorial 10 using the same file. 120