2
$\begingroup$

In how many ways can I arrange the first $6$ positive integers such that this inequalities chain will hold?

$a < b > c < d < e > f$

One of these arrangements is $\{5, 6, 1, 2, 4, 3\}$, but how many is it possible to find?

$\endgroup$
8
  • $\begingroup$ Why are you interested in this question? $\endgroup$
    – user293787
    Sep 26, 2022 at 17:23
  • 1
    $\begingroup$ I found in a FB group and I tried to resolve with Mathematica, but I was not able to $\endgroup$
    – user967210
    Sep 26, 2022 at 17:24
  • $\begingroup$ The notation $a < b > c < d < e > f$ is not correct. The right math notation is $a < b , b> c , c< d , d< e,e > f$. The austerity of 5 symbols is petty. $\endgroup$
    – user64494
    Sep 27, 2022 at 4:42
  • $\begingroup$ @user64494 The same FullForm[a < b > c] === FullForm[a < b && b > c] $\endgroup$
    – cvgmt
    Sep 27, 2022 at 5:06
  • $\begingroup$ @cvgmt: Sorry, don't unerstand: what are "the same"? The Mathematica notations are nonstandard sometimes and this may lead to errors and misunderstandings. $\endgroup$
    – user64494
    Sep 27, 2022 at 6:18

1 Answer 1

5
$\begingroup$
pList = Cases[
  Permutations[Range[6], {6}], {a_, b_, c_, d_, e_, f_} /; 
   a < b > c < d < e > f]

Length@pList

40


A variation using SequenceCountis possible with the same result.

SequenceCount[
 Permutations[Range[6], {6}], {{a_, b_, c_, d_, e_, f_}} /; 
  a < b > c < d < e > f]
$\endgroup$
2
  • $\begingroup$ Thank you! That was exactly what I needed. Now I'm asking if there is an analytical method to find that $\endgroup$
    – user967210
    Sep 26, 2022 at 17:28
  • 5
    $\begingroup$ You can post this as an addendum to your question, although such an analytical exercise is better suited for the Math SE site. Or you can post a separate question on the Math SE site and put a link to this post, if it helps the explanation. Thanks. $\endgroup$
    – Syed
    Sep 26, 2022 at 17:32

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.