TX_1~ABS:AT/ADD:TX_2~ABS:AT 17 http://journals.cihanuniversity.edu.iq/index.php/cuesj CUESJ 2023, 7 (2): 17-25 ReseaRch aRticle Applying the Bayesian Technique in Designing a Single Sampling Plan Dler H. Kadir1,2, AbdulRahim K. Rahi3 1Department of Statistics, College of Administration and Economics, Salahaddin University-Erbil, Kurdistan Region - F.R. Iraq, 2Department of Business Administration, Cihan University-Erbil, Kurdistan Region, Iraq, 3Department of Business Administration, Dijlah University College, Iraq ABSTRACT The Bayesian sampling plans for production inspection are considered a technique of sampling inspection techniques for determining the characteristics of the sampling plan based on the assumption that the rate of defectives is a random variable that varies from one production batch to the next, resulting in a probability distribution f(p) that could be determined based on experience and the available quality information available. As part of this study, the parameters of a single Bayesian sampling plan (n,c) were derived using the beta- binomial distribution and compared with those of other single sampling plans. Researchers have identified (ALA company for soft drinks), which handles product quality control. One hundred and twenty production batches were selected, and the size of the batch and the number of defective items were used to determine the proportion of defective items, given that the variable varies randomly from one production batch to the next. Bayesian and decision-making models can be implemented to create a single sampling inspection process that is close to the actual quality level. The researchers discovered that when the decision-making model was used, the sample size was minimal compared to other inspection plans, leading to a low inspection cost. Keywords: Statistical quality control, average sample number, acceptance quality level, operating characteristic, Bayesian sampling plans INTRODUCTION Among the statistical tools used to control and monitor the quality of production are control charts and sampling inspection plans. Regarding sample testing plans, they are an accurate and appropriate method to obtain an estimate of the presence of one or more characteristics among the produced units. This is achieved by examining a small percentage of the production, which is randomly selected to determine whether to accept or reject production based on the results of the sample drawn. There are two methods of examination using the sampling method: The discriminatory examination method (by attributes), where the produced units are classified into defective and good units, or by the variable examination method (by variables) based on a standard such as height or weight. The examination may be based on the researcher’s or examiner’s experience, in addition to any other available information about the production process (prior information). This approach leads to the use of Bayesian theory and decision theory, and the adoption of Bayesian estimation for the quality parameter of production, depending on the loss function, to avoid making wrong decisions regarding the production process.[1,2] Due to the effort, cost, and time required to conduct a comprehensive examination, as well as cases known to statisticians where the above examination can be applied, the sampling examination method was used to evaluate the performance of the quality control department in the company. Since most of the staff working in this department are not statistical experts and are not familiar with statistical methods in the field of quality control, they rely on the accumulated experience of their members, examiners, and laboratory workers. For the aforementioned reasons, this research aims to shed light on the methods of sample examination and their use in estimating sample size and designing sampling examination plans that can minimize spoilage and reduce costs by making the right decision to accept or reject the produced batch. Corresponding Author: Dler H. Kadir, Department of Statistics, College of Administration and Economics, Salahaddin University-Erbil, Kurdistan Region - F.R. Iraq. E-mail: dler.kadir@su.edu.krd Received: April 01, 2023 Accepted: July 10, 2023 Published: August 05, 2023 DOI: 10.24086/cuesj.v7n2y2023.pp17-25 Copyright © 2023 Dler H. Kadir, AbdulRahim K. Rahi. This is an open-access article distributed under the Creative Commons Attribution License (CC BY-NC-ND 4.0). Cihan University-Erbil Scientific Journal (CUESJ) Kadir and Rahi: Bayesian Technique in Sampling Plan 18 http://journals.cihanuniversity.edu.iq/index.php/cuesj CUESJ 2023, 7 (2): 17-25 This research aims to investigate the method of sampling and decision-making regarding the acceptance or rejection of batches. This will be achieved through the design of a discriminatory sampling examination plan using the Bayesian method and applying it to the production of Pepsi Ala Soft Drinks Company to make informed decisions on whether to accept or reject the produced batch.[3,4] BAYESIAN SAMPLING PLANS One of the methods of sample examination is the Bayesian sampling plan, which is an alternative to the comprehensive (classic) examination, as well as the single, double, and sequential sampling plans. However, Bayesian sampling plans differ from single, double, and sequential sampling plans in that they deal with specifying plan parameters based on the percentage of defects in the product with random variation. This percentage changes from one production batch to another, as it has a probability distribution that can be determined from previous experience and available information on quality.[1,5] Bayesian plans have emphasized the importance of utilizing available information on quality, and this information is referred to as prior distributions. The prior distributions are used to obtain the post-quality posterior distribution, assuming that the type of sampling distribution being studied may be binomial with parameters (n,p), poisson with parameter (λ), or normal with parameters (µ,σ). Bayesian plans are of great importance in examining products, and it is necessary to provide a brief explanation of this topic to reach a Bayesian sampling plan (n, c) that reduces the total cost function of quality control. The cost function is the sum of inspection costs, costs of rejecting non-defective units (good), and costs of accepting defective units (bad).[6] Bayesian Plans Concept for Product Inspection Bayes’ plans have been named by this name in relation to the scientist (Thomas Bayes) (1702–1761), where Bayes is the first to use the prior distribution for defective percentages in statistical inference, and since 1960, attention began to focus on Bayes’ plans to test the product. Bayesian plans are named after the scientist Thomas Bayes (1702–1761), who was the first to use prior distributions for defective percentages in statistical inference. Since the 1960s, attention has been focused on Bayesian plans for testing products. In 1964, the scientist Hald (1981) was able to develop a model for the total cost function of quality control. Through this model, the parameters of the sampling plans are determined when the quality is fixed or the random variable has a prior distribution (prior distribution).[7,8] In 1968, the scientist Hald presented a model for Bayesian plans to examine products. This model is used to obtain the parameters of the individual Bayesian plan (n, c) by reducing the standard cost function of quality control, which is: R N n c n p p N n p p Q p w p dp p p P p w p dps m r r pr , , ( ( ) ( ) ( ) � � � � � �� � � � �� � � � � � 1 ��� � � � � � � � � � � 0 pr (1) Where (R = P+Q), denotes sample costs. P m -: The standard cost in cases of rejection and acceptance. P s : - The average cost of examination per unit in both cases of rejection and acceptance, and that: - P s ≥ P r ≥ P m , 0 < P r < 1, 0 < P s < 1 On equation (1) If the value of (P) is very small, we use the poisson distribution, that is,: b x np e np x np x , ! � � � � � � (2) And we change z p p m np M NP r r r= = =,� ,�� The form of the function will be: B c np B c mz P z, ,� � � � � � � � (3) Total Cost Function for Quality Control The scientist Hald (1981) developed a model that included the total costs of examination, acceptance, and rejection. The model aims to determine the individual sampling plan (n, c) for examining batch N of the product of quality p by applying filtering examination. He expressed these costs in the following formula: h x X p N n c nS nS N n A X x A x c, , , , , ,� � � � � �� � � �� � �1 2 1 2 (4) h x X p N n c nS nS N n R X x R x c, , , , , ��� � � � � �� � � �� � �1 2 1 1 (5) The examination and repair costs, in addition to the costs resulting from accepting the quantity (N-n) remaining after drawing the sample, represent the first part. The examination and repair costs, in addition to the costs resulting from rejecting the quantity (N–n), represent the second part. Equating equation (4) with equation (5) results in: P X x N x R A A Rr � � � � � � 1 1 2 2 The average cost in both cases of acceptance and rejection is equal to: In the event of acceptance n(S1+S2p)+(N–n)(A 1 +A 2 p) in case of refusal n(S 1 +S 2 p)+(N–n)(R 1 +R 1 p) And by entering the probability of acceptance of the product, P(p) and the probability of rejection, Q(p) since:- P p p x c b x n p B c n pr x c � � � �� � � � � � � � 0 , , ( , , ) Q p P p p x c b x n p E c n pr x c n � � � � � � � �� � � � � � � � � �1 1 1 , , ( , , ) Thus, the cost rate (p) is obtained in the cases of acceptance and rejection as follows: Kadir and Rahi: Bayesian Technique in Sampling Plan 19 http://journals.cihanuniversity.edu.iq/index.php/cuesj CUESJ 2023, 7 (2): 17-25 K p n S S p N n A A p P p R R p Q p � � � �� � � �� � � � � � �� � 1 2 1 2 1 2{( ) ( )} K p nk p N n k p P p k p Q ps a r� � � � � � �� � � � � � � � � � �� � (6) Where Q(p) = 1–P(p) becomes clear from equation (6), then: K p nk p N n k p P p k p P ps a r� � � � � � �� � � � � � � � � �� �( ( )1 � � � � �� � � � � � � � � � � �� �nk p N n k p P p k p k p P ps a r r ( ) � � � � �� � � � � � � � � � � � � � � � � �� � � � �� nk p N n k p P p N n k p N n k p P p s a r r( ) ( ) ( ) � � � � �� � � � � � � � � � � � � � � � � � � �� � �nk p N n k p P p Nk p nk p N n k p P p s a r r r( ) ( ) �� �� � � � � � � � �� � � � � � � �� � � � � � � � � nk p nk p N n k p P p N n k p P p Nk p s r a r r K p n k p k p N n k p k p P p Nk ps r a r r� � � � � � � � � �� � � � � � ��� �� � � � � �[ ] (7) The values of k r (p), k a (p), k s (p) express the rates of examination, acceptance, and rejection costs per unit, respectively.[9-12] FINDING THE SINGLE BAYESIAN PLAN (n, C) This method relies on the iterative method for determining the parameters of the single sampling plan (n, c). The method involves minimizing equation (7) k(p) subject to certain conditions of the operating curve function (OC). We find the smallest value of the function at k(p) (c = 0), then at (c = 1), then at (c = 2), and so on. Once the absolute minimum value is obtained, we stop and fix the parameters of the single sampling plan (n, c) at this value. It is important to note that the cost function model shown in equation (7) assumes a constant level of quality, but the quality level may change from one production batch to another due to random and attritional reasons that lead to qualitative deviations. Therefore, it is necessary to estimate the level of quality in the future by taking advantage of all available information about previous tests and information about the production process, which is supposed to be within control limits. Furthermore, natural qualitative changes that occur due to market competition should also be taken into account. It is worth noting that incorporating previous information available on quality levels, as well as estimated information from samples, leads to more accurate decisions regarding quality level estimates. The scientist Hald has emphasized this point and relied on the following expected total cost function K relative to the previous distribution of defective ratios f(p). K K p f p dp� � � � � �� � � BAYESIAN PLAN RELATIVE TO THE BETA DISTRIBUTION The beta distribution is considered one of the important statistical distributions in Bayesian plans. In this distribution, the percentage of defects is a random variable with a beta distribution, and its parameters can be estimated using the moment method. The probability function of the random variable p with (α, β) parameters takes the following form: f p B p p p O W , , , ( ) �������� . � � � � � �� � � � � � � � � � �1 1 0 1 0 1 1 In many cases, it cannot be assumed that p remains constant from one batch to another. For example, consider a machine used to produce a specific unit. After producing a batch, the machine is checked and put back into operation. For each batch, p can be determined according to certain distributions, which are referred to as the initial distributions of p. For this reason, the beta distribution was chosen as the initial distribution of p with (α, β) parameters. The expected value of the random variable for the beta distribution is α/ (α+β). This means that (β) must be greater than (α), and when estimating (α, β), it must be rounded to the nearest integer. If the estimated value lies between 0 and 1; then, it must be rounded to the expected value of p, to the nearest integer. This method allows us to use standard tables to determine the sampling plan and also shows us why the plans are not clearly sensitive to small changes in the parameters without taking into account the appropriate initial distributions.[13-15] Direct Formulas for Determining Individual Base Plan Parameters by Decision Model To define the parameters of the single Bayesian Economic Statistical (BES) plan (n, c) for product inspection, a formula for the expected risk must be developed and specified directly for the parameters of the sampling plan. We can rely on the definition of risk provided by Guthrie and Johns, who defined it as the sum of examination costs plus the loss resulting from wrong decisions. It is well-known that examination costs depend on the volume. It represents the loss resulting from accepting defective units and the loss resulting from rejecting good units. The expected risk formula, under the conditions of binomial sampling, takes into account the distributions of continuous defective percentages, which are as follows: R f p n c n S R P S R A R P P Q P f p dpr Pr [ ( ), , ] {( ) ( ) ( ) ( ) ( ) ( ) } � � � � � � � 2 2 1 1 2 2 0�� � � � � � � � �� � �� � N R P R A R P P f P dp N n n R A p f r Pr r { ( ) ( ) ( ) ( ){ 2 1 2 2 0 1 1 1 2 1 ppr� � (8) When neglecting the upper limits, equation (8) is reduced to the following form: Kadir and Rahi: Bayesian Technique in Sampling Plan 20 http://journals.cihanuniversity.edu.iq/index.php/cuesj CUESJ 2023, 7 (2): 17-25 R f p n c An BN C N n n [ ( ), , ] ( )� � � � 1 (9) So: A S R S R R A P P f P dpP r pr � � � � � � ��[( ) ( ) ( ) ( ) ( )2 2 1 1 2 2 0 B R R A R P P f P dpP r pr � � � � ��2 1 2 2 0( ) ( ) ( ) C R A P f p pr r� � � � 1 2 11 1( )( ) ( ) ( ) ( ) ( , ) ( , )P P f P dp IB P IBPr pr Pr r Pr � � � ��0 1� � � � When we derive equation (9) with respect to n and equate the derivative to zero, we obtain the optimal value of n (n*). To find the sample size necessary to examine batch N of the product, assuming binomial sampling and that the defective percentages change from one production batch to another, we can use the following formula: The random variable has a prior distribution equal to beta with (α, β) parameters, and the optimal value of n can be obtained from the following equation. n R A P P N B S R P S R R A PIB r r* ( ) ( ) ( , )[ ) ( ) ( ) ( � � � � � � � � � 1 1 1 2 2 1 1 2 2 1 2 � � � � PPr r Pr P IB( , ) ( , ))]� � � �� � � � � � � � � � � � � � � � � �1 1 2 When the values of (α, β) are integers, the relationship between the incomplete beta function and the cumulative binomial function can be derived. This relationship can be used to extract the following: IB C P ppr x x r x r x� � � � � � � � �, ( )� � � � � � � � � � � �� 1 1 11 IB C P ppr x r x r x� � � � � � � � � ��� � � � � � � � � � ��1 1 1 1, ( ) The number of acceptance can be obtained from the following relationship: c n� �� �� 2 3 θ∘: Critical quality level. Direct Formulas for Determining Single Bayes Plan Parameters from Hald Model Determining the parameters of individual Bayesian plans (n, c) for product inspection requires lengthy iterative calculations to find the values (n, c) that achieve the smallest expected total cost or the smallest standard cost. Research in this area has focused on finding formulas that efficiently and quickly obtain optimal parameter values. Continuous studies and research have led to formulas used directly for large production batches where the quality of the batches is a random variable with a prior distribution f(p), which is continuous and differentiable at points adjacent to a point (p = pr). The discontinuous distribution of defective percentages was discussed by the scientist Hald in 1965, and direct formulas were developed by Hald in 1968, which were supported by auxiliary tables. These formulas can be used to extract Bayesian plans in distributions such as gamma-poisson and beta-binomial.[8,16-19] It is then transformed into the standard cost function (R, N, n, c), which, in turn, requires defining each of the standard loss rates for acceptance d a , rejection d r , and examination d s as follows: d K K A Ra a m� � � ( ) ( )2 2 (10) d K K A Rr r m� � � ( ) ( )2 2 d K K A Rs s m� � � ( ) ( )2 2 If all units of the product are classified correctly, the value of K m is the smallest cost per unit, that is, in the case of acceptance when (P ≤ P r ) and rejection d r when (P > P r ) (). In other words, Km represents. K A A P f p dp R R P f p dpm pr pr � �� � � � � �� � � �� �1 20 1 2 1 K A A P f p dp R R P f p dp R R P f p dp m pr pr � �� � � � � �� � � � � �� � � � � � � 1 2 0 1 2 0 1 1 2 0 K K A R P P f p dpm r r pr � � � �� � � ��( )1 2 0 Among them, we find that: d P P f p dpr r pr � �� � � ��0 The value of d a ,d s in terms of d r , as: d d P Pa r r� � � d d S R S R P A Rs r� � � � � � �{( ) ( ) } ( )1 1 2 2 2 2 K K A R dm r r� � �( )�2 2 So it is: NK K A R dm r r� � �� �2 2 � (11) equations (11), (10) are then substituted into equation (12) and the equation of the standard cost function defined in equation (11) is obtained. Kadir and Rahi: Bayesian Technique in Sampling Plan 21 http://journals.cihanuniversity.edu.iq/index.php/cuesj CUESJ 2023, 7 (2): 17-25 R N n c K N n c K A R m, , , , � � � � � � �2 2 (12) R N n c nds N n d n, ,� � � � �� � � � d n d P P B c n p f p dpr r� � � � �� � � � � �� , ,0 1 Depending on the equation � � � � � 1 2 2 2 2 � � � p q A R B k k r r s m ( ) ( , )( ) � � � � � � � � 1 2 2 1 3 11 2 3 1 3 1 1 � � � � � � � � � � �� � � � , , ( ) p q p qr r r r The value of n necessary to check the batch (N) is the value defined by the following relation: n N* � �� �1 2 As for the number of acceptance of c, it is extracted from the following relationship: c n pr * *� � �1 Whereas: β β α= − −1 ˆ ˆ 1 2r r p q To find the value of the standard cost function R 0 (N) corresponding to the optimal sampling plan ( n* , c* ), which we will symbolize R 0 (N), the following equation will be relied on: R N n ds and d k k A Rs s s 0 1 2 2 2 2 2� � � � �� � � � � * �� �� ( ) � � Therefore, the value K(P) of the expected total cost of quality control is equal to: k p R N A R NKm� � � � � �� � �0 2 2 RESULTS The process of improving product quality requires relying on modern scientific methods. By utilizing modern practical methods and adhering to standard specifications, products can be made suitable and conform to the desired specifications of consumers. This not only elevates the status of the production facility in local and global markets but also enhances the value of these products in these markets. Therefore, it is essential to establish quality control requirements fully. This includes prioritizing standard and manufacturing specifications for input, process, and output elements. One of these requirements is to identify and provide a scientific method for examining materials and products to ensure the reduction of damage and to ensure the regular flow and handling of circulation during production processes in the facility. Application of the Decision-Making Model Based on the decision-making model, a set of Bayesian economic-statistical (BES) plans was developed to test the product, depending on the previous distribution of defective percentages (Beta-Prior). The parameters of the individual BES plan were determined according to the decision-making model to obtain the values of n and the acceptance number c. The inspection plans for this product are shown in Table 1, taking into account the levels of quality and sizes of production batches. The parameters of the sampling plan required to check the daily production of the 1.5-L (Pepsi Ala) product of quality (X p = 0.005349) and value (P r = 0.00617) were extracted using this model. The values obtained were (n,c) = (1495, 14), and the expected risk value for the sampling plan was also determined to be (1495, 14). The value of R{f(p), n, c} was found to be equal to $43,210. Hald Model Application Since the distribution of the defective percentages f(p) is one of the continuous and derivable distributions at point (P = P r ), a set of Bays plans will be extracted from the direct formulas created by (Hald), as the set of Bays plans necessary to check the product, which is defined from equation (14), must be calculated before that each of: - Examination cost rate per unit (1) k S S ps � � � � � �� � �1 2 0 0011 0 03 0 005349 0 00126. . . . �$ Rejection cost rate per unit (2) k R R p kr s� � �1 2 Examination cost rate per unit k A A ps � �1 2 (3) ( )+ =0 0.208 0.005349 0.0011 $ As well as the values of the ingredients (4, 5, 6, and 7): (4) � p p f p dpr pr �� � � ��0 � � � � �p IB pIBr pr pr� � � �, ( , )1 � � �� � �� �� � � 0 006179 0 789972 0 005349 0 734239 0 000954 . . . . . (5) k k A R P P f p dpm r r pr � � � ��( ) ( ) ( )2 2 0 � � � �� �� � �0 00126 0 178 0 0009544 0 0010901. . . . ) (6) � � � � � 1 2 2 2 2 � � � p q A R B k k r r s m ( ) ( , )( ) �� �1 2 148 25059� . Whereas: (7) α β= = = = =2 20.0061,    0.208,    0.03,    25, ˆ    4648ˆrp A R � � � � � � � � 2 2 1 3 11 2 3 1 3 1 1 � �� � � �� � � � � � �� � � � ( ) p q p qr r r r Kadir and Rahi: Bayesian Technique in Sampling Plan 22 http://journals.cihanuniversity.edu.iq/index.php/cuesj CUESJ 2023, 7 (2): 17-25 Table 1: Bayesian plans to test the product according to the distribution of beta-prior extracted from the decision-making model Quality level 0.005 Quality level 0.004 Quality level 0.003 Quality level 0.002 Quality level 0.001 Batch size Acceptance number Sample size Acceptance number Sample size Acceptance number Sample size Acceptance number Sample size Acceptance number Sample size c n c n c n c n c n 6 669 5 527 4 449 3 398 7 753 10,000 6 701 5 553 4 471 4 418 7 790 11,000 7 733 5 578 4 492 4 436 8 825 12,000 7 763 5 602 4 512 4 454 8 859 13,000 7 791 6 624 5 532 4 471 8 891 14,000 8 819 6 646 5 550 4 488 9 923 15,000 8 846 6 667 5 569 4 504 9 953 16,000 8 872 6 688 5 586 5 519 9 982 17,000 8 897 6 708 5 603 5 534 9 1011 18,000 9 922 7 727 6 620 5 549 10 1038 19,000 9 946 7 746 6 636 5 563 10 1065 20,000 9 969 7 765 6 651 5 577 10 1092 21,000 9 992 7 783 6 667 5 591 11 1117 22,000 9 1014 7 800 6 682 5 604 11 1143 23,000 10 1036 8 817 6 696 6 617 11 1167 24,000 10 1058 8 834 6 711 6 630 11 1191 25,000 10 1079 8 851 7 725 6 642 11 1215 26,000 10 1099 8 867 7 739 6 654 12 1238 27,000 11 1119 8 883 7 752 6 666 12 1261 28,000 11 1139 8 899 7 766 6 678 12 1283 29,000 11 1159 8 914 7 779 6 690 12 1305 30,000 11 1178 9 929 7 792 6 701 13 1327 31,000 11 1197 9 944 7 804 6 712 13 1348 32,000 11 1215 9 959 8 817 7 724 13 1369 33,000 12 1233 9 973 8 829 7 734 13 1389 34,000 12 1251 9 987 8 841 7 745 13 1410 35,000 12 1269 9 1001 8 853 7 756 14 1430 36,000 12 1287 9 1015 8 865 7 766 14 1449 37,000 12 1304 10 1029 8 876 7 776 14 1469 38,000 13 1321 10 1042 8 888 7 787 14 1488 39,000 13 1338 10 1055 8 899 7 797 14 1507 40,000 13 1355 10 1069 8 910 7 807 15 1526 41,000 13 1371 10 1082 9 921 7 816 15 1544 42,000 13 1387 10 1094 9 932 8 826 15 1562 43,000 13 1403 10 1107 9 943 8 836 15 1581 44,000 14 1419 11 1120 9 954 8 845 15 1598 45,000 14 1435 11 1132 9 964 8 854 15 1616 46,000 14 1450 11 1144 9 975 8 864 16 1634 47,000 14 1466 11 1156 9 985 8 873 16 1651 48,000 14 1481 11 1168 9 995 8 882 16 1668 49,000 14 1496 11 1180 9 1005 8 891 16 1685 50,000 Kadir and Rahi: Bayesian Technique in Sampling Plan 23 http://journals.cihanuniversity.edu.iq/index.php/cuesj CUESJ 2023, 7 (2): 17-25 Table 2: Bayesian plans to test the product extracted from the (Hald) model Quality level 0.005 Quality level 0.004 Quality level 0.003 Quality level 0.002 Quality level 0.001 Batch size Acceptance number Sample size Acceptance number Sample size Acceptance number Sample size Acceptance number Sample size Acceptance number Sample size c n C n c n c n c n 10 1162 8 798 7 671 3 588 6 529 10,000 11 1222 8 839 7 707 3 620 6 557 11,000 11 1278 8 879 8 741 3 650 7 584 12,000 11 1333 9 917 8 773 3 679 7 611 13,000 12 1385 9 954 8 804 3 706 7 636 14,000 12 1436 9 989 8 835 3 733 7 660 15,000 12 1485 9 1023 8 864 3 759 7 683 16,000 12 1532 10 1057 9 892 3 784 7 706 17,000 13 1578 10 1089 9 920 3 808 8 728 18,000 13 1623 10 1120 9 946 3 832 8 750 19,000 13 1667 10 1151 9 972 3 855 8 771 20,000 14 1709 10 1181 9 998 3 878 8 791 21,000 14 1751 10 1210 9 1022 3 900 8 811 22,000 14 1791 11 1238 9 1047 3 921 8 830 23,000 14 1831 11 1266 10 1070 3 942 8 849 24,000 15 1870 11 1293 10 1094 3 963 8 868 25,000 15 1908 11 1320 10 1116 3 983 8 886 26,000 15 1945 11 1346 10 1139 3 1003 9 904 27,000 15 1982 11 1372 10 1161 3 1022 9 922 28,000 15 2018 12 1397 10 1182 3 1041 9 939 29,000 16 2054 12 1422 10 1203 3 1060 9 956 30,000 16 2088 12 1446 11 1224 3 1078 9 973 31,000 16 2123 12 1470 11 1245 3 1096 9 989 32,000 16 2156 12 1494 11 1265 3 1114 9 1006 33,000 17 2190 12 1517 11 1285 3 1132 9 1022 34,000 17 2222 13 1540 11 1304 3 1149 9 1037 35,000 17 2255 13 1563 11 1323 3 1166 10 1053 36,000 17 2287 13 1585 11 1342 3 1183 10 1068 37,000 17 2318 13 1607 11 1361 3 1200 10 1083 38,000 18 2349 13 1629 12 1380 3 1216 10 1098 39,000 18 2380 13 1650 12 1398 3 1232 10 1113 40,000 18 2410 13 1672 12 1416 3 1248 10 1127 41,000 18 2440 13 1693 12 1434 3 1264 10 1142 42,000 18 2469 14 1713 12 1452 3 1280 10 1156 43,000 18 2499 14 1734 12 1469 3 1295 10 1170 44,000 19 2527 14 1754 12 1486 3 1310 10 1184 45,000 19 2556 14 1774 12 1503 3 1325 10 1197 46,000 19 2584 14 1794 12 1520 3 1340 10 1211 47,000 19 2612 14 1813 13 1537 3 1355 11 1224 48,000 19 2640 14 1833 13 1553 3 1370 11 1237 49,000 19 2667 14 1852 13 1570 3 1384 11 1251 50,000 Kadir and Rahi: Bayesian Technique in Sampling Plan 24 http://journals.cihanuniversity.edu.iq/index.php/cuesj CUESJ 2023, 7 (2): 17-25 Table 3: Bayesian plans to test the product according to the decision-making model and the (Hald) model Hald model Decision-making model Batch size Pn (c) c n Pn (c) c n 0.005998286 10 1162 0.00580307 6 669 10,000 0.00610687 11 1222 0.005768515 6 701 11,000 0.006049403 11 1278 0.005919349 7 733 12,000 0.005994006 11 1333 0.005886681 7 763 13,000 0.006107626 12 1385 0.005856515 7 791 14,000 0.006056638 12 1436 0.00600874 8 819 15,000 0.006008444 12 1485 0.005979344 8 846 16,000 0.005962933 12 1532 0.005951307 8 872 17,000 0.006079027 13 1578 0.005924596 8 897 18,000 0.006035578 13 1623 0.006076854 9 922 19,000 0.005993691 13 1667 0.006050899 9 946 20,000 0.006110937 14 1709 0.006026232 9 969 21,000 0.006070984 14 1751 0.006001765 9 992 22,000 0.006033416 14 1791 0.005978548 9 1014 23,000 0.00599631 14 1831 0.006130671 10 1036 24,000 0.006113404 15 1870 0.006107137 10 1058 25,000 0.006078104 15 1908 0.00608484 10 1079 26,000 0.006044122 15 1945 0.006063756 10 1099 27,000 0.006010518 15 1982 0.00621547 11 1119 28,000 0.00597818 15 2018 0.006194081 11 1139 29,000 0.006094842 16 2054 0.00617284 11 1159 30,000 0.006064192 16 2088 0.006152794 11 1178 31,000 0.006032961 16 2123 0.006132879 11 1197 32,000 0.006003807 16 2156 0.00611413 11 1215 33,000 0.006119773 17 2190 0.006264815 12 1233 34,000 0.006091371 17 2222 0.00624578 12 1251 35,000 0.006062356 17 2255 0.00622686 12 1269 36,000 0.006034483 17 2287 0.006208054 12 1287 37,000 0.006007724 17 2318 0.006190397 12 1304 38,000 0.006123612 18 2349 0.006339673 13 1321 39,000 0.006096696 18 2380 0.006321743 13 1338 40,000 0.006070874 18 2410 0.006303915 13 1355 41,000 0.006045269 18 2440 0.006287227 13 1371 42,000 0.006020722 18 2469 0.006270627 13 1387 43,000 0.005995538 18 2499 0.006254115 13 1403 44,000 0.006111111 19 2527 0.006401838 14 1419 45,000 0.006086596 19 2556 0.006385069 14 1435 46,000 0.006063111 19 2584 0.006369427 14 1450 47,000 0.006039808 19 2612 0.006352826 14 1466 48,000 0.006016683 19 2640 0.006337342 14 1481 49,000 0.00599455 19 2667 0.006321932 14 1496 50,000 And I extracted my value (λ 1 ,λ 2 ), so the value of n necessary to check the batch is N = 39388, which is the value specified by the following relationship: n N* � �� �1 2 n units* . . �� � � � � � �12 17582 39388 55 4084 2361 c n pr * * �= As for the acceptance number c, it is extracted from the relationship, so that β β α= − −1 ˆ ˆ 1 2r r p q Thus, the value of the acceptance number corresponding to the sample size (n = 2361) is equal to: �1 4648 0 0061 25 0 9939 0 5� � �� � �� �� � �. . . �1 3 0053� . Accordingly: c units* . . �� � � � �2361 0 061 3 0053 17 Therefore, the single sampling plan necessary to check the production rate is N = 39388, and extracted from the (Hald) model is (2361.17), and this plan means that the examination of a random sample of (2361) is invalid. If the number of defective (damaged) units in the sample is equal to (17) champion or less all units are accepted, otherwise, the batch is rejected. As for the total cost of quality control resulting from the sampling plan (2361.17), it will be extracted based on the smallest standard cost R 0 (N) achieved in the optimal sampling plan (2361.17), as R n ds0 1 2 22� � �� �* � � ds k k A R s m� � � ( ) ( )2 2 ds = 0 000954. R0 2 2361 148 2506 55 4084 0 00954� � � � �[ . . ]( . ) R0 4 4162= . Therefore, the value of the expected total cost k(p) of quality control is equal to: k p R A R NKm� � � �� � �0 2 2 � � � � � �4 4162 0 178 49388 0 001091. . . = 42 9731. �$ Table 2 includes all the results of Bayesian plans to test the 1.5-L liquid Pepsi product extracted from the (Hald) model according to the previous distribution (Beta), classified according to quality levels X p = 0.001(0.001)0.005 and batch sizes N = 10,000(1000)50,000. Calculating the Value of the Defective Fraction in the Unexamined Quantities According to the decision-making models and the (Hald) model, a group of Bayesian plans have been extracted to test the product. After this extraction, it is necessary to determine the expected value of the expected fraction of the defective Kadir and Rahi: Bayesian Technique in Sampling Plan 25 http://journals.cihanuniversity.edu.iq/index.php/cuesj CUESJ 2023, 7 (2): 17-25 fraction in the unexamined quantities (N–n) which will be accepted based on the acceptance of the sample, and then, we will depend on the value of the average of the subsequent distribution for the defective lineage (E(p/x)) when (X = c), that is, (Pn(c)) and it has become clear to us that the subsequent distribution f(p/x) is also a house with features (α+β+n, x+α), and therefore, it is E p x P x x nn |� � � � � � � � � � � � And when X = c is P c c nn � � � � � � � � � The following Table 3 includes a comparison of BIS plans according to the (Hald) model and the decision-making model and at the level of quality (X P = 0.005349) and the values of (Pn(c)) and for each of the plans of the decision-making model and the (Hald) model. Table 3 shows that the expected value of the fraction of defective items in the accepted quantities (N–n) is 0.6% according to both the decision-making model and the (Hald) model. This value corresponds to the permissible percentage of defective items (LTPD) approved by Pepsi Company (ALA) for soft drinks. The correspondence of the average value of (Pn(c)) with the value of (LTPD) indicates the efficiency of the BIS plans, which take into account all available information about the quality when estimating the quality of subsequent production batches. This congruence underscores the importance and efficiency of the BIS plans. Moreover, the actual production quality level ( Xp = 0 005349. ) shows that the sample size for different batch sizes is smaller compared to other sampling inspection plans, which reduces examination costs and total costs. CONCLUSION 1. The appropriate probability distribution to represent the defective percentages of the actual production is the beta- binomial distribution with a rate of (0.005349) 2. After applying the Bayes model in designing the sampling inspection plan, it was found that the parameters of this plan are (n = 1495) and (c = 14), and for the quality level of the actual production ( Xp = 0 005349. ), we find that the sample size for the different batch sizes is small compared to other sampling plans, which means reducing examination costs and therefore the total costs. REFERENCES 1. D. H. Kadir and A. R. K. Rahi Al-Harthy. Application of Bayesian Technique for Ala Pepsi Softdrink Company in Sampling Plan Design. University of Sulaimani, Iraq, 2007. 2. A. M. Q. Muhammad. A Study of Restricted Bayesian Acceptance Sampling Examination Plans for Quality Control with Practical Application. MSc Dissertation, College of Administration and Economics. University of Baghdad, 1999. 3. B. Ahmed and H. Yousof. A new group acceptance sampling plans based on percentiles for the Weibull Fréchet model. Statistics, Optimization and Information Computing, vol. 11, pp. 409-421, 2023. 4. D. S. Al-Janibi. Using Decision-Making Methods to Build the Best Model of the Cost Function in Quality Control. Ph.D. Dissertation. College of Administration and Economics. University of Baghdad, Iraq, 1991. 5. M. Aslam, N. Khan and A. H. Al-Marshadi. Design of variable sampling plan for pareto distribution using neutrosophic statistical interval method. Symmetry, vol. 11, p. 80, 2019. 6. A. Banihashemi, M. S. F. Nezhad and A. Amiri. A new approach in the economic design of acceptance sampling plans based on process yield index and Taguchi loss function. Computers and Industrial Engineering, vol. 159, p. 107155, 2021. 7. A. Hald. Bayesian single sampling attribute plans for continuous prior distributions. Technometrics, vol. 10, pp. 667-683, 1968. 8. A. Hald. Statistical Theory of Sampling Inspection by Attributes. Academic Press Inc., London, 1981. 9. D. H. Kadir, D. M. Saleh and D. I. Jamil. Comparison between four methods to construction number of defectives control chart. Journal of Arts, Literature, Humanities and Social Science, vol. 39, pp. 538-550, 2019. 10. D. M. Saleh and D. I. Jamil. Comparison between two estimators by using process capability with application. Journal of Arts, Literature, Humanities and Social Sciences, vol. 39, pp. 551-559, 2019. 11. N. H. Mahmood, R. O. Yahya and S. J. Aziz. Apply binary logistic regression model to recognize the risk factors of diabetes through measuring glycated hemoglobin levels. Cihan University-Erbil Scientific Journal, vol. 6, pp. 7-11, 2022. 12. D. M. Saleh, D. H. Kadir and D. I. Jamil. A comparison between some penalized methods for estimating parameters: Simulation study. Qalaai Zanist Journal, vol. 8, pp. 1122-1134, 2023. 13. K. I. Mawlood and R. O. Yahya. Using dynamic linear models and kalman filter for modeling and forecasting electricity load in Erbil city. Zanco Journal of Humanity Sciences, vol. 22, pp. 347-373, 2018. 14. Z. A. Omar, R. S. Abduljabar, S. M. Sajadi, S. A. Mahmud and R. O. Yahya. Recent progress in eco-synthesis of essential oil-based nanoparticles and their possible mechanisms. Industrial Crops and Products, vol. 187, p. 115322, 2022. 15. D. Prajapatin, S. Mitra and D. Kundu. Bayesian sampling plan for the exponential distribution with generalized Type-II hybrid censoring scheme. Communications in Statistics-Simulation and Computation, vol. 52, no. 2, pp. 533-556, 2023. 16. G. B. Wetherill. Sampling Inspection and Quality Control. 2nd ed. Chapman and Hall, New York, USA, 1977. 17. D. C. Montgomery. Introduction to Statistical Quality Control. 4th ed. John Wiley Sons Inc., New York, USA, 2001. 18. D. C. Montgomery. Introduction to Statistical Quality Control. 5th ed. John Wiley Sons Inc., New York, USA, 2005. 19. A. I. Al-Omari. Acceptance sampling plans based on truncated life tests for Sushila distribution. Journal of Mathematical and Fundamental Sciences, vol. 50, no. 1, pp. 72-83, 2018.