Deprecated: Return type of Dotenv\Repository\AbstractRepository::offsetExists($offset) should either be compatible with ArrayAccess::offsetExists(mixed $offset): bool, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /home/forthrig/public_html/wp-content/plugins/anycomment/vendor/vlucas/phpdotenv/src/Repository/AbstractRepository.php on line 147

Deprecated: Return type of Dotenv\Repository\AbstractRepository::offsetGet($offset) should either be compatible with ArrayAccess::offsetGet(mixed $offset): mixed, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /home/forthrig/public_html/wp-content/plugins/anycomment/vendor/vlucas/phpdotenv/src/Repository/AbstractRepository.php on line 155

Deprecated: Return type of Dotenv\Repository\AbstractRepository::offsetSet($offset, $value) should either be compatible with ArrayAccess::offsetSet(mixed $offset, mixed $value): void, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /home/forthrig/public_html/wp-content/plugins/anycomment/vendor/vlucas/phpdotenv/src/Repository/AbstractRepository.php on line 163

Deprecated: Return type of Dotenv\Repository\AbstractRepository::offsetUnset($offset) should either be compatible with ArrayAccess::offsetUnset(mixed $offset): void, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /home/forthrig/public_html/wp-content/plugins/anycomment/vendor/vlucas/phpdotenv/src/Repository/AbstractRepository.php on line 171

Deprecated: Return type of PhpOption\Some::getIterator() should either be compatible with IteratorAggregate::getIterator(): Traversable, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /home/forthrig/public_html/wp-content/plugins/anycomment/vendor/phpoption/phpoption/src/PhpOption/Some.php on line 151

Deprecated: Return type of PhpOption\None::getIterator() should either be compatible with IteratorAggregate::getIterator(): Traversable, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /home/forthrig/public_html/wp-content/plugins/anycomment/vendor/phpoption/phpoption/src/PhpOption/None.php on line 118
Combinatorics Archives | forthright48 https://forthright48.com/category/cpps/combinatorics/ learning never ends Sat, 24 Nov 2018 18:02:51 +0000 en-US hourly 1 https://wordpress.org/?v=6.5.8 Lucas Theorem – Proof and Applications https://forthright48.com/lucas-theorem-proof-and-applications/?utm_source=rss&utm_medium=rss&utm_campaign=lucas-theorem-proof-and-applications https://forthright48.com/lucas-theorem-proof-and-applications/#comments Fri, 16 Nov 2018 08:48:24 +0000 https://forthright48.com/?p=352 Problem Given non-negative integers $N$, $K$ and a prime number $P$, find the value of: $$\binom{N}{K} \mod P$$ Sounds like a simple problem right? There are several ways to solve the problem, depending on the constraints of $N$, $K$, and $P$. Direct: If $N$, $K$ are really small, less than $12$, then we can calculate …

The post Lucas Theorem – Proof and Applications appeared first on forthright48.

]]>
https://forthright48.com/lucas-theorem-proof-and-applications/feed/ 1
Stars and Bars Theorem https://forthright48.com/stars-and-bars-theorem/?utm_source=rss&utm_medium=rss&utm_campaign=stars-and-bars-theorem https://forthright48.com/stars-and-bars-theorem/#respond Sun, 23 Sep 2018 15:32:54 +0000 https://forthright48.com/?p=307 Problem Given K variables, $a_1, a_2, a_3 \dots a_K$ and a value $N$, how many ways can we write $a_1 + a_2 + a_3 \dots a_K = N$, where $a_1, a_2, a_3 \dots a_K$ are non-negative integers? For example, if $K = 3$ and $N=2$, there are 6 solutions. a b c ----- 2 0 …

The post Stars and Bars Theorem appeared first on forthright48.

]]>
https://forthright48.com/stars-and-bars-theorem/feed/ 0
Application of Prufer Code: Random Tree Generation, Cayley’s Formula and Building Tree from Degree Count https://forthright48.com/application-of-prufer-code-random-tree-generation-cayleys-formula-and-building-tree-from-degree-count/?utm_source=rss&utm_medium=rss&utm_campaign=application-of-prufer-code-random-tree-generation-cayleys-formula-and-building-tree-from-degree-count https://forthright48.com/application-of-prufer-code-random-tree-generation-cayleys-formula-and-building-tree-from-degree-count/#respond Thu, 08 Feb 2018 09:55:00 +0000 On the last post (Prufer Code: Linear Representation of a Labeled Tree), we discussed how to convert a labeled tree into Prufer Code and vice versa. On this post, we will look into some of its applications in problem-solving. Generating Random Tree This one is the simplest. Though problem-solving may not require generating random trees, …

The post Application of Prufer Code: Random Tree Generation, Cayley’s Formula and Building Tree from Degree Count appeared first on forthright48.

]]>
https://forthright48.com/application-of-prufer-code-random-tree-generation-cayleys-formula-and-building-tree-from-degree-count/feed/ 0
Prufer Code: Linear Representation of a Labeled Tree https://forthright48.com/prufer-code-linear-representation-of-a-labeled-tree/?utm_source=rss&utm_medium=rss&utm_campaign=prufer-code-linear-representation-of-a-labeled-tree https://forthright48.com/prufer-code-linear-representation-of-a-labeled-tree/#comments Sun, 28 Jan 2018 19:02:00 +0000 I guess this is going to be my first post (apart from the contest analysis’) which is not about Number Theory! It’s not about graph either, even though the title has “Tree” in it. This post is actually about Combinatorics. Prufer code, in my opinion, is one of the most underrated algorithms I have learned. …

The post Prufer Code: Linear Representation of a Labeled Tree appeared first on forthright48.

]]>
https://forthright48.com/prufer-code-linear-representation-of-a-labeled-tree/feed/ 2