Skip to main content
added 132 characters in body
Source Link
hexomino
  • 139.1k
  • 10
  • 397
  • 576

I think you can get the bound down to

$\lceil \sqrt{N} \rceil$, that is the square root of $N$, rounded up.

In the following way

Order the integerscards from $1$ to $N$ and partition them into $\lfloor \sqrt{N} \rfloor - 1$$\left[ \frac{N}{\lceil \sqrt{N} \rceil} \right]$ subsets of size $\lceil \sqrt{N} \rceil$ plus one additional subset of the leftovers (may have size zero). TheThen, reverse the integersorder of the cards within each subset.

For example for $N=18$, we want to divide the cards into $3$ subsets of size $5$ and one of size $3$, i.e, $$ 1,2,3,4,5|6,7,8,9,10|11,12,13,14,15|16,17,18$$ then reverse the integerscards within each subset $$5,4,3,2,1|10,9,8,7,6|15,14,13,12,11|18,17,16$$ Then our maximum increasing or decreasing subsequence has size $5$.

For $N=9$ the corresponding ordering is $3,2,1,6,5,4,9,8,7$ which indeed has its longest increasing or decreasing subsequence with size $3$.

Why this works

To obtain an decreasing subsequence (option A) your friend must choose all of their cards to be within one of the partitions above (as cards between partitions are in increasing order). This gives them a maximum of $\lceil \sqrt{N} \rceil$. On the other hand, if they choose option B, then all the cards they pick must be in different partitions as defined above, which gives them a maximum of $\lfloor \sqrt{N} \rfloor$$\left[ \frac{N}{\lceil \sqrt{N} \rceil} \right] \leq \frac{N}{\lceil \sqrt{N} \rceil} \leq \lceil \sqrt{N} \rceil$. I think this is the best we can do while balancing the advantages of the two options.

I think you can get the bound down to

$\lceil \sqrt{N} \rceil$, that is the square root of $N$, rounded up.

In the following way

Order the integers and partition them into $\lfloor \sqrt{N} \rfloor - 1$ subsets of size $\lceil \sqrt{N} \rceil$ plus one additional subset of the leftovers. The reverse the integers within each subset.

For example for $N=18$, we want to divide into $3$ subsets of size $5$ and one of size $3$, i.e, $$ 1,2,3,4,5|6,7,8,9,10|11,12,13,14,15|16,17,18$$ then reverse the integers within each subset $$5,4,3,2,1|10,9,8,7,6|15,14,13,12,11|18,17,16$$ Then our maximum increasing or decreasing subsequence has size $5$.

For $N=9$ the corresponding ordering is $3,2,1,6,5,4,9,8,7$ which indeed has its longest increasing or decreasing subsequence with size $3$.

Why this works

To obtain an decreasing subsequence (option A) your friend must choose all of their cards to be within one of the partitions above (as cards between partitions are in increasing order). This gives them a maximum of $\lceil \sqrt{N} \rceil$. On the other hand, if they choose option B, then all the cards they pick must be in different partitions as defined above, which gives them a maximum of $\lfloor \sqrt{N} \rfloor$. I think this is the best we can do while balancing the advantages of the two options.

I think you can get the bound down to

$\lceil \sqrt{N} \rceil$, that is the square root of $N$, rounded up.

In the following way

Order the cards from $1$ to $N$ and partition them into $\left[ \frac{N}{\lceil \sqrt{N} \rceil} \right]$ subsets of size $\lceil \sqrt{N} \rceil$ plus one additional subset of the leftovers (may have size zero). Then, reverse the order of the cards within each subset.

For example for $N=18$, we divide the cards into $3$ subsets of size $5$ and one of size $3$, i.e, $$ 1,2,3,4,5|6,7,8,9,10|11,12,13,14,15|16,17,18$$ then reverse the cards within each subset $$5,4,3,2,1|10,9,8,7,6|15,14,13,12,11|18,17,16$$ Then our maximum increasing or decreasing subsequence has size $5$.

For $N=9$ the corresponding ordering is $3,2,1,6,5,4,9,8,7$ which indeed has its longest increasing or decreasing subsequence with size $3$.

Why this works

To obtain an decreasing subsequence (option A) your friend must choose all of their cards to be within one of the partitions above (as cards between partitions are in increasing order). This gives them a maximum of $\lceil \sqrt{N} \rceil$. On the other hand, if they choose option B, then all the cards they pick must be in different partitions as defined above, which gives them a maximum of $\left[ \frac{N}{\lceil \sqrt{N} \rceil} \right] \leq \frac{N}{\lceil \sqrt{N} \rceil} \leq \lceil \sqrt{N} \rceil$. I think this is the best we can do while balancing the advantages of the two options.

added 513 characters in body
Source Link
hexomino
  • 139.1k
  • 10
  • 397
  • 576

I think you can get the bound down to

$\lceil \sqrt{N} \rceil$, that is the square root of $N$, rounded up.

In the following way

Order the integers and partition them into $\lfloor \sqrt{N} \rfloor - 1$ subsets of size $\lceil \sqrt{N} \rceil$ plus one additional subset of the leftovers. The reverse the integers within each subset.

For example for $N=18$, we want to divide into $3$ subsets of size $5$ and one of size $3$, i.e, $$ 1,2,3,4,5|6,7,8,9,10|11,12,13,14,15|16,17,18$$ then reverse the integers within each subset $$5,4,3,2,1|10,9,8,7,6|15,14,13,12,11|18,17,16$$ Then our maximum increasing or decreasing subsequence has size $5$.

For $N=9$ the corresponding ordering is $3,2,1,6,5,4,9,8,7$ which indeed has its longest increasing or decreasing subsequence with size $3$.

Why this works

To obtain an decreasing subsequence (option A) your friend must choose all of their cards to be within one of the partitions above (as cards between partitions are in increasing order). This gives them a maximum of $\lceil \sqrt{N} \rceil$. On the other hand, if they choose option B, then all the cards they pick must be in different partitions as defined above, which gives them a maximum of $\lfloor \sqrt{N} \rfloor$. I think this is the best we can do while balancing the advantages of the two options.

I think you can get the bound down to

$\lceil \sqrt{N} \rceil$, that is the square root of $N$, rounded up.

In the following way

Order the integers and partition them into $\lfloor \sqrt{N} \rfloor - 1$ subsets of size $\lceil \sqrt{N} \rceil$ plus one additional subset of the leftovers. The reverse the integers within each subset.

For example for $N=18$, we want to divide into $3$ subsets of size $5$ and one of size $3$, i.e, $$ 1,2,3,4,5|6,7,8,9,10|11,12,13,14,15|16,17,18$$ then reverse the integers within each subset $$5,4,3,2,1|10,9,8,7,6|15,14,13,12,11|18,17,16$$ Then our maximum increasing or decreasing subsequence has size $5$.

For $N=9$ the corresponding ordering is $3,2,1,6,5,4,9,8,7$ which indeed has its longest increasing or decreasing subsequence with size $3$.

I think you can get the bound down to

$\lceil \sqrt{N} \rceil$, that is the square root of $N$, rounded up.

In the following way

Order the integers and partition them into $\lfloor \sqrt{N} \rfloor - 1$ subsets of size $\lceil \sqrt{N} \rceil$ plus one additional subset of the leftovers. The reverse the integers within each subset.

For example for $N=18$, we want to divide into $3$ subsets of size $5$ and one of size $3$, i.e, $$ 1,2,3,4,5|6,7,8,9,10|11,12,13,14,15|16,17,18$$ then reverse the integers within each subset $$5,4,3,2,1|10,9,8,7,6|15,14,13,12,11|18,17,16$$ Then our maximum increasing or decreasing subsequence has size $5$.

For $N=9$ the corresponding ordering is $3,2,1,6,5,4,9,8,7$ which indeed has its longest increasing or decreasing subsequence with size $3$.

Why this works

To obtain an decreasing subsequence (option A) your friend must choose all of their cards to be within one of the partitions above (as cards between partitions are in increasing order). This gives them a maximum of $\lceil \sqrt{N} \rceil$. On the other hand, if they choose option B, then all the cards they pick must be in different partitions as defined above, which gives them a maximum of $\lfloor \sqrt{N} \rfloor$. I think this is the best we can do while balancing the advantages of the two options.

Source Link
hexomino
  • 139.1k
  • 10
  • 397
  • 576

I think you can get the bound down to

$\lceil \sqrt{N} \rceil$, that is the square root of $N$, rounded up.

In the following way

Order the integers and partition them into $\lfloor \sqrt{N} \rfloor - 1$ subsets of size $\lceil \sqrt{N} \rceil$ plus one additional subset of the leftovers. The reverse the integers within each subset.

For example for $N=18$, we want to divide into $3$ subsets of size $5$ and one of size $3$, i.e, $$ 1,2,3,4,5|6,7,8,9,10|11,12,13,14,15|16,17,18$$ then reverse the integers within each subset $$5,4,3,2,1|10,9,8,7,6|15,14,13,12,11|18,17,16$$ Then our maximum increasing or decreasing subsequence has size $5$.

For $N=9$ the corresponding ordering is $3,2,1,6,5,4,9,8,7$ which indeed has its longest increasing or decreasing subsequence with size $3$.