emir toktar emirtoktargmailcom thanks mr graves support saw post 729 seen reply attempt response question start email obtain smallest value n sample size satisfying inequalities 1alpha pbinomc n p1 pbinomc n p2 beta alpha p1 p2 beta given assume c also given though thats perfectly clear ok c starts 0 limit sptipulate lot size limit n c value increased oc curve shifted right im using lot size concept hypergeometric accetance model im using since n integer standard optimizers like optim nlm really appropriate sounds like integer programming rsitesearchinteger programming fun produced 138 hits might find something useful thanks im searching however tried id try simpler things first consider example following c 5 used c c c name function r alpha 05 beta 8 p1 2 p2 9 n c20 p1 pbinomc n p1 p2 pbinomc n p2 good 1alpha p1 p2 beta minngood op parmfrowc2 1 plotn p1 ablineh1alpha plotn p2 ablinehbeta parop case n 6 satisfies inequalities though n 15 minngood inf either solution exists need increase upper bound search range n interactive method using r optimizer method findn functionn p2 beta c ss cn j sample size value pbinomc ss p2 beta return ss return n bad search limit lot size n findc functionn p1 alpha c k cni quantile value defective pbinomd k p1 alpha returnd returnn bad search limit lot size n recurbinom functionn p1 p2 alpha beta c 0 k 0 conflevel 1 alpha 1 k findnn p2 beta c pbinomc k p1 conflevel break else c findcn p1 conflevel c k catpaste acceptance number c c sample number k kn catpaste confidence levelpbinomc k p1 100n prob seq00001015by0001 pb pbinomc k prob plotprob pb typel recurbinomn 600 p1 001 p2 008 alpha 005 beta 005 sample number k 77 acceptance number c 2 confidence level 9576 ill trying modified case use suggestion perhaps changing p2 definitionconsumer option maximum value fixed value used example alpha beta values giving flexible model optimize youd like help please read posting guide httpwwwrprojectorgpostingguidehtml provide commented minimal selfcontained reproducible code hope helps spencer graves ok first post apologise inconvenient thank much etoktar 55 21 91121847 emirtoktarcomputerorg emirtoktargmailcom ______________________________________________ rhelprprojectorg mailing list httpsstatethzchmailmanlistinforhelp please read posting guide httpwwwrprojectorgpostingguidehtml provide commented minimal selfcontained reproducible code wed 06 aug 2008 140532 0300 r optimize simultaneously two binomials inequalities using nlm optim