The Elsmar Cove Wiki More Free Files The Elsmar Cove Forums Discussion Thread Index Post Attachments Listing Failure Modes Services and Solutions to Problems Elsmar cove Forums Main Page Elsmar Cove Home Page

Go Back   The Elsmar Cove Forum > Common Quality Assurance Processes and Tools > SPC Monitoring and Statistical Analysis Techniques
Forum Username

Elsmar Cove Forum Visitor Notice(s)


Elsmar Cove Forum Sidebar
Custom Search
Monitor the Elsmar Forum
Monitor New Forum Posts
Follow Marc & Elsmar
Elsmar Cove Forum RSS Feed  Marc Smith's Google+ Page  Marc Smith's Linked In Page   Marc Smith's Elsmar Cove YouTube Page  Marc Smith's Facebook Page
Elsmar Cove Groups
Elsmar Cove Google+ Group  Elsmar Cove LinkedIn Group  Elsmar Cove Facebook Group
Sponsor Links







Donate and $ Contributor Forum Access
Sponsored Links
Courtesy Quick Links

Links that Elsmar Cove visitors will find useful in your quest for knowledge:


Howard's
International Quality Services

Atul's
Symphony Technologies

Marcelo Antunes'
SQR Consulting

Bob Doering's
Correct SPC - Precision Machining


NIST's Engineering Statistics Handbook

IRCA - International Register of Certified Auditors

SAE - Society of Automotive Engineers

Quality Digest Portal

IEST - Institute of Environmental Sciences and Technology

ASQ - American Society for Quality


Related Topic Tags
inspection (general), inspection methods and plans, oc curve (operating characteristic curve), samples and sampling plans
Reply
 
Thread Tools Search this Thread Rate Thread Content Display Modes
  #1  
Old 1st July 2012, 01:46 AM
magomago magomago is offline
Shy Poster (1 to 5 Posts)

 
Registration Date: May 2011
 
Posts: 1
Thanks Given to Others: 0
Thanked 1 Time in 1 Post
Karma Power: 9
Karma: 15
magomago has less than 100 Karma points so far.
Question OC Curves for Double Sampling Plan - How are they Derived?

Hi all,

studying for CQE here and I have some questions about OC curves for doubling sampling plans I understand single sampling plans well and even modeled it matlab just fine.

However, shifting to a double sampling plan, I found that the book did a horrible job describing it as seen in the attachment.

so I did some googlies and found a better source that made MORE sense to me as seen bin the attachment.

but when I model it, I can't seem to get the right curve (See last attachment)

I spent a few hours and still can't crack this. I think it might be due to the double summation

Lets say I had sigma_from1_to3 (y) * sigma_from 1_to_3_(x)....the way I'm calculating this in matlab (See below) is like this

y1 *( x1 + x2 + x3) + y2 *( x1 + x2 + x3) + y3 *( x1 + x2 + x3)

Is that right? Conceptually it is: I'm assessing all different probabilities, of accepting a certain # of defectives in the second sample, relative to the first.

Any help?

Code:
clear all
close all
n1=50
ac1=0
re1=3

n2=75
ac2=3
re2=4

p=[0:.001:.2]

%% this is right for sure  Pacceptance if NCR <= ac1
PaTotal=[]
for d1 = 0:ac1
    MaxCombos = ...
    (factorial(n1) ./ (factorial(d1) .* factorial(n1-d1)))
    
    Pa1array=[]
    for ii = 1:length(p)
        Pa1_Dconstant_foraPvalue = p(ii).^d1 .* (1-p(ii)).^(n1-d1);
        Pa1array = [Pa1array; Pa1_Dconstant_foraPvalue];
    end
    
    Pa1 = MaxCombos .*Pa1array;
    PaTotal=[PaTotal Pa1];
end
Pa1Final = sum(PaTotal,2)
figure(1)
% pa1plot=plot(Pa1Final,'-xg')

%%
Pa1Pa2Total=[];
Pa2Total=[]

for d1_1 = ac1+1:re1-1
    MaxCombos = ...
    (factorial(n1) ./ (factorial(d1_1) .* factorial(n1-d1_1)))
    
    Pa1array=[]
    for ii = 1:length(p)
        Pa1_Dconstant_foraPvalue = p(ii).^d1_1 .* (1-p(ii)).^(n1-d1_1);
        Pa1array = [Pa1array; Pa1_Dconstant_foraPvalue];
    end
    Pa1_1 = MaxCombos .*Pa1array;
    
    
    for d2=0:ac2-d1_1
         MaxCombos = ...
        (factorial(n2) ./ (factorial(d2) .* factorial(n2-d2)))
        Pa2array=[];
        for jj = 1:length(p)
            Pa2_Dconstant_foraPvalue = p(jj).^d2 .* (1-p(jj)).^(n2-d2);
            Pa2array = [Pa2array; Pa2_Dconstant_foraPvalue];
        end
        Pa2 = MaxCombos .* Pa2array;
        Pa2Total=[Pa2Total Pa2];
    end
    
    Pa2Summed = sum(Pa2Total,2)
    
    Pa1Pa2 = Pa1_1.*Pa2Summed;
    
    Pa1Pa2Total =[Pa1Pa2Total Pa1Pa2];
        
    end
    Pa1Pa2Final = sum(Pa1Pa2Total,2)
   hold on, plot(p,Pa1Pa2Final) 
plot(p,Pa1Final,'r')            
        plot(p,Pa1Final+Pa1Pa2Final,'k')
got it =) if you immediately break it up into 2 quick for loops and not iterate it like we'd write it, it is much simpler and i get the right answer. the code is also a LOT more cleaner...
Attached Thumbnails
sampling1.png   sampling2.png   sampling3.png  

Last edited by magomago; 1st July 2012 at 03:10 AM. Reason: i got i!
Thanks to magomago for your informative Post and/or Attachment!

Sponsored Links
  #2  
Old 1st July 2012, 09:32 AM
Marc's Avatar
Marc Marc is online now
Your Elsmar Cove Host

 
Registration Date: Jan 1996
Location: West Chester - Southern Ohio - USA
Age: 62
 
Posts: 22,812
Thanks Given to Others: 7,457
Thanked 4,543 Times in 2,894 Posts
Blog Entries: 4
Karma Power: 400
Karma: 28830
Marc is appreciated, and has over 1700 Karma points.Marc is appreciated, and has over 1700 Karma points.Marc is appreciated, and has over 1700 Karma points.Marc is appreciated, and has over 1700 Karma points.Marc is appreciated, and has over 1700 Karma points.
Marc is appreciated, and has over 1700 Karma points.Marc is appreciated, and has over 1700 Karma points.Marc is appreciated, and has over 1700 Karma points.Marc is appreciated, and has over 1700 Karma points.Marc is appreciated, and has over 1700 Karma points.Marc is appreciated, and has over 1700 Karma points.Marc is appreciated, and has over 1700 Karma points.Marc is appreciated, and has over 1700 Karma points.Marc is appreciated, and has over 1700 Karma points.Marc is appreciated, and has over 1700 Karma points.Marc is appreciated, and has over 1700 Karma points.Marc is appreciated, and has over 1700 Karma points.
Re: OC Curves for Double Sampling Plan - How are they Derived?

Thanks for letting us know how you solved it! We appreciate it!
__________________
A Search is a terrible thing to waste!
One Test is Worth 1000 Expert Opinions - The plural of anecdote is not data - Correlation does not imply Causation
We can't solve problems by using the same kind of thinking we used when we created them. - Unknown
Sponsored Links

Reply

Lower Navigation Bar
Go Back   The Elsmar Cove Forum > Common Quality Assurance Processes and Tools > SPC Monitoring and Statistical Analysis Techniques

Do you find this discussion thread helpful and informational?


Bookmarks


Visitors Currently Viewing this Thread: 1 (0 Registered Visitors (Members) and 1 Unregistered Guest Visitors)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Forum Search
Display Modes Rate Thread Content
Rate Thread Content:

Forum Posting Settings
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Discussion Threads
Discussion Thread Title Thread Starter Forum Replies Last Post or Poll Vote
Double Sampling Plan Explanation for * ThaRide Inspection, Prints (Drawings), Testing, Sampling and Related Topics 5 11th August 2009 03:01 PM
Double-sided (USL, LSL) Variables sampling plan Z1.9 - Use in Excel spreadsheet? tdickson Inspection, Prints (Drawings), Testing, Sampling and Related Topics 2 7th June 2009 11:08 AM
Customized sampling plan - Acceptance sampling plan for the raw materials newuser123 Inspection, Prints (Drawings), Testing, Sampling and Related Topics 2 20th May 2009 12:43 PM
Draw OC curve - Double sampling plan vinay_nagaraj Inspection, Prints (Drawings), Testing, Sampling and Related Topics 1 29th October 2006 05:38 PM
How To Read OC Curves for Individual sampling plans in Z1.4 2003 qualitygoddess - 2010 Inspection, Prints (Drawings), Testing, Sampling and Related Topics 1 1st December 2004 06:10 PM



The time now is 06:15 PM. All times are GMT -4.
Your time zone can be changed in your UserCP --> Options.


   


Marc Timothy Smith - Elsmar.com
8466 LeSourdsville-West Chester Road, Olde West Chester, Ohio 45069-1929
513 341-6272