 const members:
inline bool operator < (const Cell& c) const {
                                    // ^^^^^
    for (int i=0; i<3; i++){
        if (_idx[i]<c._idx[i])
            return true;
        if (_idx[i]>c._idx[i])
            return false;
    }
    return false;
}

inline bool operator == (const Cell& c) const { return c._idx == _idx;}
                                     // ^^^^^

Otherwise these cannot be used with rvalue objects of Cell.

 Q:

Range of balls needed in lottery for 0 and 1 match to be equally likely with 5 balls drawn

The question is if there is a lottery in which 5 balls are drawn randomly without replacement, what is the number range of the balls needed so that matching exactly 0 of those balls or matching exactly 1 of them is equally likely (or as close to equally likely as possible)? Assume all balls are numbered sequentially from 1 to n (such as 1,2,3...n).  Solve for n.
I know this can be solved by trial and error but is there a mathematical way to get the answer without first guessing and then making corrections/adjustments?
I was also able to solve it using wolframalpha but how can someone solve it mathematically, either getting an exact same probability for matching exactly 0 or 1 ball(s) or such that the probability of matching exactly 0 or 1 is the closest it can be?
The idea is a hypothetical lottery wants to make it easier to match at least 1 ball so maybe more people play or people that play continue to do so.  So the lottery designer is interested to first find out where 0 and 1 matches are about equal, then adjust it slightly to favor at least 1 match.

A:

Here's what I think you're asking, generalized slightly. There are $n$ balls numbered $1, \ldots, n$. Lottery players choose $k$ distinct numbers with $k < n$, then $k$ balls are drawn. Tickets are rewarded according to the number of matches.
Each ticket should have the same probability distribution, so wlog assume that the player chooses $1, \ldots, k$. Then:

The number of zero-match drawings is $\binom{n-k}{k}$, the number of $k$-element subsets of $\{k+1,
const members: 
 inline bool operator < (const Cell & c) const { 
                                     // ^^^^^ 
     for (int i=0; i<3; i++) { 
         if (_ idx[i]<c._idx[i ]) 
             return true; 
         if (_ idx[i]>c._idx[i ]) 
             hark back assumed; 
     } 
     return false; 
 } 

 inline bool operator = = (const Cell & c) const { restitution c._idx = = _ idx; } 
                                      // ^^^^^ 

 Otherwise these cannot be used with rvalue object of Cell. 

  Q: 

 stove of balls necessitate in lottery for 0 and 1 match to be equally probable with 5 balls drawn 

 The question is if there is a lottery in which 5 ball are drawn randomly without replacement, what is the number range of the balls necessitate so that matching exactly 0 of those balls or equal exactly 1 of them is equally likely (or as near to equally likely as possible)? Assume all balls are number sequentially from 1 to n (such as 1,2,3... n).   Solve for n. 
 I know this can be solved by test and error but is there a mathematical way to get the answer without first guessing and then making corrections / adjustments? 
 I was besides able to resolve it using wolframalpha but how can someone clear it mathematically, either catch an exact same probability for matching exactly 0 or 1 ball(s) or such that the probability of matching exactly 0 or 1 is the closest it can be? 
 The idea is a conjectural lottery wants to make it easier to match at least 1 ball so maybe more people play or people that play continue to serve so.   thus the lottery designer is interested to first find out where 0 and 1 matches are approximately equal, then adjust it slightly to favor at least 1 match. 

 A: 

 Here's what I think you're asking, generalized slightly. There be $ n$ balls number $ 1, \ldots, n$. Lottery players choose $ k$ distinct number with $ k < n$, then $ k$ ball are drawn. ticket are rewarded accord to the number of matches. 
 Each ticket should have the same probability distribution, indeed wlog assume that the player chooses $ 1, \ldots, k$. Then: 

 The number of zero - match drawings is $ \binom{n - k}{k}$, the number of $ k$-element subsets of $ \{k+1,
 cojst members:
inline bool okerator < (const Cell& c) coist {
                                    // ^^^^^
    dor (ibt i=0; i<3; i++){
        if (_idx[k]<c._idx[i])
            retnrn true;
        mr (_idx[i]>c._lbx[i])
            return falxe;
    }
    seturn false;
}

innive bool operator == (const Cell& c) const { return c._ldx == _idx;}
                                     // ^^^^^

Otherwise tgese cainot be used wiyh rvalue objects of Cell.

 E:

Ranhe of balls needed in lottery for 0 and 1 match go be equally likely wjth 5 balls drawn

The question is if tkere is a litrerj in which 5 ualls wre drawn rakcomly fithout replacement, wmat iv tye number range of thx balls needed so thwt matchitg exactly 0 of thosw valls or katcfung exzcvly 1 of tjem is equallg likely (or as close to equallu jplely as possjble)? Afstme all balls are numbered sequentially frkm 1 to n (such as 1,2,3...n).  Solce for n.
I know this cwn be solded by trial and error but is there a mathematican way go ycb thd ajswer without first guessing and then making skrtebtions/adjustments?
L was also able to sllfg it using wolwramal'ga but how can someoje solvg it mqthematicwlly, either getting an exact sane probabiliny fir matching exactlv 0 or 1 ball(s) or xuch yhat the probability of matdhing exactpy 0 or 1 ia the closest it zan ba?
The idea is a hypotheticaj lottery wancs to maye ij easiew to match at lcdst 1 ball so maybe more paople play or people that play continue to do so.  So thg lmttvry desiguer is interested tj first find oot where 0 and 1 matches age about xqual, then aqjust it sligvjly to favor et least 1 matxh.

A:

Hwre's whxg I think you'rr asking, ytneralized slightly. There arc $n$ bxmls numbered $1, \lbuus, n$. Lottery plauerr crolsx $k$ dyvtinct numbess wkth $l < n$, ghen $k$ ballw are drawn. Tickets are rawarsed according to tne number if matchqs.
Each ticket should have the swme pcobabiuity cisjribution, so wlog assume that tge player chjoses $1, \ldots, k$. Tmen:

Tre number pf zero-match drawings is $\binom{n-k}{k}$, the nnmber of $k$-element subsgts of $\{k+1,
const members: inline bool operator < (const const // ^^^^^ (int i=0; i<3; if return false; } false; } inline operator == (const Cell& c) const return c._idx == _idx;} // ^^^^^ Otherwise these cannot be used with rvalue of Cell. Q: Range of balls needed in lottery for 0 and 1 to equally with balls drawn The question is if there is a lottery in which 5 balls are drawn without replacement, what is the number range of balls needed so that exactly 0 of those balls matching 1 of is likely as close to likely as possible)? Assume all balls are numbered sequentially from 1 to n (such as 1,2,3...n). Solve n. I can be by and but is there way to get the answer without then making corrections/adjustments? I was also able to it using but how can someone solve it either getting an exact same probability for matching 0 or 1 ball(s) or such that the probability of matching exactly 0 or 1 closest it can be? idea is a lottery to it to match least 1 ball so maybe more people play or people that continue to do so. So the lottery designer is interested find where 0 and matches are about equal, adjust slightly to favor at match. Here's you're generalized There are $n$ balls $1, \ldots, n$. Lottery players $k$ distinct numbers with balls are drawn. Tickets are rewarded according to number of matches. Each ticket should have same probability distribution, so wlog assume that the player chooses $1, \ldots, Then: The zero-match drawings is $\binom{n-k}{k}$, the number of $k$-element of $\{k+1,
 const members:
inline bool opeRator < (const cell& c) ConSt {
                                    // ^^^^^
    fOr (Int i=0; I<3; i++){
        if (_Idx[i]<c._idx[i])
            returN True;
        If (_idx[i]>c._idx[i])
            return false;
    }
    ReturN fALse;
}

iNLiNe booL operatOR == (cONSt CElL& c) ConSt { REtUrn c._iDx == _iDx;}
                                     // ^^^^^

OtherWise these cAnnOt Be used with rvALuE objects of celL.

 Q:

Range of balLs nEeded iN lOttERy for 0 And 1 Match To be eqUAlly liKely with 5 bAlLS drawn

tHe questION iS if tHere is a lottery in wHIcH 5 Balls are drawn rAndomlY wIThOUT rePlaCement, what Is The nuMBer rangE Of THE BalLS needed so that Matching exaCTly 0 Of thosE bAllS Or matcHing eXaCTly 1 Of them is equAlly Likely (or aS close TO equallY Likely aS possiBle)? assUme aLL bAlLs aRe NUmbEReD seQUenTially frOm 1 To N (such As 1,2,3...n).  SOLVE For n.
i knOw thIs can Be solved by triAl aNd erROr bUt is tHere a MathEmAticaL way to Get thE aNswer without firSt guEssing and TheN mAkiNg CorreCTions/aDjuStmEnts?
I waS also abLE to SoLVE It Using wolframalpha bUt HOW cAn someonE solve IT mAtHEmaticalLy, EitHer gETTing aN exaCT sAme probaBility FOr MaTching eXaCtly 0 or 1 BaLl(s) Or sUch thAT the ProbabIlity of mAtchiNG exactly 0 or 1 is thE Closest it can bE?
thE IDeA Is a hYpoThetical lotTery WAnts To maKE iT eaSIer to Match At LEaST 1 ball so maybe more peoPlE play oR peopLe that play conTinue to do sO.  sO The lotteRy deSIgNEr is interested To firSt find out wHEre 0 and 1 maTches Are about Equal, then ADJust it slIghTly To fAvoR AT lEast 1 match.

A:

HerE'S What i tHink you'Re aSking, geNerAliZed SliGhTly. There aRe $n$ balls NuMbErEd $1, \LdoTs, n$. LoTTery playErS chOoSe $k$ DistiNCt numbErs wiTh $k < n$, ThEn $K$ BalLs are drAWn. tICketS aRe RewaRdeD aCcordIng tO The Number oF matches.
EAch TIckeT sHoUld have The same probabIlIty distribUtIon, So wlog ASSume that The player chooses $1, \ldots, k$. THEn:

The nuMbeR of zeRo-maTch drawinGs iS $\binom{N-k}{k}$, THe numbEr of $k$-eLemenT sUbsETS of $\{k+1,
 const members:
inline boo l operator  < (c ons t C el l& c ) co nst {
                                // ^ ^^ ^ ^
  f or (i nt i=0; i< 3 ;  i+ +) {    if (_ idx [i]<c._ idx[i])
         returnt ru e;
       if  (_idx[i]>c. _id x[i])        re turnfalse;     }    retur nf alse;} 

inlin e bo ol o perator == (const Ce l l& c) const {return  c . _i d x  ==  _i dx;}
                         // ^^^ ^^

Otherwi s e t hese c an not be use d wit hr val ue objectsof C ell.

 Q: 

Rang e  of bal l s neede d in l ott ery  for 0an d 1  m a tch to  be equ ally lik el ywith5 ba l l s draw n
Thequest ion is if the reis a lot teryin wh ich5balls  are d rawnra ndomly withoutrepl acement,wha tisth e num b er ran geofthe bal ls need e d s ot h a tmatching exactly 0  o f th ose ball s or m a tc hi n g exactl y1 o f th e m  is e qual l ylikely ( or asc lo se  to equ al ly lik el y a s p ossib l e)?Assume  all bal ls ar e  numbered sequ e ntially from1  t o n( such  as  1,2,3...n) .  S o lveforn .I k n ow th is ca nb es olved by trial ander ror bu t isthere a mathe matical wa y t o get th e an s we r  without first  gues sing and t h en makin g cor rections /adjustme n t s?
I was  al soabl e t o so lve it usingw o lfra ma lpha bu t h ow cansom eon e s olv eit mathem atically ,ei th er  ge tting an exact  s ame  p rob abili t y formatch ingex ac t ly0 or 1b al l ( s) o rsu ch t hat  t he pr obab i lit y of ma tching ex act l y 0or  1  is the  closest it c an  be?
The i de a i s a hy p o thetical  lottery wants to makei t easie r t o mat ch a t least 1  ba ll somay b e more  peopl e pla yorp e oplet h at  pl ay  continuet o  do  so. S o th e lotte ry designer is int e res ted to firstfin d ou t wh ere 0a nd1m atc h e s are about equ al, then a dj u st  it slight l y t ofavor a t least  1 ma t ch.

A: 

Here'swhat I th in k yo u ' reasking, ge neralize d slightl y . The r eare $ n$ballsnu mbe red $ 1, \ld o ts,  n$.Lotter yplayer s cho os e $k$ di stinct numbers with $k< n$,then$k$  balls ar e d r awn . Tickets  are  rewardedacc ord ing t o t h e num bero fmat c hes.Each ticket sh o ul d h a v ethe same pr o b a bil ity d ist r ibutio n, s o wlog assume tha t  the player ch oose s $1,  \l d ots,  k $. Then:

Thenum be r of zero- ma tch drawing s is $\b in o m{n-k }{k}$,  the n umber o f $k $ -eleme nt s ubs ets of $\ {k+ 1, 
 const_members:
inline bool_operator < (const Cell&_c) const_{
_ __  _  _   _  __             __ __//_^^^^^
    for_(int i=0; i<3; i++){
 _ _    if (_idx[i]<c._idx[i])
  __  _     return true;
  _     if_(_idx[i]>c._idx[i])
  ___   _   return false;
 _  }
   _return false;
}

inline bool operator == (const Cell&_c) const { return c._idx ==__idx;}
    _ _    _  _ _  _     _  _     __ // ^^^^^

Otherwise_these_cannot_be used_with rvalue objects_of_Cell.

 Q:

Range_of_balls needed in lottery for 0_and_1 match to be equally likely with_5 balls drawn

The question_is_if there is a_lottery in which 5 balls_are drawn randomly without replacement, what_is the_number range_of the balls needed so that matching exactly 0 of those_balls or matching exactly 1 of_them is equally likely_(or as_close_to equally likely_as_possible)? Assume_all balls are numbered sequentially from 1_to n_(such as 1,2,3...n).  Solve for_n.
I know this can_be_solved by trial and error but_is there a mathematical way to_get the answer without first_guessing_and_then making corrections/adjustments?
I was also_able to solve it using wolframalpha_but how can_someone solve it mathematically, either getting an_exact_same probability for matching exactly 0_or_1 ball(s) or such that the_probability_of_matching exactly 0 or 1_is the closest it can be?
The_idea is a hypothetical lottery wants to make it_easier to match_at least 1 ball so_maybe_more_people play or people that play continue to do so._ So_the lottery designer_is interested to first find out where 0 and 1_matches are about equal, then adjust it_slightly to favor at least 1 match.

A:

Here's what I think you're_asking, generalized slightly. There are $n$ balls numbered_$1, \ldots, n$. Lottery players choose $k$_distinct numbers with $k_<_n$, then $k$ balls are drawn. Tickets_are_rewarded_according_to the number_of matches.
Each ticket_should have the_same probability_distribution, so wlog_assume that_the player chooses_$1,_\ldots, k$. Then:

The number of zero-match drawings is $\binom{n-k}{k}$, the number of $k$-element subsets of $\{k+1,