4
$\begingroup$

How to find the smallest n s.t:

$$\binom{2500-n}{50}/\binom{2500}{50} < 0.5$$

$\endgroup$
1
  • 1
    $\begingroup$ Just try all possible n: Catch[For[i = 0, i <= 2500, If[Binomial[2500 - i, 50] < 1/2 Binomial[2500, 50], Throw[i]]; ++i]] $\endgroup$
    – Matsmath
    Commented Sep 6, 2022 at 4:21

3 Answers 3

4
$\begingroup$
Clear["Global`*"]

NArgMin[{n, Binomial[2500 - n, 50]/Binomial[2500, 50] < 0.5}, n] // 
  Ceiling // Quiet

(* 35 *)

EDIT: Or

ArgMin[{n, Binomial[2500 - n, 50]/Binomial[2500, 50] < 1/2, n > 0}, 
   n, Integers] // Quiet

(* 35 *)

Check,

Binomial[2500 - #, 50]/Binomial[2500, 50] & /@ {34, 35, 36} // N

(* {0.500818, 0.490663, 0.480711} *)
$\endgroup$
8
  • $\begingroup$ In the context of Binomial, isn't the domain automatically set to Integer in mathematica? $\endgroup$
    – omg
    Commented Sep 5, 2022 at 16:28
  • $\begingroup$ No. Gamma or Factorial or Binomial are defined for real or complex arguments. Evaluate Binomial[5.3, 3.6] $\endgroup$
    – Bob Hanlon
    Commented Sep 5, 2022 at 16:32
  • $\begingroup$ What does Binomial[5.3, 3.6] mean? $\endgroup$
    – omg
    Commented Sep 5, 2022 at 16:35
  • 1
    $\begingroup$ Binomial[m, n] // FunctionExpand evaluates to Gamma[1 + m]/(Gamma[1 + m - n] Gamma[1 + n]) $\endgroup$
    – Bob Hanlon
    Commented Sep 5, 2022 at 17:00
  • 1
    $\begingroup$ It is. The third form shows the use of constraints and the last form shows use of a domain. $\endgroup$
    – Bob Hanlon
    Commented Sep 5, 2022 at 17:13
4
$\begingroup$

An alternative approach:

expression = Binomial[2500 - n, 50]/Binomial[2500, 50];
Min@ SolveValues[FunctionExpand[expression] < 1/2, n, Integers]

(* Out: 35 *)
$\endgroup$
4
  • $\begingroup$ Can you explain the usage of Min@(why @) and FunctionExpand(why is it needed) and the difference between SolveValues and Solve? $\endgroup$
    – omg
    Commented Sep 6, 2022 at 2:18
  • $\begingroup$ @omg @ is a prefix notation for function application. In other words, f[x] can also be written as f@x. See the "Short Forms" section here. FunctionExpand is needed because it didn't work without it :-) I assume because Solve doesn't know how to transform the binomials on its own. SolveValues is equivalent to Solve, but it returns the values of the solutions rather than replacement rules. Compare Solve[x - 2 == 0, x] and SolveValues[x - 2 == 0, x]. $\endgroup$
    – MarcoB
    Commented Sep 6, 2022 at 3:44
  • $\begingroup$ Thanks for the detailed explanation! BTW, how to plot Binomial[2500 - n, 50]/Binomial[2500, 50] for integer domain? $\endgroup$
    – omg
    Commented Sep 6, 2022 at 11:39
  • $\begingroup$ @omg DiscretePlot[Binomial[2500 - n, 50]/Binomial[2500, 50], {n, 1, 150}] $\endgroup$
    – MarcoB
    Commented Sep 6, 2022 at 12:23
2
$\begingroup$

Working in $\mathbb{R}$ instead of $\mathbb{N}$, we can ask

Reduce[Binomial[2500 - n, 50]/Binomial[2500, 50] < 1/2, n, Reals] // RootReduce

(*    34.0798 < n < 4916.92    *)

The results are given as Root objects (zeros of degree-50 polynomials) that can be converted to real numbers with N.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.