From 6e129a43122508f39228d01821fdfcec392af90a Mon Sep 17 00:00:00 2001 From: Igor Rodionov Date: Sat, 17 May 2025 23:05:57 +0200 Subject: [PATCH 01/35] Added seq as whole object page --- .../ideas/sequence_as_a_whole_object.md | 24 +++++++++++++++++++ .../ideas/sequence_as_an_system_object.md | 3 --- mkdocs.yml | 2 +- 3 files changed, 25 insertions(+), 4 deletions(-) create mode 100644 docs/fundamentals/ideas/sequence_as_a_whole_object.md delete mode 100644 docs/fundamentals/ideas/sequence_as_an_system_object.md diff --git a/docs/fundamentals/ideas/sequence_as_a_whole_object.md b/docs/fundamentals/ideas/sequence_as_a_whole_object.md new file mode 100644 index 00000000..73e1227e --- /dev/null +++ b/docs/fundamentals/ideas/sequence_as_a_whole_object.md @@ -0,0 +1,24 @@ +# Sequence as a whole object + +Symbol sequences are a common model in many theoretical and applied science areas. +This prevalence is since almost any object of study can be represented as a sequence of elements or events. + +However, if we set aside our knowledge of the essence of the elements in a specific case and +consider the sequence as a separate object of study, then only probabilistic (statistical) methods or +various methods for comparing sequences (for example, the Levenshtein distance) are used. + +None of these methods describes the sequence as a holistic object. +The Levenshtein distance requires a different sequence to compare with the original one, which makes +the measures of this approach "relative". The probabilistic approach decomposes the sequence into +elements and calculates their probabilities. Thus, the sequence is replaced, as an object of study, +by a probability distribution. In turn, a specific probability distribution corresponds to an infinite +number of sequences with a ratio of elements "close" to the one in the original sequence. +Moments, conditional probabilities, Shannon entropy, and Markov chains allow us to more accurately +model the object under study, but they still essentially rely on the idea of ​​decomposing a sequence +into independent elements, ignoring the sequence as a holistic object. Practically all existing approaches +to the study and description of symbolic sequences originate from the set-theoretic approach. + +Formal order analysis is based on the belief that a symbolic sequence can be considered as a holistic object +with emergent properties, which corresponds to systems thinking. This method studies, in addition to the set +of elements, the internal structure (composition, pattern) of the sequence, which determines its uniqueness +among others, including those consisting of the same set of elements. diff --git a/docs/fundamentals/ideas/sequence_as_an_system_object.md b/docs/fundamentals/ideas/sequence_as_an_system_object.md deleted file mode 100644 index c46c29ec..00000000 --- a/docs/fundamentals/ideas/sequence_as_an_system_object.md +++ /dev/null @@ -1,3 +0,0 @@ -# Sequence as a System Object - -Coming soon diff --git a/mkdocs.yml b/mkdocs.yml index 8975d29b..2fbb0fdd 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -6,7 +6,7 @@ nav: - fundamentals/index.md - "Ideas": - fundamentals/ideas/index.md - - "Sequence as a whole object": fundamentals/ideas/sequence_as_an_system_object.md + - "Sequence as a whole object": fundamentals/ideas/sequence_as_a_whole_object.md - "Order as a sequence property": fundamentals/ideas/order_as_a_sequence_property.md - "Congeneric decomposition": fundamentals/ideas/congeneric_decomposition.md - "Interval as a basic information unit": fundamentals/ideas/interval_as_a_basic_information_unit.md From 3d8147b8b5ed561071f5057ddb1328558d4eb5ee Mon Sep 17 00:00:00 2001 From: Igor Rodionov Date: Sun, 18 May 2025 20:02:07 +0200 Subject: [PATCH 02/35] Added order as a property pag --- .../fundamentals/ideas/order_as_a_property.md | 63 ++++++++++++++++++- .../ideas/sequence_as_a_whole_object.md | 2 +- mkdocs.yml | 2 +- 3 files changed, 64 insertions(+), 3 deletions(-) diff --git a/docs/fundamentals/ideas/order_as_a_property.md b/docs/fundamentals/ideas/order_as_a_property.md index 19deeea3..452fa957 100644 --- a/docs/fundamentals/ideas/order_as_a_property.md +++ b/docs/fundamentals/ideas/order_as_a_property.md @@ -1,3 +1,64 @@ +--- +hide: + - toc +--- # Order as a Property -Coming soon +Formal order analysis defines a special property of symbolic sequences - an Order. +The order is a sequence of natural numbers obtained from the original symbolic sequence by replacing each +of its elements with a natural number corresponding to the index of this element in the alphabet +sorted by the appearance of the elements in the original sequence. + +The concept of an Order can be conveniently demonstrated using an example: + + +Let's assume there is a symbolic sequence "INTELLIGENCE IS THE ABILITY TO ADAPT TO CHANGE" + +Highlight the first appearance of new elements "**I****N****T****E****L**LI**G**EN**C**E**_**I**S** T**H**E **A****B**ILIT**Y** T**O** A**D**A**P**T TO CHANGE" + +Enumirate first apperance elements + + + +| I | N | T | E | L | G | C | | S | H | A | B | Y | O | D | P | +|---|---|---|---|---|---|---|---|---|----|----|----|----|----|----|----| +| 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | + +Determine the order of the sequence by replacing each element of the sequence with its corresponding index + + +| I | N | T | E | L | L | I | G | E | N | C | E |    | I | S |    | T | H | E |    | A | B | I | L | I | T | Y |    | T | O |    | A | D | A | P | T |    | T | O |    | C | H | A | N | G | E | +|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---| +| 1 | 2 | 3 | 4 | 5 | 5 | 1 | 6 | 4 | 2 | 7 | 4 | 8 | 1 | 9 | 8 | 3 | 10 | 4 | 8 | 11 | 12 | 1 | 5 | 1 | 3 | 13 | 8 | 3 | 14 | 8 | 11 | 15 | 11 | 16 | 3 | 8 | 3 | 14 | 8 | 7 | 10 | 11 | 2 | 6 | 4 | + + +Despite the triviality of the concept Order, it allows to separate +the elements and composition of a sequence, to determine the compositional equivalence of different sequences. + +Example of sequences with equals orders: + +```pyodide exec="on" install="foapy,numpy" +import foapy +import numpy as np + +seqA = list("INTELLIGENCE IS THE ABILITY TO ADAPT TO CHANGE") +seqB = list("1N73LL1G3NC321527H324B1L17Y27024D4P72702CH4NG3") +orderA = foapy.order(seqA) +orderB = foapy.order(seqB) +print("SeqA and SeqB orders are equals -", np.all(orderA == orderB)) +print("Order =", orderA) +``` diff --git a/docs/fundamentals/ideas/sequence_as_a_whole_object.md b/docs/fundamentals/ideas/sequence_as_a_whole_object.md index 73e1227e..d6c2ae12 100644 --- a/docs/fundamentals/ideas/sequence_as_a_whole_object.md +++ b/docs/fundamentals/ideas/sequence_as_a_whole_object.md @@ -20,5 +20,5 @@ to the study and description of symbolic sequences originate from the set-theore Formal order analysis is based on the belief that a symbolic sequence can be considered as a holistic object with emergent properties, which corresponds to systems thinking. This method studies, in addition to the set -of elements, the internal structure (composition, pattern) of the sequence, which determines its uniqueness +of elements, the internal structure (pattern) of the sequence, which determines its uniqueness among others, including those consisting of the same set of elements. diff --git a/mkdocs.yml b/mkdocs.yml index 2fbb0fdd..415f89e1 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -7,7 +7,7 @@ nav: - "Ideas": - fundamentals/ideas/index.md - "Sequence as a whole object": fundamentals/ideas/sequence_as_a_whole_object.md - - "Order as a sequence property": fundamentals/ideas/order_as_a_sequence_property.md + - "Order as a property": fundamentals/ideas/order_as_a_property.md - "Congeneric decomposition": fundamentals/ideas/congeneric_decomposition.md - "Interval as a basic information unit": fundamentals/ideas/interval_as_a_basic_information_unit.md - "Geomteric mean as alternative to probability": fundamentals/ideas/geometric_mean_based_characteristics.md From edabe8281b606a5baa915bab92729ae530e177f0 Mon Sep 17 00:00:00 2001 From: Igor Rodionov Date: Sun, 18 May 2025 22:31:01 +0200 Subject: [PATCH 03/35] Added order as a property pag --- docs/fundamentals/ideas/order_as_a_property.md | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/docs/fundamentals/ideas/order_as_a_property.md b/docs/fundamentals/ideas/order_as_a_property.md index 452fa957..9a780119 100644 --- a/docs/fundamentals/ideas/order_as_a_property.md +++ b/docs/fundamentals/ideas/order_as_a_property.md @@ -27,8 +27,7 @@ Enumirate first apperance elements } .md-typeset td, .md-typeset th { - padding-left: 0.4em !important; - padding-right: 0.4em !important; + padding: 0.1em 0.4 !important; text-align: center !important; } From aadf7e35979aa8bc3265b5206a7aab2f7c5006e1 Mon Sep 17 00:00:00 2001 From: Igor Rodionov Date: Sun, 18 May 2025 22:34:27 +0200 Subject: [PATCH 04/35] Added order as a property pag --- docs/fundamentals/ideas/order_as_a_property.md | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/docs/fundamentals/ideas/order_as_a_property.md b/docs/fundamentals/ideas/order_as_a_property.md index 9a780119..9fff3d07 100644 --- a/docs/fundamentals/ideas/order_as_a_property.md +++ b/docs/fundamentals/ideas/order_as_a_property.md @@ -14,7 +14,12 @@ The concept of an Order can be conveniently demonstrated using an example: Let's assume there is a symbolic sequence "INTELLIGENCE IS THE ABILITY TO ADAPT TO CHANGE" -Highlight the first appearance of new elements "**I****N****T****E****L**LI**G**EN**C**E**_**I**S** T**H**E **A****B**ILIT**Y** T**O** A**D**A**P**T TO CHANGE" +Highlight the first appearance of new elements + +| I | N | T | E | L | L | I | G | E | N | C | E |    | I | S |    | T | H | E |    | A | B | I | L | I | T | Y |    | T | O |    | A | D | A | P | T |    | T | O |    | C | H | A | N | G | E | +|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---| +| 1 | 2 | 3 | 4 | 5 | | | 6 | | | 7 | | 8 | | 9 | | | 10 | | | 11 | 12 | | | | | 13 | | | 14 | | | 15 | | 16 | | | | | | | | | | | | + Enumirate first apperance elements +| 1 | 2 | 3 | 4 | 5 | | | 6 | | | 7 | | 8 | | 9 | | | 10 | | | 11 | 12 | | | | | 13 | | | 14 | | | 15 | | 16 | | | | | | | | | | | | +The alphabet for the sequence would be sequence of unique elements: | I | N | T | E | L | G | C | | S | H | A | B | Y | O | D | P | |---|---|---|---|---|---|---|---|---|----|----|----|----|----|----|----| | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | -Determine the order of the sequence by replacing each element of the sequence with its corresponding index + +Determine the order of the sequence by replacing each element of the sequence with its corresponding alphabet index | I | N | T | E | L | L | I | G | E | N | C | E |    | I | S |    | T | H | E |    | A | B | I | L | I | T | Y |    | T | O |    | A | D | A | P | T |    | T | O |    | C | H | A | N | G | E | |---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---| | 1 | 2 | 3 | 4 | 5 | 5 | 1 | 6 | 4 | 2 | 7 | 4 | 8 | 1 | 9 | 8 | 3 | 10 | 4 | 8 | 11 | 12 | 1 | 5 | 1 | 3 | 13 | 8 | 3 | 14 | 8 | 11 | 15 | 11 | 16 | 3 | 8 | 3 | 14 | 8 | 7 | 10 | 11 | 2 | 6 | 4 | +The order of symbolic sequence `INTELLIGENCE IS THE ABILITY TO ADAPT TO CHANGE` is -Despite the triviality of the concept Order, it allows to separate -the elements and composition of a sequence, to determine the compositional equivalence of different sequences. +| 1 | 2 | 3 | 4 | 5 | 5 | 1 | 6 | 4 | 2 | 7 | 4 | 8 | 1 | 9 | 8 | 3 | 10 | 4 | 8 | 11 | 12 | 1 | 5 | 1 | 3 | 13 | 8 | 3 | 14 | 8 | 11 | 15 | 11 | 16 | 3 | 8 | 3 | 14 | 8 | 7 | 10 | 11 | 2 | 6 | 4 | +|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---| + + + +Despite the triviality of the concept Order, it allows us to separate the elements and composition of a sequence and to define the compositional equivalence of different sequences. Example of sequences with equals orders: @@ -66,3 +56,21 @@ orderB = foapy.order(seqB) print("SeqA and SeqB orders are equals -", np.all(orderA == orderB)) print("Order =", orderA) ``` + + From ea5d3097b89b72c3e56c1117a79f3460e5010cb2 Mon Sep 17 00:00:00 2001 From: Nikolay Pozdnichenko Date: Tue, 20 May 2025 00:53:28 +0600 Subject: [PATCH 06/35] Update sequence_as_a_whole_object.md Fixed some phrases and sentences. --- .../ideas/sequence_as_a_whole_object.md | 22 ++++++++++--------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/docs/fundamentals/ideas/sequence_as_a_whole_object.md b/docs/fundamentals/ideas/sequence_as_a_whole_object.md index d6c2ae12..69872ac6 100644 --- a/docs/fundamentals/ideas/sequence_as_a_whole_object.md +++ b/docs/fundamentals/ideas/sequence_as_a_whole_object.md @@ -1,24 +1,26 @@ # Sequence as a whole object -Symbol sequences are a common model in many theoretical and applied science areas. +Texts / ordered data arrays / time series of various nature are a common model in theoretical and applied science. This prevalence is since almost any object of study can be represented as a sequence of elements or events. However, if we set aside our knowledge of the essence of the elements in a specific case and -consider the sequence as a separate object of study, then only probabilistic (statistical) methods or -various methods for comparing sequences (for example, the Levenshtein distance) are used. +consider the sequence itself as a separate object of study, then it turns out that methods used +to study them are almost exclusively statistical. +With the only exception being methods for comparison / alignment of two or more sequences +(for example, the Levenshtein distance). -None of these methods describes the sequence as a holistic object. -The Levenshtein distance requires a different sequence to compare with the original one, which makes +None of these methods describe a sequence as a holistic object. +The Levenshtein distance requires another sequence to compare with the original one, which makes the measures of this approach "relative". The probabilistic approach decomposes the sequence into -elements and calculates their probabilities. Thus, the sequence is replaced, as an object of study, +elements and calculates their probabilities (frequencies). Thus, the sequence is replaced, as an object of study, by a probability distribution. In turn, a specific probability distribution corresponds to an infinite number of sequences with a ratio of elements "close" to the one in the original sequence. Moments, conditional probabilities, Shannon entropy, and Markov chains allow us to more accurately -model the object under study, but they still essentially rely on the idea of ​​decomposing a sequence +model the object under study, but they still essentially rely on the idea of decomposing a sequence into independent elements, ignoring the sequence as a holistic object. Practically all existing approaches to the study and description of symbolic sequences originate from the set-theoretic approach. Formal order analysis is based on the belief that a symbolic sequence can be considered as a holistic object -with emergent properties, which corresponds to systems thinking. This method studies, in addition to the set -of elements, the internal structure (pattern) of the sequence, which determines its uniqueness -among others, including those consisting of the same set of elements. +with emergent properties, which corresponds to systems thinking. In addition to the distribution +of elements this method studies arrangement of its components - the internal structure (pattern) of the sequence, +which determines its uniqueness among others, including those consisting of the same set of elements. From 22a309717cafe2be4c634f016ce70f62e0c6c32e Mon Sep 17 00:00:00 2001 From: Igor Rodionov Date: Sat, 24 May 2025 10:01:13 +0200 Subject: [PATCH 07/35] Fix text --- docs/fundamentals/ideas/sequence_as_a_whole_object.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/docs/fundamentals/ideas/sequence_as_a_whole_object.md b/docs/fundamentals/ideas/sequence_as_a_whole_object.md index 69872ac6..3f4b72dd 100644 --- a/docs/fundamentals/ideas/sequence_as_a_whole_object.md +++ b/docs/fundamentals/ideas/sequence_as_a_whole_object.md @@ -1,12 +1,12 @@ # Sequence as a whole object -Texts / ordered data arrays / time series of various nature are a common model in theoretical and applied science. +Symbol sequences are a common model in theoretical and applied science. This prevalence is since almost any object of study can be represented as a sequence of elements or events. However, if we set aside our knowledge of the essence of the elements in a specific case and -consider the sequence itself as a separate object of study, then it turns out that methods used -to study them are almost exclusively statistical. -With the only exception being methods for comparison / alignment of two or more sequences +consider the sequence itself as a separate object of study, then it turns out that methods used +to study them are almost exclusively statistical. +With the only exception being methods for comparison / alignment of two or more sequences (for example, the Levenshtein distance). None of these methods describe a sequence as a holistic object. @@ -22,5 +22,5 @@ to the study and description of symbolic sequences originate from the set-theore Formal order analysis is based on the belief that a symbolic sequence can be considered as a holistic object with emergent properties, which corresponds to systems thinking. In addition to the distribution -of elements this method studies arrangement of its components - the internal structure (pattern) of the sequence, +of elements this method studies arrangement of its components - the internal structure (pattern) of the sequence, which determines its uniqueness among others, including those consisting of the same set of elements. From ab112126a4e86ccc0451c835640625ca50f4d727 Mon Sep 17 00:00:00 2001 From: Igor Rodionov Date: Sun, 1 Jun 2025 13:40:55 +0200 Subject: [PATCH 08/35] Added Congeneric decomposition --- .../ideas/congeneric_decomposition.md | 63 ++++++++++++++++++- 1 file changed, 62 insertions(+), 1 deletion(-) diff --git a/docs/fundamentals/ideas/congeneric_decomposition.md b/docs/fundamentals/ideas/congeneric_decomposition.md index 878292d3..bedc9037 100644 --- a/docs/fundamentals/ideas/congeneric_decomposition.md +++ b/docs/fundamentals/ideas/congeneric_decomposition.md @@ -1,3 +1,64 @@ +--- +hide: + - toc +--- # Congeneric Decomposition -Coming soon +Cogeneric decomposition is a method for decomposing symbolic sequences from a systems thinking perspective, +emphasizing the importance of order. It decomposes a sequence into a tuple of cogeneric sequences, +each of which consists of equivalent elements at certain positions, while all other positions are empty. +This reversible process preserves the order of the sequence and allows the original sequence to be fully reconstructed. + +The concept of Cogeneric decomposition can be demonstrated using an example: + +Let's assume there is a symbolic sequence `INTELLIGENCE IS THE ABILITY TO ADAPT TO CHANGE` congeneric decomposition +could be presented by the following table, where each row is a congeneric sequence and `-` is an empty position in a congeneric sequence. + +| I | N | T | E | L | L | I | G | E | N | C | E |    | I | S |    | T | H | E |    | A | B | I | L | I | T | Y |    | T | O |    | A | D | A | P | T |    | T | O |    | C | H | A | N | G | E | +|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---| +| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +| I | - | - | - | - | - | I | - | - | - | - | - | - | I | - | - | - | - | - | - | - | - | I | - | I | - | - | - | - | - | - | - | - | - | - | - | - | - | - | - | - | - | - | - | - | - | +| - | N | - | - | - | - | - | - | - | N | - | - | - | - | - | - | - | - | - | - | - | - | - | - | - | - | - | - | - | - | - | - | - | - | - | - | - | - | - | - | - | - | - | N | - | - | +| - | - | T | - | - | - | - | - | - | - | - | - | - | - | - | - | T | - | - | - | - | - | - | - | - | T | - | - | T | - | - | - | - | - | - | T | - | T | - | - | - | - | - | - | - | - | +| - | - | - | E | - | - | - | - | E | - | - | E | - | - | - | - | - | - | E | - | - | - | - | - | - | - | - | - | - | - | - | - | - | - | - | - | - | - | - | - | - | - | - | - | - | E | +| - | - | - | - | L | L | - | - | - | - | - | - | - | - | - | - | - | - | - | - | - | - | - | L | - | - | - | - | - | - | - | - | - | - | - | - | - | - | - | - | - | - | - | - | - | - | +| - | - | - | - | - | - | - | G | - | - | - | - | - | - | - | - | - | - | - | - | - | - | - | - | - | - | - | - | - | - | - | - | - | - | - | - | - | - | - | - | - | - | - | - | G | - | +| - | - | - | - | - | - | - | - | - | - | C | - | - | - | - | - | - | - | - | - | - | - | - | - | - | - | - | - | - | - | - | - | - | - | - | - | - | - | - | - | C | - | - | - | - | - | +| - | - | - | - | - | - | - | - | - | - | - | - |    | - | - |    | - | - | - |    | - | - | - | - | - | - | - |    | - | - |    | - | - | - | - | - |    | - | - |    | - | - | - | - | - | - | +| - | - | - | - | - | - | - | - | - | - | - | - | - | - | S | - | - | - | - | - | - | - | - | - | - | - | - | - | - | - | - | - | - | - | - | - | - | - | - | - | - | - | - | - | - | - | +| - | - | - | - | - | - | - | - | - | - | - | - | - | - | - | - | - | H | - | - | - | - | - | - | - | - | - | - | - | - | - | - | - | - | - | - | - | - | - | - | - | H | - | - | - | - | +| - | - | - | - | - | - | - | - | - | - | - | - | - | - | - | - | - | - | - | - | A | - | - | - | - | - | - | - | - | - | - | A | - | A | - | - | - | - | - | - | - | - | A | - | - | - | +| - | - | - | - | - | - | - | - | - | - | - | - | - | - | - | - | - | - | - | - | - | B | - | - | - | - | - | - | - | - | - | - | - | - | - | - | - | - | - | - | - | - | - | - | - | - | +| - | - | - | - | - | - | - | - | - | - | - | - | - | - | - | - | - | - | - | - | - | - | - | - | - | - | Y | - | - | - | - | - | - | - | - | - | - | - | - | - | - | - | - | - | - | - | +| - | - | - | - | - | - | - | - | - | - | - | - | - | - | - | - | - | - | - | - | - | - | - | - | - | - | - | - | - | O | - | - | - | - | - | - | - | - | O | - | - | - | - | - | - | - | +| - | - | - | - | - | - | - | - | - | - | - | - | - | - | - | - | - | - | - | - | - | - | - | - | - | - | - | - | - | - | - | - | D | - | - | - | - | - | - | - | - | - | - | - | - | - | +| - | - | - | - | - | - | - | - | - | - | - | - | - | - | - | - | - | - | - | - | - | - | - | - | - | - | - | - | - | - | - | - | - | - | P | - | - | - | - | - | - | - | - | - | - | - | + + +Congeneric sequence for `I` +``` +I - - - - - I - - - - - - I - - - - - - - - I - I - - - - - - - - - - - - - - - - - - - - - +``` +could be a part of multiple symbol sequences that have the same order of `I` element. + +While keeping the main idea, the congeneric decomposition could be applied, with a flavor, to any type of special case symbolic sequences, such as Order. + + + + From bbc30060d333a2edb0b9204e2794dda90bfe09a1 Mon Sep 17 00:00:00 2001 From: Igor Rodionov Date: Sun, 8 Jun 2025 00:24:19 +0200 Subject: [PATCH 09/35] Interval as information unit --- .pre-commit-config.yaml | 1 + .../interval_as_a_basic_information_unit.md | 43 ++++++++++++++++++- mkdocs.yml | 6 ++- 3 files changed, 48 insertions(+), 2 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 0250b21d..e8abf785 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -11,6 +11,7 @@ repos: - id: check-merge-conflict - id: check-xml - id: check-yaml + args: ['--unsafe'] - id: debug-statements - id: end-of-file-fixer - id: requirements-txt-fixer diff --git a/docs/fundamentals/ideas/interval_as_a_basic_information_unit.md b/docs/fundamentals/ideas/interval_as_a_basic_information_unit.md index dba6d4fe..818c7182 100644 --- a/docs/fundamentals/ideas/interval_as_a_basic_information_unit.md +++ b/docs/fundamentals/ideas/interval_as_a_basic_information_unit.md @@ -1,3 +1,44 @@ +--- +hide: + - toc +--- # Interval as a Basic Information Unit -Coming soon +Intervals serve as a fundamental unit of information by measuring the number of different +items, events, or symbols that occur between reseated in a sequence. + +The intervals for symbol `A` in the following sequence would be `[3, 3, 1, 1, 1, 2, 1]` +``` mermaid +block-beta + columns 12 + s1["A"] s2["C"] s3["T"] s4["A"] s5["C"] s6["G"] s7["A"] s8["A"] s9["A"] s10["T"] s11["A"] s12["A"] + i1["3"]:3 i2["3"]:3 i3["1"]:1 i4["1"]:1 i5["1"]:1 i6["2"]:2 i7["1"]:1 +``` + +In general, a sequence does not necessarily end with the same symbol it begins with. +To cover all cases, we consider the sequence as a looped sequence representing an infinite pattern with the same characteristics as the original data +This cyclic approach corresponds to the idea of ​​representativeness heuristic. + +The intervals for symbol `C` in the following cycled sequence would be `[3, 9]` +``` mermaid +block-beta + columns 15 + s1["A"] s2["C"] s3["T"] s4["A"] s5["C"] s6["G"] s7["A"] s8["A"] s9["A"] s10["T"] s11["A"] s12["A"] space s13["T"] s14["C"] + space i1["3"]:3 i2["9"]:10 + s12 --> s13 +``` + +The circular pattern preserves both the statistical properties and the order of elements. +Moreover, the average interval length is the inverse of the probability of an event, which directly relates intervals to probability. + +\begin{array}{|c|c|c|} +\hline + & \Delta_a & P \\ +\hline +A & \frac{3 + 3 + 1 + 1 + 1 + 2 + 1}{7} = \frac{12}{7} \approx 1.7142; & \frac{7}{12} = (\frac{12}{7})^{-1} = \Delta_a^{-1} \\ +\hline +C & \frac{3 + 9}{2} = \frac{12}{2} = 6 & \frac{2}{12} = \frac{1}{6} = 6^{-1} = \Delta_a^{-1} \\ +\hline +\end{array} + +This makes intervals a crucial informational unit that offers deeper insights into the sequence than individual occurrences alone. diff --git a/mkdocs.yml b/mkdocs.yml index 415f89e1..a96bf592 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -138,12 +138,16 @@ markdown_extensions: pygments_lang_class: true - pymdownx.inlinehilite - pymdownx.snippets - - pymdownx.superfences - tables - pymdownx.tabbed: alternate_style: true - pymdownx.arithmatex: generic: true + - pymdownx.superfences: + custom_fences: + - name: mermaid + class: mermaid + format: !!python/name:pymdownx.superfences.fence_code_format plugins: - autorefs From 130897accc5f6395cf49fb7b56565a0a85ec8f66 Mon Sep 17 00:00:00 2001 From: Igor Rodionov Date: Sun, 8 Jun 2025 00:26:49 +0200 Subject: [PATCH 10/35] Interval as information unit --- .../ideas/interval_as_a_basic_information_unit.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/fundamentals/ideas/interval_as_a_basic_information_unit.md b/docs/fundamentals/ideas/interval_as_a_basic_information_unit.md index 818c7182..5e8b547f 100644 --- a/docs/fundamentals/ideas/interval_as_a_basic_information_unit.md +++ b/docs/fundamentals/ideas/interval_as_a_basic_information_unit.md @@ -7,12 +7,12 @@ hide: Intervals serve as a fundamental unit of information by measuring the number of different items, events, or symbols that occur between reseated in a sequence. -The intervals for symbol `A` in the following sequence would be `[3, 3, 1, 1, 1, 2, 1]` +The intervals for symbol `A` in the following sequence would be `[3, 3, 1, 1, 2, 1, 1]` ``` mermaid block-beta columns 12 s1["A"] s2["C"] s3["T"] s4["A"] s5["C"] s6["G"] s7["A"] s8["A"] s9["A"] s10["T"] s11["A"] s12["A"] - i1["3"]:3 i2["3"]:3 i3["1"]:1 i4["1"]:1 i5["1"]:1 i6["2"]:2 i7["1"]:1 + i1["3"]:3 i2["3"]:3 i3["1"]:1 i4["1"]:1 i5["2"]:2 i6["1"]:1 i7["1"]:1 ``` In general, a sequence does not necessarily end with the same symbol it begins with. @@ -35,7 +35,7 @@ Moreover, the average interval length is the inverse of the probability of an ev \hline & \Delta_a & P \\ \hline -A & \frac{3 + 3 + 1 + 1 + 1 + 2 + 1}{7} = \frac{12}{7} \approx 1.7142; & \frac{7}{12} = (\frac{12}{7})^{-1} = \Delta_a^{-1} \\ +A & \frac{3 + 3 + 1 + 1 + 2 + 1 + 1}{7} = \frac{12}{7} \approx 1.7142; & \frac{7}{12} = (\frac{12}{7})^{-1} = \Delta_a^{-1} \\ \hline C & \frac{3 + 9}{2} = \frac{12}{2} = 6 & \frac{2}{12} = \frac{1}{6} = 6^{-1} = \Delta_a^{-1} \\ \hline From 70322344c56b281c6b52206ddba96250843c082c Mon Sep 17 00:00:00 2001 From: Igor Rodionov Date: Sun, 8 Jun 2025 23:19:34 +0200 Subject: [PATCH 11/35] Finish ideas --- .../geometric_mean_based_characteristics.md | 33 ++++++++++++++++++- 1 file changed, 32 insertions(+), 1 deletion(-) diff --git a/docs/fundamentals/ideas/geometric_mean_based_characteristics.md b/docs/fundamentals/ideas/geometric_mean_based_characteristics.md index 504d1552..988c11c2 100644 --- a/docs/fundamentals/ideas/geometric_mean_based_characteristics.md +++ b/docs/fundamentals/ideas/geometric_mean_based_characteristics.md @@ -1,3 +1,34 @@ +--- +hide: + - toc +--- # Geometric Mean as Alternative to Probability -Coming soon +At first glance, introducing the concept of [intervals](interval_as_a_basic_information_unit.md) may seem like an unnecessary complication. +After all, if the ultimate goal is to estimate the probability of a symbol, there are much simpler methods - counting the frequency of occurrence of a symbol relative to the total. + +However, this perspective begins to shift when we consider other types of aggregate functions beyond the arithmetic mean. +One particularly insightful example is the geometric mean of intervals. +While the arithmetic mean smooths out the "structure" of the data and bring us back to probability +(since the average interval between identical symbols is simply the inverse of their probability), +the geometric mean responds to the diversity of intervals in a fundamentally different way. + +If the intervals between repeated elements are uniform, the geometric mean and the arithmetic mean will be the same. +But as the intervals become more irregular — because symbols appear in bursts or clusters — [the geometric mean begins +to diverge from the arithmetic mean](https://en.wikipedia.org/wiki/AM%E2%80%93GM_inequality). +This makes it a sensitive indicator of the order within the sequence, not just the frequency. + +![AM-GM inequality visual proof](https://upload.wikimedia.org/wikipedia/commons/d/d9/AM_GM_inequality_visual_proof.svg) + +*Visual proof of the arithmetic mean - geometric mean inequality. Source: [wikipedia.org](https://en.wikipedia.org/wiki/File:AM_GM_inequality_visual_proof.svg)* + +Building on this idea, Former Order Analysis explored the potential of reinterpreting classical probabilistic and information-theoretic measures in terms of these intervals. +Instead of relying solely on symbol frequencies, it reformulated the measures using the geometric mean instead of probability (arithmetic mean). + +\begin{array}{|c|c|} +H= - \sum_{i=1}^{m}{p_j \log_2{p_j}} = \frac {1} {n} * \sum_{j=1}^{m}{(n_j * \log_2 \sum_{i=1}^{n_j} \frac{\Delta_{ij}}{n_j})} & \\ +\end{array} + +These measures are fine-grained and sensitive to the temporal or spatial order of elements in a sequence. +Allows us to distinguish between sequences of symbols that may have identical probability distributions +but differ in the way those symbols are arranged - insight that traditional measures completely miss. From 487b3e5f457f70bfcb5cccdfc0e43182d227fd05 Mon Sep 17 00:00:00 2001 From: Igor Rodionov Date: Sun, 8 Jun 2025 23:42:57 +0200 Subject: [PATCH 12/35] Finish ideas --- docs/fundamentals/ideas/index.md | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/docs/fundamentals/ideas/index.md b/docs/fundamentals/ideas/index.md index 8c15c86d..b7aecd8b 100644 --- a/docs/fundamentals/ideas/index.md +++ b/docs/fundamentals/ideas/index.md @@ -1,3 +1,20 @@ # Ideas -Coming soon +Formal Order Analsis is based on five main ideas: + +* [Sequence as a Whole Object](sequence_as_a_whole_object.md) - +Treat a symbolic sequence as a unique whole, focusing on its internal structure and emergent properties. + +* [Order as a Property](order_as_a_property.md) - +By replacing each symbol in a sequence with its index in a dynamic alphabet, we define an "Order" — a new property that separates the content of the sequence from its composition. + +* [Congeneric Decomposition](congeneric_decomposition.md) - +This method breaks a symbolic sequence into layered sub-sequences where each layer isolates a single symbol’s positions, +preserving the sequence’s internal order and making its structure more analyzable. + +* [Interval as a Basic Information Unit](interval_as_a_basic_information_unit.md) - +Intervals measure the distance between repeated elements, revealing hidden patterns in repetition and spacing. + +* [Geometric Mean as Alternative to Probability](geometric_mean_based_characteristics.md) - +Using measurements based on the geometric mean of intervals instead of the probability of symbols (the arithmetic mean of occurrence) +allows us to move from recording simple frequency to recording the underlying structure and regularity in the arrangement of symbols. From 9b13402242476fbe18a67a72f1d0c8623b94b17f Mon Sep 17 00:00:00 2001 From: Igor Rodionov Date: Mon, 9 Jun 2025 11:05:23 +0200 Subject: [PATCH 13/35] Fix formulas --- .../ideas/geometric_mean_based_characteristics.md | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/docs/fundamentals/ideas/geometric_mean_based_characteristics.md b/docs/fundamentals/ideas/geometric_mean_based_characteristics.md index 988c11c2..9c4d9bb5 100644 --- a/docs/fundamentals/ideas/geometric_mean_based_characteristics.md +++ b/docs/fundamentals/ideas/geometric_mean_based_characteristics.md @@ -26,9 +26,15 @@ Building on this idea, Former Order Analysis explored the potential of reinterpr Instead of relying solely on symbol frequencies, it reformulated the measures using the geometric mean instead of probability (arithmetic mean). \begin{array}{|c|c|} -H= - \sum_{i=1}^{m}{p_j \log_2{p_j}} = \frac {1} {n} * \sum_{j=1}^{m}{(n_j * \log_2 \sum_{i=1}^{n_j} \frac{\Delta_{ij}}{n_j})} & \\ +\hline +Entropy & Average \ remoteness \\ +\hline +H= - \sum_{i=j}^{m}{p_j \log_2{p_j}} = \frac {1} {n} * \sum_{j=1}^{m}{n_j \log_2 \Delta_{a_j}} & g = \frac{1}{n} * \sum_{i=j}^{m}{n_j \log_2{\Delta_{g_j}}} = \frac{1}{n} * \sum_{i=j}^{m}{\sum_{i=1}^{n_j} \log_2 \Delta_{ij}} \\ +\hline \end{array} +*Example of Shennon's Entropy analog - Average remoteness. Where $n$ - seqeunce length, $m$ - alphabet power, $n_j$ - count of element $j$-th, $\Delta_{a_j}$ - average mean of intervals for element $j$-th, $\Delta_{g_j}$ - geometric mean of intervals for element $j$-th, $\Delta_{ij}$ - $i$-th interval for element $j$-thg* + These measures are fine-grained and sensitive to the temporal or spatial order of elements in a sequence. Allows us to distinguish between sequences of symbols that may have identical probability distributions but differ in the way those symbols are arranged - insight that traditional measures completely miss. From cbaeeb8088b10cf63fc47bdfb3e72988b69b0185 Mon Sep 17 00:00:00 2001 From: Igor Rodionov Date: Mon, 9 Jun 2025 11:34:06 +0200 Subject: [PATCH 14/35] Fix typo --- docs/fundamentals/ideas/geometric_mean_based_characteristics.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/fundamentals/ideas/geometric_mean_based_characteristics.md b/docs/fundamentals/ideas/geometric_mean_based_characteristics.md index 9c4d9bb5..86ba5fb5 100644 --- a/docs/fundamentals/ideas/geometric_mean_based_characteristics.md +++ b/docs/fundamentals/ideas/geometric_mean_based_characteristics.md @@ -29,7 +29,7 @@ Instead of relying solely on symbol frequencies, it reformulated the measures us \hline Entropy & Average \ remoteness \\ \hline -H= - \sum_{i=j}^{m}{p_j \log_2{p_j}} = \frac {1} {n} * \sum_{j=1}^{m}{n_j \log_2 \Delta_{a_j}} & g = \frac{1}{n} * \sum_{i=j}^{m}{n_j \log_2{\Delta_{g_j}}} = \frac{1}{n} * \sum_{i=j}^{m}{\sum_{i=1}^{n_j} \log_2 \Delta_{ij}} \\ +H= - \sum_{j=1}^{m}{p_j \log_2{p_j}} = \frac {1} {n} * \sum_{j=1}^{m}{n_j \log_2 \Delta_{a_j}} & g = \frac{1}{n} * \sum_{j=1}^{m}{n_j \log_2{\Delta_{g_j}}} = \frac{1}{n} * \sum_{j=1}^{m}{\sum_{i=1}^{n_j} \log_2 \Delta_{ij}} \\ \hline \end{array} From 21ecb64121b59420ba8985f8995fd55252c33c07 Mon Sep 17 00:00:00 2001 From: Nikolay Pozdnichenko Date: Mon, 9 Jun 2025 23:32:55 +0600 Subject: [PATCH 15/35] Update order_as_a_property.md Added references section --- docs/fundamentals/ideas/order_as_a_property.md | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/docs/fundamentals/ideas/order_as_a_property.md b/docs/fundamentals/ideas/order_as_a_property.md index 5de14681..32b2851f 100644 --- a/docs/fundamentals/ideas/order_as_a_property.md +++ b/docs/fundamentals/ideas/order_as_a_property.md @@ -7,7 +7,7 @@ hide: Formal order analysis defines a special property of symbolic sequences - an Order. The order is a sequence of natural numbers obtained from the original symbolic sequence by replacing each of its elements with a natural number corresponding to the index of this element in the alphabet -sorted by the appearance of the elements in the original sequence. +sorted by the appearance of the elements in the original sequence [1, 2, 3]. The concept of an Order can be conveniently demonstrated using an example: @@ -74,3 +74,9 @@ print("Order =", orderA) text-align: center !important; } + +# References: + +1. Curtis Cooper and Robert E. Kennedy. 1992. Patterns, automata, and Stirling numbers of the second kind. Math. Comput. Educ. 26, 2 (Spring 1992), 120–124. +2. Gumenjuk A., Kostyshin A., Simonova S. An approach to the research of the structure of linguistic and musical texts. Glottometrics. 2002. № 3. P. 61–89. +3. (In russian) V.I. Arnold, Complexity of finite sequences of zeros and ones and geometry of finite function spaces: el. print, 2005. http://mms.mathnet.ru/meetings/2005/arnold.pdf From 4fa971919cd6c6909c55cc0430ddd1707705f081 Mon Sep 17 00:00:00 2001 From: Igor Rodionov Date: Sat, 14 Jun 2025 20:00:03 +0200 Subject: [PATCH 16/35] Added marmaid diagram --- docs/assets/js/mathjax.js | 4 +- .../ideas/congeneric_decomposition.md | 206 +++++++++++-- .../fundamentals/ideas/order_as_a_property.md | 284 +++++++++++++++++- 3 files changed, 454 insertions(+), 40 deletions(-) diff --git a/docs/assets/js/mathjax.js b/docs/assets/js/mathjax.js index 0c7803cf..561944cd 100644 --- a/docs/assets/js/mathjax.js +++ b/docs/assets/js/mathjax.js @@ -1,9 +1,11 @@ window.MathJax = { + loader: {load: ['[tex]/colortbl']}, tex: { inlineMath: [["\\(", "\\)"]], displayMath: [["\\[", "\\]"]], processEscapes: true, - processEnvironments: true + processEnvironments: true, + packages: {'[+]': ['colortbl']}, }, options: { ignoreHtmlClass: ".*|", diff --git a/docs/fundamentals/ideas/congeneric_decomposition.md b/docs/fundamentals/ideas/congeneric_decomposition.md index bedc9037..6ce33b9a 100644 --- a/docs/fundamentals/ideas/congeneric_decomposition.md +++ b/docs/fundamentals/ideas/congeneric_decomposition.md @@ -11,35 +11,191 @@ This reversible process preserves the order of the sequence and allows the origi The concept of Cogeneric decomposition can be demonstrated using an example: -Let's assume there is a symbolic sequence `INTELLIGENCE IS THE ABILITY TO ADAPT TO CHANGE` congeneric decomposition +Let's assume there is a symbolic sequence `INTELLIGENCE IS THE ABILITY TO ADAPT` congeneric decomposition could be presented by the following table, where each row is a congeneric sequence and `-` is an empty position in a congeneric sequence. -| I | N | T | E | L | L | I | G | E | N | C | E |    | I | S |    | T | H | E |    | A | B | I | L | I | T | Y |    | T | O |    | A | D | A | P | T |    | T | O |    | C | H | A | N | G | E | -|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---| -| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | -| I | - | - | - | - | - | I | - | - | - | - | - | - | I | - | - | - | - | - | - | - | - | I | - | I | - | - | - | - | - | - | - | - | - | - | - | - | - | - | - | - | - | - | - | - | - | -| - | N | - | - | - | - | - | - | - | N | - | - | - | - | - | - | - | - | - | - | - | - | - | - | - | - | - | - | - | - | - | - | - | - | - | - | - | - | - | - | - | - | - | N | - | - | -| - | - | T | - | - | - | - | - | - | - | - | - | - | - | - | - | T | - | - | - | - | - | - | - | - | T | - | - | T | - | - | - | - | - | - | T | - | T | - | - | - | - | - | - | - | - | -| - | - | - | E | - | - | - | - | E | - | - | E | - | - | - | - | - | - | E | - | - | - | - | - | - | - | - | - | - | - | - | - | - | - | - | - | - | - | - | - | - | - | - | - | - | E | -| - | - | - | - | L | L | - | - | - | - | - | - | - | - | - | - | - | - | - | - | - | - | - | L | - | - | - | - | - | - | - | - | - | - | - | - | - | - | - | - | - | - | - | - | - | - | -| - | - | - | - | - | - | - | G | - | - | - | - | - | - | - | - | - | - | - | - | - | - | - | - | - | - | - | - | - | - | - | - | - | - | - | - | - | - | - | - | - | - | - | - | G | - | -| - | - | - | - | - | - | - | - | - | - | C | - | - | - | - | - | - | - | - | - | - | - | - | - | - | - | - | - | - | - | - | - | - | - | - | - | - | - | - | - | C | - | - | - | - | - | -| - | - | - | - | - | - | - | - | - | - | - | - |    | - | - |    | - | - | - |    | - | - | - | - | - | - | - |    | - | - |    | - | - | - | - | - |    | - | - |    | - | - | - | - | - | - | -| - | - | - | - | - | - | - | - | - | - | - | - | - | - | S | - | - | - | - | - | - | - | - | - | - | - | - | - | - | - | - | - | - | - | - | - | - | - | - | - | - | - | - | - | - | - | -| - | - | - | - | - | - | - | - | - | - | - | - | - | - | - | - | - | H | - | - | - | - | - | - | - | - | - | - | - | - | - | - | - | - | - | - | - | - | - | - | - | H | - | - | - | - | -| - | - | - | - | - | - | - | - | - | - | - | - | - | - | - | - | - | - | - | - | A | - | - | - | - | - | - | - | - | - | - | A | - | A | - | - | - | - | - | - | - | - | A | - | - | - | -| - | - | - | - | - | - | - | - | - | - | - | - | - | - | - | - | - | - | - | - | - | B | - | - | - | - | - | - | - | - | - | - | - | - | - | - | - | - | - | - | - | - | - | - | - | - | -| - | - | - | - | - | - | - | - | - | - | - | - | - | - | - | - | - | - | - | - | - | - | - | - | - | - | Y | - | - | - | - | - | - | - | - | - | - | - | - | - | - | - | - | - | - | - | -| - | - | - | - | - | - | - | - | - | - | - | - | - | - | - | - | - | - | - | - | - | - | - | - | - | - | - | - | - | O | - | - | - | - | - | - | - | - | O | - | - | - | - | - | - | - | -| - | - | - | - | - | - | - | - | - | - | - | - | - | - | - | - | - | - | - | - | - | - | - | - | - | - | - | - | - | - | - | - | D | - | - | - | - | - | - | - | - | - | - | - | - | - | -| - | - | - | - | - | - | - | - | - | - | - | - | - | - | - | - | - | - | - | - | - | - | - | - | - | - | - | - | - | - | - | - | - | - | P | - | - | - | - | - | - | - | - | - | - | - | - - -Congeneric sequence for `I` + + + + + +``` mermaid +block-beta + columns 36 + seq1["I"] seq2["N"] seq3["T"] seq4["E"] seq5["L"] seq6["L"] seq7["I"] seq8["G"] seq9["E"] seq10["N"] + seq11["C"] seq12["E"] seq13[" "] seq14["I"] seq15["S"] seq16[" "] seq17["T"] seq18["H"] seq19["E"] seq20[" "] + seq21["A"] seq22["B"] seq23["I"] seq24["L"] seq25["I"] seq26["T"] seq27["Y"] seq28[" "] seq29["T"] seq30["O"] + seq31[" "] seq32["A"] seq33["D"] seq34["A"] seq35["P"] seq36["T"] + + space:36 + + i1["I"] i2["-"] i3["-"] i4["-"] i5["-"] i6["-"] i7["I"] i8["-"] i9["-"] i10["-"] + i11["-"] i12["-"] i13["-"] i14["I"] i15["-"] i16["-"] i17["-"] i18["-"] i19["-"] i20["-"] + i21["-"] i22["-"] i23["I"] i24["-"] i25["I"] i26["-"] i27["-"] i28["-"] i29["-"] i30["-"] + i31["-"] i32["-"] i33["-"] i34["-"] i35["-"] i36["-"] + + n1["-"] n2["N"] n3["-"] n4["-"] n5["-"] n6["-"] n7["-"] n8["-"] n9["-"] n10["N"] + n11["-"] n12["-"] n13["-"] n14["-"] n15["-"] n16["-"] n17["-"] n18["-"] n19["-"] n20["-"] + n21["-"] n22["-"] n23["-"] n24["-"] n25["-"] n26["-"] n27["-"] n28["-"] n29["-"] n30["-"] + n31["-"] n32["-"] n33["-"] n34["-"] n35["-"] n36["-"] + + t1["-"] t2["-"] t3["T"] t4["-"] t5["-"] t6["-"] t7["-"] t8["-"] t9["-"] t10["-"] + t11["-"] t12["-"] t13["-"] t14["-"] t15["-"] t16["-"] t17["T"] t18["-"] t19["-"] t20["-"] + t21["-"] t22["-"] t23["-"] t24["-"] t25["-"] t26["T"] t27["-"] t28["-"] t29["T"] t30["-"] + t31["-"] t32["-"] t33["-"] t34["-"] t35["-"] t36["T"] + + e1["-"] e2["-"] e3["-"] e4["E"] e5["-"] e6["-"] e7["-"] e8["-"] e9["E"] e10["-"] + e11["-"] e12["E"] e13["-"] e14["-"] e15["-"] e16["-"] e17["-"] e18["-"] e19["E"] e20["-"] + e21["-"] e22["-"] e23["-"] e24["-"] e25["-"] e26["-"] e27["-"] e28["-"] e29["-"] e30["-"] + e31["-"] e32["-"] e33["-"] e34["-"] e35["-"] e36["-"] + + l1["-"] l2["-"] l3["-"] l4["-"] l5["L"] l6["L"] l7["-"] l8["-"] l9["-"] l10["-"] + l11["-"] l12["-"] l13["-"] l14["-"] l15["-"] l16["-"] l17["-"] l18["-"] l19["-"] l20["-"] + l21["-"] l22["-"] l23["-"] l24["L"] l25["-"] l26["-"] l27["-"] l28["-"] l29["-"] l30["-"] + l31["-"] l32["-"] l33["-"] l34["-"] l35["-"] l36["-"] + + g1["-"] g2["-"] g3["-"] g4["-"] g5["-"] g6["-"] g7["-"] g8["G"] g9["-"] g10["-"] + g11["-"] g12["-"] g13["-"] g14["-"] g15["-"] g16["-"] g17["-"] g18["-"] g19["-"] g20["-"] + g21["-"] g22["-"] g23["-"] g24["-"] g25["-"] g26["-"] g27["-"] g28["-"] g29["-"] g30["-"] + g31["-"] g32["-"] g33["-"] g34["-"] g35["-"] g36["-"] + + c1["-"] c2["-"] c3["-"] c4["-"] c5["-"] c6["-"] c7["-"] c8["-"] c9["-"] c10["-"] + c11["C"] c12["-"] c13["-"] c14["-"] c15["-"] c16["-"] c17["-"] c18["-"] c19["-"] c20["-"] + c21["-"] c22["-"] c23["-"] c24["-"] c25["-"] c26["-"] c27["-"] c28["-"] c29["-"] c30["-"] + c31["-"] c32["-"] c33["-"] c34["-"] c35["-"] c36["-"] + + sp1["-"] sp2["-"] sp3["-"] sp4["-"] sp5["-"] sp6["-"] sp7["-"] sp8["-"] sp9["-"] sp10["-"] + sp11["-"] sp12["-"] sp13[" "] sp14["-"] sp15["-"] sp16[" "] sp17["-"] sp18["-"] sp19["-"] sp20[" "] + sp21["-"] sp22["-"] sp23["-"] sp24["-"] sp25["-"] sp26["-"] sp27["-"] sp28[" "] sp29["-"] sp30["-"] + sp31[" "] sp32["-"] sp33["-"] sp34["-"] sp35["-"] sp36["-"] + + s1["-"] s2["-"] s3["-"] s4["-"] s5["-"] s6["-"] s7["-"] s8["-"] s9["-"] s10["-"] + s11["-"] s12["-"] s13["-"] s14["-"] s15["S"] s16["-"] s17["-"] s18["-"] s19["-"] s20["-"] + s21["-"] s22["-"] s23["-"] s24["-"] s25["-"] s26["-"] s27["-"] s28["-"] s29["-"] s30["-"] + s31["-"] s32["-"] s33["-"] s34["-"] s35["-"] s36["-"] + + h1["-"] h2["-"] h3["-"] h4["-"] h5["-"] h6["-"] h7["-"] h8["-"] h9["-"] h10["-"] + h11["-"] h12["-"] h13["-"] h14["-"] h15["-"] h16["-"] h17["-"] h18["H"] h19["-"] h20["-"] + h21["-"] h22["-"] h23["-"] h24["-"] h25["-"] h26["-"] h27["-"] h28["-"] h29["-"] h30["-"] + h31["-"] h32["-"] h33["-"] h34["-"] h35["-"] h36["-"] + + a1["-"] a2["-"] a3["-"] a4["-"] a5["-"] a6["-"] a7["-"] a8["-"] a9["-"] a10["-"] + a11["-"] a12["-"] a13["-"] a14["-"] a15["-"] a16["-"] a17["-"] a18["-"] a19["-"] a20["-"] + a21["A"] a22["-"] a23["-"] a24["-"] a25["-"] a26["-"] a27["-"] a28["-"] a29["-"] a30["-"] + a31["-"] a32["A"] a33["-"] a34["A"] a35["-"] a36["-"] + + b1["-"] b2["-"] b3["-"] b4["-"] b5["-"] b6["-"] b7["-"] b8["-"] b9["-"] b10["-"] + b11["-"] b12["-"] b13["-"] b14["-"] b15["-"] b16["-"] b17["-"] b18["-"] b19["-"] b20["-"] + b21["-"] b22["B"] b23["-"] b24["-"] b25["-"] b26["-"] b27["-"] b28["-"] b29["-"] b30["-"] + b31["-"] b32["-"] b33["-"] b34["-"] b35["-"] b36["-"] + + y1["-"] y2["-"] y3["-"] y4["-"] y5["-"] y6["-"] y7["-"] y8["-"] y9["-"] y10["-"] + y11["-"] y12["-"] y13["-"] y14["-"] y15["-"] y16["-"] y17["-"] y18["-"] y19["-"] y20["-"] + y21["-"] y22["-"] y23["-"] y24["-"] y25["-"] y26["-"] y27["Y"] y28["-"] y29["-"] y30["-"] + y31["-"] y32["-"] y33["-"] y34["-"] y35["-"] y36["-"] + + o1["-"] o2["-"] o3["-"] o4["-"] o5["-"] o6["-"] o7["-"] o8["-"] o9["-"] o10["-"] + o11["-"] o12["-"] o13["-"] o14["-"] o15["-"] o16["-"] o17["-"] o18["-"] o19["-"] o20["-"] + o21["-"] o22["-"] o23["-"] o24["-"] o25["-"] o26["-"] o27["-"] o28["-"] o29["-"] o30["O"] + o31["-"] o32["-"] o33["-"] o34["-"] o35["-"] o36["-"] + + d1["-"] d2["-"] d3["-"] d4["-"] d5["-"] d6["-"] d7["-"] d8["-"] d9["-"] d10["-"] + d11["-"] d12["-"] d13["-"] d14["-"] d15["-"] d16["-"] d17["-"] d18["-"] d19["-"] d20["-"] + d21["-"] d22["-"] d23["-"] d24["-"] d25["-"] d26["-"] d27["-"] d28["-"] d29["-"] d30["-"] + d31["-"] d32["-"] d33["D"] d34["-"] d35["-"] d36["-"] + + p1["-"] p2["-"] p3["-"] p4["-"] p5["-"] p6["-"] p7["-"] p8["-"] p9["-"] p10["-"] + p11["-"] p12["-"] p13["-"] p14["-"] p15["-"] p16["-"] p17["-"] p18["-"] p19["-"] p20["-"] + p21["-"] p22["-"] p23["-"] p24["-"] p25["-"] p26["-"] p27["-"] p28["-"] p29["-"] p30["-"] + p31["-"] p32["-"] p33["-"] p34["-"] p35["P"] p36["-"] + + classDef c1 fill:#ff7f0e,color:#fff; + classDef c2 fill:#ffbb78,color:#000; + classDef c3 fill:#2ca02c,color:#fff; + classDef c4 fill:#98df8a,color:#000; + classDef c5 fill:#d62728,color:#fff; + classDef c6 fill:#ff9896,color:#000; + classDef c7 fill:#9467bd,color:#fff; + classDef c8 fill:#c5b0d5,color:#000; + classDef c9 fill:#8c564b,color:#fff; + classDef c10 fill:#c49c94,color:#000; + classDef c11 fill:#e377c2,color:#fff; + classDef c12 fill:#f7b6d2,color:#000; + classDef c13 fill:#bcbd22,color:#fff; + classDef c14 fill:#dbdb8d,color:#000; + classDef c15 fill:#17becf,color:#fff; + classDef c16 fill:#9edae5,color:#000; + + class seq1,seq7,seq14,seq23,seq25,i1,i7,i14,i23,i25 c1 + class seq2,seq10,n2,n10 c2 + class seq3,seq17,seq26,seq29,seq36,t3,t17,t26,t29,t36 c3 + class seq4,seq9,seq12,seq19,e4,e9,e12,e19 c4 + class seq5,seq6,seq24,l5,l6,l24 c5 + class seq8,g8 c6 + class seq11,c11 c7 + class seq13,seq16,seq20,seq28,seq31,sp13,sp16,sp20,sp28,sp31 c8 + class seq15,s15 c9 + class seq18,h18 c10 + class seq21,seq32,seq34,a21,a32,a34 c11 + class seq22,b22 c12 + class seq27,y27 c13 + class seq30,o30 c14 + class seq33,d33 c15 + class seq35,p35 c16 ``` -I - - - - - I - - - - - - I - - - - - - - - I - I - - - - - - - - - - - - - - - - - - - - - + +Congeneric sequence for `E` +``` mermaid +block-beta + columns 36 + e1["-"] e2["-"] e3["-"] e4["E"] e5["-"] e6["-"] e7["-"] e8["-"] e9["E"] e10["-"] + e11["-"] e12["E"] e13["-"] e14["-"] e15["-"] e16["-"] e17["-"] e18["-"] e19["E"] e20["-"] + e21["-"] e22["-"] e23["-"] e24["-"] e25["-"] e26["-"] e27["-"] e28["-"] e29["-"] e30["-"] + e31["-"] e32["-"] e33["-"] e34["-"] e35["-"] e36["-"] ``` -could be a part of multiple symbol sequences that have the same order of `I` element. + + +could be a part of multiple symbol sequences that have the same order of `E` element. While keeping the main idea, the congeneric decomposition could be applied, with a flavor, to any type of special case symbolic sequences, such as Order. diff --git a/docs/fundamentals/ideas/order_as_a_property.md b/docs/fundamentals/ideas/order_as_a_property.md index 32b2851f..401d2928 100644 --- a/docs/fundamentals/ideas/order_as_a_property.md +++ b/docs/fundamentals/ideas/order_as_a_property.md @@ -12,35 +12,291 @@ sorted by the appearance of the elements in the original sequence [1, 2, 3]. The concept of an Order can be conveniently demonstrated using an example: -Let's assume there is a symbolic sequence `INTELLIGENCE IS THE ABILITY TO ADAPT TO CHANGE` +Let's assume there is a symbolic sequence + +``` mermaid +block-beta + columns 36 + s1["I"] s2["N"] s3["T"] s4["E"] s5["L"] s6["L"] s7["I"] s8["G"] s9["E"] s10["N"] + s11["C"] s12["E"] s13[" "] s14["I"] s15["S"] s16[" "] s17["T"] s18["H"] s19["E"] s20[" "] + s21["A"] s22["B"] s23["I"] s24["L"] s25["I"] s26["T"] s27["Y"] s28[" "] s29["T"] s30["O"] + s31[" "] s32["A"] s33["D"] s34["A"] s35["P"] s36["T"] +``` + Find and enumirate the first appearance of each element -| I | N | T | E | L | L | I | G | E | N | C | E |    | I | S |    | T | H | E |    | A | B | I | L | I | T | Y |    | T | O |    | A | D | A | P | T |    | T | O |    | C | H | A | N | G | E | -|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---| -| 1 | 2 | 3 | 4 | 5 | | | 6 | | | 7 | | 8 | | 9 | | | 10 | | | 11 | 12 | | | | | 13 | | | 14 | | | 15 | | 16 | | | | | | | | | | | | +``` mermaid +block-beta + columns 36 + s1["I"] s2["N"] s3["T"] s4["E"] s5["L"] s6["L"] s7["I"] s8["G"] s9["E"] s10["N"] + s11["C"] s12["E"] s13[" "] s14["I"] s15["S"] s16[" "] s17["T"] s18["H"] s19["E"] s20[" "] + s21["A"] s22["B"] s23["I"] s24["L"] s25["I"] s26["T"] s27["Y"] s28[" "] s29["T"] s30["O"] + s31[" "] s32["A"] s33["D"] s34["A"] s35["P"] s36["T"] + + space:36 + + i1_1["1"] i2_1["2"] i3_1["3"] i4_1["4"] i5_1["5"] space:2 i6_1["6"] space:2 i7_1["7"] space + i8_1["8"] space i9_1["9"] space:2 i10_1["10"] space:2 + i11_1["11"] i12_1["12"] space:4 i13_1["13"] + space:2 i14_1["14"] space:2 + i15_1["15"] space i16_1["16"] + + classDef c1 fill:#ff7f0e,color:#fff; + classDef c2 fill:#ffbb78,color:#000; + classDef c3 fill:#2ca02c,color:#fff; + classDef c4 fill:#98df8a,color:#000; + classDef c5 fill:#d62728,color:#fff; + classDef c6 fill:#ff9896,color:#000; + classDef c7 fill:#9467bd,color:#fff; + classDef c8 fill:#c5b0d5,color:#000; + classDef c9 fill:#8c564b,color:#fff; + classDef c10 fill:#c49c94,color:#000; + classDef c11 fill:#e377c2,color:#fff; + classDef c12 fill:#f7b6d2,color:#000; + classDef c13 fill:#bcbd22,color:#fff; + classDef c14 fill:#dbdb8d,color:#000; + classDef c15 fill:#17becf,color:#fff; + classDef c16 fill:#9edae5,color:#000; + + class s1,i1_1 c1 + class s2,i2_1 c2 + class s3,i3_1 c3 + class s4,i4_1 c4 + class s5,i5_1 c5 + class s8,i6_1 c6 + class s11,i7_1 c7 + class s13,i8_1 c8 + class s15,i9_1 c9 + class s18,i10_1 c10 + class s21,i11_1 c11 + class s22,i12_1 c12 + class s27,i13_1 c13 + class s30,i14_1 c14 + class s33,i15_1 c15 + class s35,i16_1 c16 + + s1 --> i1_1 + s2 --> i2_1 + s3 --> i3_1 + s4 --> i4_1 + s5 --> i5_1 + s8 --> i6_1 + s11 --> i7_1 + s13 --> i8_1 + s15 --> i9_1 + s18 --> i10_1 + s21 --> i11_1 + s22 --> i12_1 + s27 --> i13_1 + s30 --> i14_1 + s33 --> i15_1 + s35 --> i16_1 +``` -The alphabet for the sequence would be sequence of unique elements: +The alphabet (with indexes) for the sequence would be sequence of unique elements: -| I | N | T | E | L | G | C | | S | H | A | B | Y | O | D | P | -|---|---|---|---|---|---|---|---|---|----|----|----|----|----|----|----| -| 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | + +``` mermaid +block-beta + columns 16 + s1["I"] s2["N"] s3["T"] s4["E"] s5["L"] s8["G"] + s11["C"] s13[" "] s15["S"] s18["H"] + s21["A"] s22["B"] s27["Y"] s30["O"] + s33["D"] s35["P"] + + space:16 + + i1_1["1"] i2_1["2"] i3_1["3"] i4_1["4"] i5_1["5"] i6_1["6"] i7_1["7"] + i8_1["8"] i9_1["9"] i10_1["10"] + i11_1["11"] i12_1["12"] i13_1["13"] + i14_1["14"] + i15_1["15"] i16_1["16"] + + classDef c1 fill:#ff7f0e,color:#fff; + classDef c2 fill:#ffbb78,color:#000; + classDef c3 fill:#2ca02c,color:#fff; + classDef c4 fill:#98df8a,color:#000; + classDef c5 fill:#d62728,color:#fff; + classDef c6 fill:#ff9896,color:#000; + classDef c7 fill:#9467bd,color:#fff; + classDef c8 fill:#c5b0d5,color:#000; + classDef c9 fill:#8c564b,color:#fff; + classDef c10 fill:#c49c94,color:#000; + classDef c11 fill:#e377c2,color:#fff; + classDef c12 fill:#f7b6d2,color:#000; + classDef c13 fill:#bcbd22,color:#fff; + classDef c14 fill:#dbdb8d,color:#000; + classDef c15 fill:#17becf,color:#fff; + classDef c16 fill:#9edae5,color:#000; + + class s1,i1_1 c1 + class s2,i2_1 c2 + class s3,i3_1 c3 + class s4,i4_1 c4 + class s5,i5_1 c5 + class s8,i6_1 c6 + class s11,i7_1 c7 + class s13,i8_1 c8 + class s15,i9_1 c9 + class s18,i10_1 c10 + class s21,i11_1 c11 + class s22,i12_1 c12 + class s27,i13_1 c13 + class s30,i14_1 c14 + class s33,i15_1 c15 + class s35,i16_1 c16 + + s1 --> i1_1 + s2 --> i2_1 + s3 --> i3_1 + s4 --> i4_1 + s5 --> i5_1 + s8 --> i6_1 + s11 --> i7_1 + s13 --> i8_1 + s15 --> i9_1 + s18 --> i10_1 + s21 --> i11_1 + s22 --> i12_1 + s27 --> i13_1 + s30 --> i14_1 + s33 --> i15_1 + s35 --> i16_1 + + i1_1 --> s1 + i2_1 --> s2 + i3_1 --> s3 + i4_1 --> s4 + i5_1 --> s5 + i6_1 --> s8 + i7_1 --> s11 + i8_1 --> s13 + i9_1 --> s15 + i10_1 --> s18 + i11_1 --> s21 + i12_1 --> s22 + i13_1 --> s27 + i14_1 --> s30 + i15_1 --> s33 + i16_1 --> s35 +``` Determine the order of the sequence by replacing each element of the sequence with its corresponding alphabet index +``` mermaid +block-beta + columns 36 + s1["I"] s2["N"] s3["T"] s4["E"] s5["L"] s6["L"] s7["I"] s8["G"] s9["E"] s10["N"] + s11["C"] s12["E"] s13[" "] s14["I"] s15["S"] s16[" "] s17["T"] s18["H"] s19["E"] s20[" "] + s21["A"] s22["B"] s23["I"] s24["L"] s25["I"] s26["T"] s27["Y"] s28[" "] s29["T"] s30["O"] + s31[" "] s32["A"] s33["D"] s34["A"] s35["P"] s36["T"] -| I | N | T | E | L | L | I | G | E | N | C | E |    | I | S |    | T | H | E |    | A | B | I | L | I | T | Y |    | T | O |    | A | D | A | P | T |    | T | O |    | C | H | A | N | G | E | -|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---| -| 1 | 2 | 3 | 4 | 5 | 5 | 1 | 6 | 4 | 2 | 7 | 4 | 8 | 1 | 9 | 8 | 3 | 10 | 4 | 8 | 11 | 12 | 1 | 5 | 1 | 3 | 13 | 8 | 3 | 14 | 8 | 11 | 15 | 11 | 16 | 3 | 8 | 3 | 14 | 8 | 7 | 10 | 11 | 2 | 6 | 4 | + space:36 -The order of symbolic sequence `INTELLIGENCE IS THE ABILITY TO ADAPT TO CHANGE` is + i1_1["1"] i2_1["2"] i3_1["3"] i4_1["4"] i5_1["5"] i5_2["5"] i1_2["1"] i6_1["6"] i4_2["4"] i2_2["2"] i7_1["7"] i4_3["4"] + i8_1["8"] i1_3["1"] i9_1["9"] i8_2["8"] i3_2["3"] i10_1["10"] i4_4["4"] i8_3["8"] + i11_1["11"] i12_1["12"] i1_4["1"] i5_3["5"] i1_5["1"] i3_3["3"] i13_1["13"] + i8_4["8"] i3_4["3"] i14_1["14"] i8_5["8"] i11_2["11"] + i15_1["15"] i11_3["11"] i16_1["16"] i3_5["3"] -| 1 | 2 | 3 | 4 | 5 | 5 | 1 | 6 | 4 | 2 | 7 | 4 | 8 | 1 | 9 | 8 | 3 | 10 | 4 | 8 | 11 | 12 | 1 | 5 | 1 | 3 | 13 | 8 | 3 | 14 | 8 | 11 | 15 | 11 | 16 | 3 | 8 | 3 | 14 | 8 | 7 | 10 | 11 | 2 | 6 | 4 | -|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---| + classDef c1 fill:#ff7f0e,color:#fff; + classDef c2 fill:#ffbb78,color:#000; + classDef c3 fill:#2ca02c,color:#fff; + classDef c4 fill:#98df8a,color:#000; + classDef c5 fill:#d62728,color:#fff; + classDef c6 fill:#ff9896,color:#000; + classDef c7 fill:#9467bd,color:#fff; + classDef c8 fill:#c5b0d5,color:#000; + classDef c9 fill:#8c564b,color:#fff; + classDef c10 fill:#c49c94,color:#000; + classDef c11 fill:#e377c2,color:#fff; + classDef c12 fill:#f7b6d2,color:#000; + classDef c13 fill:#bcbd22,color:#fff; + classDef c14 fill:#dbdb8d,color:#000; + classDef c15 fill:#17becf,color:#fff; + classDef c16 fill:#9edae5,color:#000; + class s1,s7,s14,s23,s25,i1_1,i1_2,i1_3,i1_4,i1_5 c1 + class s2,s10,i2_1,i2_2 c2 + class s3,s17,s26,s29,s36,i3_1,i3_2,i3_3,i3_4,i3_5 c3 + class s4,s9,s12,s19,i4_1,i4_2,i4_3,i4_4 c4 + class s5,s6,s24,i5_1,i5_2,i5_3 c5 + class s8,i6_1 c6 + class s11,i7_1 c7 + class s13,s16,s20,s28,s31,i8_1,i8_2,i8_3,i8_4,i8_5 c8 + class s15,i9_1 c9 + class s18,i10_1 c10 + class s21,s32,s34,i11_1,i11_2,i11_3 c11 + class s22,i12_1 c12 + class s27,i13_1 c13 + class s30,i14_1 c14 + class s33,i15_1 c15 + class s35,i16_1 c16 + s1 --> i1_1 + s7 --> i1_2 + s14 --> i1_3 + s23 --> i1_4 + s25 --> i1_5 + + s2 --> i2_1 + s10 --> i2_2 + + s3 --> i3_1 + s17 --> i3_2 + s26 --> i3_3 + s29 --> i3_4 + s36 --> i3_5 + + s4 --> i4_1 + s9 --> i4_2 + s12 --> i4_3 + s19--> i4_4 + + s5 --> i5_1 + s6 --> i5_2 + s24 --> i5_3 + + s8 --> i6_1 + + s11 --> i7_1 + + s13 --> i8_1 + s16 --> i8_2 + s20 --> i8_3 + s28 --> i8_4 + s31 --> i8_5 + + s15 --> i9_1 + s18 --> i10_1 + + s21 --> i11_1 + s32 --> i11_2 + s34 --> i11_3 + + s22 --> i12_1 + s27 --> i13_1 + s30 --> i14_1 + s33 --> i15_1 + s35 --> i16_1 +``` + + +The order of symbolic sequence `INTELLIGENCE IS THE ABILITY TO ADAPT` is + +``` mermaid +block-beta + columns 36 + i1_1["1"] i2_1["2"] i3_1["3"] i4_1["4"] i5_1["5"] i5_2["5"] i1_2["1"] i6_1["6"] i4_2["4"] i2_2["2"] i7_1["7"] i4_3["4"] + i8_1["8"] i1_3["1"] i9_1["9"] i8_2["8"] i3_2["3"] i10_1["10"] i4_4["4"] i8_3["8"] + i11_1["11"] i12_1["12"] i1_4["1"] i5_3["5"] i1_5["1"] i3_3["3"] i13_1["13"] + i8_4["8"] i3_4["3"] i14_1["14"] i8_5["8"] i11_2["11"] + i15_1["15"] i11_3["11"] i16_1["16"] i3_5["3"] +``` + Despite the triviality of the concept Order, it allows us to separate the elements and composition of a sequence and to define the compositional equivalence of different sequences. Example of sequences with equals orders: From 419b3449ac4a33496e915b1d4548d46843c58c18 Mon Sep 17 00:00:00 2001 From: Igor Rodionov Date: Sat, 14 Jun 2025 20:07:40 +0200 Subject: [PATCH 17/35] Added intervals coloring --- .../ideas/interval_as_a_basic_information_unit.md | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/docs/fundamentals/ideas/interval_as_a_basic_information_unit.md b/docs/fundamentals/ideas/interval_as_a_basic_information_unit.md index 5e8b547f..634e1606 100644 --- a/docs/fundamentals/ideas/interval_as_a_basic_information_unit.md +++ b/docs/fundamentals/ideas/interval_as_a_basic_information_unit.md @@ -13,6 +13,11 @@ block-beta columns 12 s1["A"] s2["C"] s3["T"] s4["A"] s5["C"] s6["G"] s7["A"] s8["A"] s9["A"] s10["T"] s11["A"] s12["A"] i1["3"]:3 i2["3"]:3 i3["1"]:1 i4["1"]:1 i5["2"]:2 i6["1"]:1 i7["1"]:1 + + classDef c3 fill:#2ca02c,color:#fff; + classDef c4 fill:#98df8a,color:#000; + class s1,s4,s7,s8,s9,s11,s12 c3 + class i1,i2,i3,i4,i5,i6,i7 c4 ``` In general, a sequence does not necessarily end with the same symbol it begins with. @@ -26,6 +31,11 @@ block-beta s1["A"] s2["C"] s3["T"] s4["A"] s5["C"] s6["G"] s7["A"] s8["A"] s9["A"] s10["T"] s11["A"] s12["A"] space s13["T"] s14["C"] space i1["3"]:3 i2["9"]:10 s12 --> s13 + + classDef c3 fill:#2ca02c,color:#fff; + classDef c4 fill:#98df8a,color:#000; + class s2,s5,s14 c3 + class i1,i2 c4 ``` The circular pattern preserves both the statistical properties and the order of elements. From 746db165b5e77497417927d6fe51c217ff47eac1 Mon Sep 17 00:00:00 2001 From: Igor Rodionov Date: Sat, 14 Jun 2025 20:13:42 +0200 Subject: [PATCH 18/35] Added latex table --- .../ideas/congeneric_decomposition.md | 128 +----------------- 1 file changed, 1 insertion(+), 127 deletions(-) diff --git a/docs/fundamentals/ideas/congeneric_decomposition.md b/docs/fundamentals/ideas/congeneric_decomposition.md index 6ce33b9a..3ee2f0e6 100644 --- a/docs/fundamentals/ideas/congeneric_decomposition.md +++ b/docs/fundamentals/ideas/congeneric_decomposition.md @@ -15,7 +15,7 @@ Let's assume there is a symbolic sequence `INTELLIGENCE IS THE ABILITY TO ADAPT` could be presented by the following table, where each row is a congeneric sequence and `-` is an empty position in a congeneric sequence. - -``` mermaid -block-beta - columns 36 - seq1["I"] seq2["N"] seq3["T"] seq4["E"] seq5["L"] seq6["L"] seq7["I"] seq8["G"] seq9["E"] seq10["N"] - seq11["C"] seq12["E"] seq13[" "] seq14["I"] seq15["S"] seq16[" "] seq17["T"] seq18["H"] seq19["E"] seq20[" "] - seq21["A"] seq22["B"] seq23["I"] seq24["L"] seq25["I"] seq26["T"] seq27["Y"] seq28[" "] seq29["T"] seq30["O"] - seq31[" "] seq32["A"] seq33["D"] seq34["A"] seq35["P"] seq36["T"] - - space:36 - - i1["I"] i2["-"] i3["-"] i4["-"] i5["-"] i6["-"] i7["I"] i8["-"] i9["-"] i10["-"] - i11["-"] i12["-"] i13["-"] i14["I"] i15["-"] i16["-"] i17["-"] i18["-"] i19["-"] i20["-"] - i21["-"] i22["-"] i23["I"] i24["-"] i25["I"] i26["-"] i27["-"] i28["-"] i29["-"] i30["-"] - i31["-"] i32["-"] i33["-"] i34["-"] i35["-"] i36["-"] - - n1["-"] n2["N"] n3["-"] n4["-"] n5["-"] n6["-"] n7["-"] n8["-"] n9["-"] n10["N"] - n11["-"] n12["-"] n13["-"] n14["-"] n15["-"] n16["-"] n17["-"] n18["-"] n19["-"] n20["-"] - n21["-"] n22["-"] n23["-"] n24["-"] n25["-"] n26["-"] n27["-"] n28["-"] n29["-"] n30["-"] - n31["-"] n32["-"] n33["-"] n34["-"] n35["-"] n36["-"] - - t1["-"] t2["-"] t3["T"] t4["-"] t5["-"] t6["-"] t7["-"] t8["-"] t9["-"] t10["-"] - t11["-"] t12["-"] t13["-"] t14["-"] t15["-"] t16["-"] t17["T"] t18["-"] t19["-"] t20["-"] - t21["-"] t22["-"] t23["-"] t24["-"] t25["-"] t26["T"] t27["-"] t28["-"] t29["T"] t30["-"] - t31["-"] t32["-"] t33["-"] t34["-"] t35["-"] t36["T"] - - e1["-"] e2["-"] e3["-"] e4["E"] e5["-"] e6["-"] e7["-"] e8["-"] e9["E"] e10["-"] - e11["-"] e12["E"] e13["-"] e14["-"] e15["-"] e16["-"] e17["-"] e18["-"] e19["E"] e20["-"] - e21["-"] e22["-"] e23["-"] e24["-"] e25["-"] e26["-"] e27["-"] e28["-"] e29["-"] e30["-"] - e31["-"] e32["-"] e33["-"] e34["-"] e35["-"] e36["-"] - - l1["-"] l2["-"] l3["-"] l4["-"] l5["L"] l6["L"] l7["-"] l8["-"] l9["-"] l10["-"] - l11["-"] l12["-"] l13["-"] l14["-"] l15["-"] l16["-"] l17["-"] l18["-"] l19["-"] l20["-"] - l21["-"] l22["-"] l23["-"] l24["L"] l25["-"] l26["-"] l27["-"] l28["-"] l29["-"] l30["-"] - l31["-"] l32["-"] l33["-"] l34["-"] l35["-"] l36["-"] - - g1["-"] g2["-"] g3["-"] g4["-"] g5["-"] g6["-"] g7["-"] g8["G"] g9["-"] g10["-"] - g11["-"] g12["-"] g13["-"] g14["-"] g15["-"] g16["-"] g17["-"] g18["-"] g19["-"] g20["-"] - g21["-"] g22["-"] g23["-"] g24["-"] g25["-"] g26["-"] g27["-"] g28["-"] g29["-"] g30["-"] - g31["-"] g32["-"] g33["-"] g34["-"] g35["-"] g36["-"] - - c1["-"] c2["-"] c3["-"] c4["-"] c5["-"] c6["-"] c7["-"] c8["-"] c9["-"] c10["-"] - c11["C"] c12["-"] c13["-"] c14["-"] c15["-"] c16["-"] c17["-"] c18["-"] c19["-"] c20["-"] - c21["-"] c22["-"] c23["-"] c24["-"] c25["-"] c26["-"] c27["-"] c28["-"] c29["-"] c30["-"] - c31["-"] c32["-"] c33["-"] c34["-"] c35["-"] c36["-"] - - sp1["-"] sp2["-"] sp3["-"] sp4["-"] sp5["-"] sp6["-"] sp7["-"] sp8["-"] sp9["-"] sp10["-"] - sp11["-"] sp12["-"] sp13[" "] sp14["-"] sp15["-"] sp16[" "] sp17["-"] sp18["-"] sp19["-"] sp20[" "] - sp21["-"] sp22["-"] sp23["-"] sp24["-"] sp25["-"] sp26["-"] sp27["-"] sp28[" "] sp29["-"] sp30["-"] - sp31[" "] sp32["-"] sp33["-"] sp34["-"] sp35["-"] sp36["-"] - - s1["-"] s2["-"] s3["-"] s4["-"] s5["-"] s6["-"] s7["-"] s8["-"] s9["-"] s10["-"] - s11["-"] s12["-"] s13["-"] s14["-"] s15["S"] s16["-"] s17["-"] s18["-"] s19["-"] s20["-"] - s21["-"] s22["-"] s23["-"] s24["-"] s25["-"] s26["-"] s27["-"] s28["-"] s29["-"] s30["-"] - s31["-"] s32["-"] s33["-"] s34["-"] s35["-"] s36["-"] - - h1["-"] h2["-"] h3["-"] h4["-"] h5["-"] h6["-"] h7["-"] h8["-"] h9["-"] h10["-"] - h11["-"] h12["-"] h13["-"] h14["-"] h15["-"] h16["-"] h17["-"] h18["H"] h19["-"] h20["-"] - h21["-"] h22["-"] h23["-"] h24["-"] h25["-"] h26["-"] h27["-"] h28["-"] h29["-"] h30["-"] - h31["-"] h32["-"] h33["-"] h34["-"] h35["-"] h36["-"] - - a1["-"] a2["-"] a3["-"] a4["-"] a5["-"] a6["-"] a7["-"] a8["-"] a9["-"] a10["-"] - a11["-"] a12["-"] a13["-"] a14["-"] a15["-"] a16["-"] a17["-"] a18["-"] a19["-"] a20["-"] - a21["A"] a22["-"] a23["-"] a24["-"] a25["-"] a26["-"] a27["-"] a28["-"] a29["-"] a30["-"] - a31["-"] a32["A"] a33["-"] a34["A"] a35["-"] a36["-"] - - b1["-"] b2["-"] b3["-"] b4["-"] b5["-"] b6["-"] b7["-"] b8["-"] b9["-"] b10["-"] - b11["-"] b12["-"] b13["-"] b14["-"] b15["-"] b16["-"] b17["-"] b18["-"] b19["-"] b20["-"] - b21["-"] b22["B"] b23["-"] b24["-"] b25["-"] b26["-"] b27["-"] b28["-"] b29["-"] b30["-"] - b31["-"] b32["-"] b33["-"] b34["-"] b35["-"] b36["-"] - - y1["-"] y2["-"] y3["-"] y4["-"] y5["-"] y6["-"] y7["-"] y8["-"] y9["-"] y10["-"] - y11["-"] y12["-"] y13["-"] y14["-"] y15["-"] y16["-"] y17["-"] y18["-"] y19["-"] y20["-"] - y21["-"] y22["-"] y23["-"] y24["-"] y25["-"] y26["-"] y27["Y"] y28["-"] y29["-"] y30["-"] - y31["-"] y32["-"] y33["-"] y34["-"] y35["-"] y36["-"] - - o1["-"] o2["-"] o3["-"] o4["-"] o5["-"] o6["-"] o7["-"] o8["-"] o9["-"] o10["-"] - o11["-"] o12["-"] o13["-"] o14["-"] o15["-"] o16["-"] o17["-"] o18["-"] o19["-"] o20["-"] - o21["-"] o22["-"] o23["-"] o24["-"] o25["-"] o26["-"] o27["-"] o28["-"] o29["-"] o30["O"] - o31["-"] o32["-"] o33["-"] o34["-"] o35["-"] o36["-"] - - d1["-"] d2["-"] d3["-"] d4["-"] d5["-"] d6["-"] d7["-"] d8["-"] d9["-"] d10["-"] - d11["-"] d12["-"] d13["-"] d14["-"] d15["-"] d16["-"] d17["-"] d18["-"] d19["-"] d20["-"] - d21["-"] d22["-"] d23["-"] d24["-"] d25["-"] d26["-"] d27["-"] d28["-"] d29["-"] d30["-"] - d31["-"] d32["-"] d33["D"] d34["-"] d35["-"] d36["-"] - - p1["-"] p2["-"] p3["-"] p4["-"] p5["-"] p6["-"] p7["-"] p8["-"] p9["-"] p10["-"] - p11["-"] p12["-"] p13["-"] p14["-"] p15["-"] p16["-"] p17["-"] p18["-"] p19["-"] p20["-"] - p21["-"] p22["-"] p23["-"] p24["-"] p25["-"] p26["-"] p27["-"] p28["-"] p29["-"] p30["-"] - p31["-"] p32["-"] p33["-"] p34["-"] p35["P"] p36["-"] - - classDef c1 fill:#ff7f0e,color:#fff; - classDef c2 fill:#ffbb78,color:#000; - classDef c3 fill:#2ca02c,color:#fff; - classDef c4 fill:#98df8a,color:#000; - classDef c5 fill:#d62728,color:#fff; - classDef c6 fill:#ff9896,color:#000; - classDef c7 fill:#9467bd,color:#fff; - classDef c8 fill:#c5b0d5,color:#000; - classDef c9 fill:#8c564b,color:#fff; - classDef c10 fill:#c49c94,color:#000; - classDef c11 fill:#e377c2,color:#fff; - classDef c12 fill:#f7b6d2,color:#000; - classDef c13 fill:#bcbd22,color:#fff; - classDef c14 fill:#dbdb8d,color:#000; - classDef c15 fill:#17becf,color:#fff; - classDef c16 fill:#9edae5,color:#000; - - class seq1,seq7,seq14,seq23,seq25,i1,i7,i14,i23,i25 c1 - class seq2,seq10,n2,n10 c2 - class seq3,seq17,seq26,seq29,seq36,t3,t17,t26,t29,t36 c3 - class seq4,seq9,seq12,seq19,e4,e9,e12,e19 c4 - class seq5,seq6,seq24,l5,l6,l24 c5 - class seq8,g8 c6 - class seq11,c11 c7 - class seq13,seq16,seq20,seq28,seq31,sp13,sp16,sp20,sp28,sp31 c8 - class seq15,s15 c9 - class seq18,h18 c10 - class seq21,seq32,seq34,a21,a32,a34 c11 - class seq22,b22 c12 - class seq27,y27 c13 - class seq30,o30 c14 - class seq33,d33 c15 - class seq35,p35 c16 -``` - Congeneric sequence for `E` ``` mermaid block-beta From c993544ff2059c5adf8006c975152d92082d56a0 Mon Sep 17 00:00:00 2001 From: Igor Rodionov Date: Sat, 14 Jun 2025 21:13:12 +0200 Subject: [PATCH 19/35] Finally use marmaide --- .../ideas/congeneric_decomposition.md | 148 +++++++++++++----- 1 file changed, 105 insertions(+), 43 deletions(-) diff --git a/docs/fundamentals/ideas/congeneric_decomposition.md b/docs/fundamentals/ideas/congeneric_decomposition.md index 3ee2f0e6..4bc5b4cf 100644 --- a/docs/fundamentals/ideas/congeneric_decomposition.md +++ b/docs/fundamentals/ideas/congeneric_decomposition.md @@ -14,49 +14,111 @@ The concept of Cogeneric decomposition can be demonstrated using an example: Let's assume there is a symbolic sequence `INTELLIGENCE IS THE ABILITY TO ADAPT` congeneric decomposition could be presented by the following table, where each row is a congeneric sequence and `-` is an empty position in a congeneric sequence. - -\begin{equation} -\scriptsize -\begin{array}{|c|c|c|c|c|c|c|c|c|c|c|c|c|c|c|c|c|c|c|c|c|c|c|c|c|c|c|c|c|c|c|c|c|c|c|} -\hline -\cellcolor{#ff7f0e}I & \cellcolor{#ffbb78}N & \cellcolor{#2ca02c}T & \cellcolor{#98df8a}E & \cellcolor{#d62728}L & \cellcolor{#d62728}L & \cellcolor{#ff7f0e}I & \cellcolor{#ff9896}G & \cellcolor{#98df8a}E & \cellcolor{#ffbb78}N & \cellcolor{#9467bd}C & \cellcolor{#98df8a}E & \cellcolor{#c5b0d5}\text{ } & \cellcolor{#ff7f0e}I & \cellcolor{#8c564b}S & \cellcolor{#c5b0d5}\text{ } & \cellcolor{#2ca02c}T & \cellcolor{#c49c94}H & \cellcolor{#98df8a}E & \cellcolor{#c5b0d5}\text{ } & \cellcolor{#e377c2}A & \cellcolor{#f7b6d2}B & \cellcolor{#ff7f0e}I & \cellcolor{#d62728}L & \cellcolor{#ff7f0e}I & \cellcolor{#2ca02c}T & \cellcolor{#bcbd22}Y & \cellcolor{#c5b0d5}\text{ } & \cellcolor{#2ca02c}T & \cellcolor{#dbdb8d}O & \cellcolor{#c5b0d5}\text{ } & \cellcolor{#e377c2}A & \cellcolor{#17becf}D & \cellcolor{#e377c2}A & \cellcolor{#9edae5}P & \cellcolor{#2ca02c}T \\ -\hline -\cellcolor{#ff7f0e}I & - & - & - & - & - & \cellcolor{#ff7f0e}I & - & - & - & - & - & - & \cellcolor{#ff7f0e}I & - & - & - & - & - & - & - & - & \cellcolor{#ff7f0e}I & - & \cellcolor{#ff7f0e}I & - & - & - & - & - & - & - & - & - & - & - \\ -\hline -- & \cellcolor{#ffbb78}N & - & - & - & - & - & - & - & \cellcolor{#ffbb78}N & - & - & - & - & - & - & - & - & - & - & - & - & - & - & - & - & - & - & - & - & - & - & - & - & - & - \\ -\hline -- & - & \cellcolor{#2ca02c}T & - & - & - & - & - & - & - & - & - & - & - & - & - & \cellcolor{#2ca02c}T & - & - & - & - & - & - & - & - & \cellcolor{#2ca02c}T & - & - & \cellcolor{#2ca02c}T & - & - & - & - & - &- & \cellcolor{#2ca02c}T \\ -\hline -- & - & - & \cellcolor{#98df8a}E & - & - & - & - & \cellcolor{#98df8a}E & - & - & \cellcolor{#98df8a}E & - & - & - & - & - & - & \cellcolor{#98df8a}E & - & - & - & - & - & - & - & - & - & - & - & - & - & - & - & - & - \\ -\hline -- & - & - & - & \cellcolor{#d62728}L & \cellcolor{#d62728}L & - & - & - & - & - & - & - & - & - & - & - & - & - & - & - & - & - & \cellcolor{#d62728}L & - & - & - & - & - & - & - & - & - & - & - & - \\ -\hline -- & - & - & - & - & - & - & \cellcolor{#ff9896}G & - & - & - & - & - & - & - & - & - & - & - & - & - & - & - & - & - & - & - & - & - & - & - & - & - & - & - & - \\ -\hline -- & - & - & - & - & - & - & - & - & - & \cellcolor{#9467bd}C & - & - & - & - & - & - & - & - & - & - & - & - & - & - & - & - & - & - & - & - & - & - & - & - & - \\ -\hline -- & - & - & - & - & - & - & - & - & - & - & - & \cellcolor{#c5b0d5}\text{ } & - & - & \cellcolor{#c5b0d5}\text{ } & - & - & - & \cellcolor{#c5b0d5}\text{ } & - & - & - & - & - & - & - & \cellcolor{#c5b0d5}\text{ } & - & - & \cellcolor{#c5b0d5}\text{ } & - & - & - & - & - \\ -\hline -- & - & - & - & - & - & - & - & - & - & - & - & - & - & \cellcolor{#8c564b}S & - & - & - & - & - & - & - & - & - & - & - & - & - & - & - & - & - & - & - & - & - \\ -\hline -- & - & - & - & - & - & - & - & - & - & - & - & - & - & - & - & - & \cellcolor{#c49c94}H & - & - & - & - & - & - & - & - & - & - & - & - & - & - & - & - & - & - \\ -\hline -- & - & - & - & - & - & - & - & - & - & - & - & - & - & - & - & - & - & - & - & \cellcolor{#e377c2}A & - & - & - & - & - & - & - & - & - & - & \cellcolor{#e377c2}A & - & \cellcolor{#e377c2}A & - & - \\ -\hline -- & - & - & - & - & - & - & - & - & - & - & - & - & - & - & - & - & - & - & - & - & \cellcolor{#f7b6d2}B & - & - & - & - & - & - & - & - & - & - & - & - & - & - \\ -\hline -- & - & - & - & - & - & - & - & - & - & - & - & - & - & - & - & - & - & - & - & - & - & - & - & - & - & \cellcolor{#bcbd22}Y & - & - & - & - & - & - & - & - & - \\ -\hline -- & - & - & - & - & - & - & - & - & - & - & - & - & - & - & - & - & - & - & - & - & - & - & - & - & - & - & - & - & \cellcolor{#dbdb8d}O & - & - & - & - & - & - \\ -\hline -- & - & - & - & - & - & - & - & - & - & - & - & - & - & - & - & - & - & - & - & - & - & - & - & - & - & - & - & - & - & - & - & \cellcolor{#17becf}D & - & - & - \\ -\hline -- & - & - & - & - & - & - & - & - & - & - & - & - & - & - & - & - & - & - & - & - & - & - & - & - & - & - & - & - & - & - & - & - & - & \cellcolor{#9edae5}P & - \\ -\hline -\end{array} -\end{equation} - - +``` mermaid +block-beta + columns 36 + seq1["I"] seq2["N"] seq3["T"] seq4["E"] seq5["L"] seq6["L"] seq7["I"] seq8["G"] seq9["E"] seq10["N"] + seq11["C"] seq12["E"] seq13[" "] seq14["I"] seq15["S"] seq16[" "] seq17["T"] seq18["H"] seq19["E"] seq20[" "] + seq21["A"] seq22["B"] seq23["I"] seq24["L"] seq25["I"] seq26["T"] seq27["Y"] seq28[" "] seq29["T"] seq30["O"] + seq31[" "] seq32["A"] seq33["D"] seq34["A"] seq35["P"] seq36["T"] + space:36 + i1["I"] i2["-"] i3["-"] i4["-"] i5["-"] i6["-"] i7["I"] i8["-"] i9["-"] i10["-"] + i11["-"] i12["-"] i13["-"] i14["I"] i15["-"] i16["-"] i17["-"] i18["-"] i19["-"] i20["-"] + i21["-"] i22["-"] i23["I"] i24["-"] i25["I"] i26["-"] i27["-"] i28["-"] i29["-"] i30["-"] + i31["-"] i32["-"] i33["-"] i34["-"] i35["-"] i36["-"] + n1["-"] n2["N"] n3["-"] n4["-"] n5["-"] n6["-"] n7["-"] n8["-"] n9["-"] n10["N"] + n11["-"] n12["-"] n13["-"] n14["-"] n15["-"] n16["-"] n17["-"] n18["-"] n19["-"] n20["-"] + n21["-"] n22["-"] n23["-"] n24["-"] n25["-"] n26["-"] n27["-"] n28["-"] n29["-"] n30["-"] + n31["-"] n32["-"] n33["-"] n34["-"] n35["-"] n36["-"] + t1["-"] t2["-"] t3["T"] t4["-"] t5["-"] t6["-"] t7["-"] t8["-"] t9["-"] t10["-"] + t11["-"] t12["-"] t13["-"] t14["-"] t15["-"] t16["-"] t17["T"] t18["-"] t19["-"] t20["-"] + t21["-"] t22["-"] t23["-"] t24["-"] t25["-"] t26["T"] t27["-"] t28["-"] t29["T"] t30["-"] + t31["-"] t32["-"] t33["-"] t34["-"] t35["-"] t36["T"] + e1["-"] e2["-"] e3["-"] e4["E"] e5["-"] e6["-"] e7["-"] e8["-"] e9["E"] e10["-"] + e11["-"] e12["E"] e13["-"] e14["-"] e15["-"] e16["-"] e17["-"] e18["-"] e19["E"] e20["-"] + e21["-"] e22["-"] e23["-"] e24["-"] e25["-"] e26["-"] e27["-"] e28["-"] e29["-"] e30["-"] + e31["-"] e32["-"] e33["-"] e34["-"] e35["-"] e36["-"] + l1["-"] l2["-"] l3["-"] l4["-"] l5["L"] l6["L"] l7["-"] l8["-"] l9["-"] l10["-"] + l11["-"] l12["-"] l13["-"] l14["-"] l15["-"] l16["-"] l17["-"] l18["-"] l19["-"] l20["-"] + l21["-"] l22["-"] l23["-"] l24["L"] l25["-"] l26["-"] l27["-"] l28["-"] l29["-"] l30["-"] + l31["-"] l32["-"] l33["-"] l34["-"] l35["-"] l36["-"] + g1["-"] g2["-"] g3["-"] g4["-"] g5["-"] g6["-"] g7["-"] g8["G"] g9["-"] g10["-"] + g11["-"] g12["-"] g13["-"] g14["-"] g15["-"] g16["-"] g17["-"] g18["-"] g19["-"] g20["-"] + g21["-"] g22["-"] g23["-"] g24["-"] g25["-"] g26["-"] g27["-"] g28["-"] g29["-"] g30["-"] + g31["-"] g32["-"] g33["-"] g34["-"] g35["-"] g36["-"] + c1["-"] c2["-"] c3["-"] c4["-"] c5["-"] c6["-"] c7["-"] c8["-"] c9["-"] c10["-"] + c11["C"] c12["-"] c13["-"] c14["-"] c15["-"] c16["-"] c17["-"] c18["-"] c19["-"] c20["-"] + c21["-"] c22["-"] c23["-"] c24["-"] c25["-"] c26["-"] c27["-"] c28["-"] c29["-"] c30["-"] + c31["-"] c32["-"] c33["-"] c34["-"] c35["-"] c36["-"] + sp1["-"] sp2["-"] sp3["-"] sp4["-"] sp5["-"] sp6["-"] sp7["-"] sp8["-"] sp9["-"] sp10["-"] + sp11["-"] sp12["-"] sp13[" "] sp14["-"] sp15["-"] sp16[" "] sp17["-"] sp18["-"] sp19["-"] sp20[" "] + sp21["-"] sp22["-"] sp23["-"] sp24["-"] sp25["-"] sp26["-"] sp27["-"] sp28[" "] sp29["-"] sp30["-"] + sp31[" "] sp32["-"] sp33["-"] sp34["-"] sp35["-"] sp36["-"] + s1["-"] s2["-"] s3["-"] s4["-"] s5["-"] s6["-"] s7["-"] s8["-"] s9["-"] s10["-"] + s11["-"] s12["-"] s13["-"] s14["-"] s15["S"] s16["-"] s17["-"] s18["-"] s19["-"] s20["-"] + s21["-"] s22["-"] s23["-"] s24["-"] s25["-"] s26["-"] s27["-"] s28["-"] s29["-"] s30["-"] + s31["-"] s32["-"] s33["-"] s34["-"] s35["-"] s36["-"] + h1["-"] h2["-"] h3["-"] h4["-"] h5["-"] h6["-"] h7["-"] h8["-"] h9["-"] h10["-"] + h11["-"] h12["-"] h13["-"] h14["-"] h15["-"] h16["-"] h17["-"] h18["H"] h19["-"] h20["-"] + h21["-"] h22["-"] h23["-"] h24["-"] h25["-"] h26["-"] h27["-"] h28["-"] h29["-"] h30["-"] + h31["-"] h32["-"] h33["-"] h34["-"] h35["-"] h36["-"] + a1["-"] a2["-"] a3["-"] a4["-"] a5["-"] a6["-"] a7["-"] a8["-"] a9["-"] a10["-"] + a11["-"] a12["-"] a13["-"] a14["-"] a15["-"] a16["-"] a17["-"] a18["-"] a19["-"] a20["-"] + a21["A"] a22["-"] a23["-"] a24["-"] a25["-"] a26["-"] a27["-"] a28["-"] a29["-"] a30["-"] + a31["-"] a32["A"] a33["-"] a34["A"] a35["-"] a36["-"] + b1["-"] b2["-"] b3["-"] b4["-"] b5["-"] b6["-"] b7["-"] b8["-"] b9["-"] b10["-"] + b11["-"] b12["-"] b13["-"] b14["-"] b15["-"] b16["-"] b17["-"] b18["-"] b19["-"] b20["-"] + b21["-"] b22["B"] b23["-"] b24["-"] b25["-"] b26["-"] b27["-"] b28["-"] b29["-"] b30["-"] + b31["-"] b32["-"] b33["-"] b34["-"] b35["-"] b36["-"] + y1["-"] y2["-"] y3["-"] y4["-"] y5["-"] y6["-"] y7["-"] y8["-"] y9["-"] y10["-"] + y11["-"] y12["-"] y13["-"] y14["-"] y15["-"] y16["-"] y17["-"] y18["-"] y19["-"] y20["-"] + y21["-"] y22["-"] y23["-"] y24["-"] y25["-"] y26["-"] y27["Y"] y28["-"] y29["-"] y30["-"] + y31["-"] y32["-"] y33["-"] y34["-"] y35["-"] y36["-"] + o1["-"] o2["-"] o3["-"] o4["-"] o5["-"] o6["-"] o7["-"] o8["-"] o9["-"] o10["-"] + o11["-"] o12["-"] o13["-"] o14["-"] o15["-"] o16["-"] o17["-"] o18["-"] o19["-"] o20["-"] + o21["-"] o22["-"] o23["-"] o24["-"] o25["-"] o26["-"] o27["-"] o28["-"] o29["-"] o30["O"] + o31["-"] o32["-"] o33["-"] o34["-"] o35["-"] o36["-"] + d1["-"] d2["-"] d3["-"] d4["-"] d5["-"] d6["-"] d7["-"] d8["-"] d9["-"] d10["-"] + d11["-"] d12["-"] d13["-"] d14["-"] d15["-"] d16["-"] d17["-"] d18["-"] d19["-"] d20["-"] + d21["-"] d22["-"] d23["-"] d24["-"] d25["-"] d26["-"] d27["-"] d28["-"] d29["-"] d30["-"] + d31["-"] d32["-"] d33["D"] d34["-"] d35["-"] d36["-"] + p1["-"] p2["-"] p3["-"] p4["-"] p5["-"] p6["-"] p7["-"] p8["-"] p9["-"] p10["-"] + p11["-"] p12["-"] p13["-"] p14["-"] p15["-"] p16["-"] p17["-"] p18["-"] p19["-"] p20["-"] + p21["-"] p22["-"] p23["-"] p24["-"] p25["-"] p26["-"] p27["-"] p28["-"] p29["-"] p30["-"] + p31["-"] p32["-"] p33["-"] p34["-"] p35["P"] p36["-"] + classDef c1 fill:#ff7f0e,color:#fff; + classDef c2 fill:#ffbb78,color:#000; + classDef c3 fill:#2ca02c,color:#fff; + classDef c4 fill:#98df8a,color:#000; + classDef c5 fill:#d62728,color:#fff; + classDef c6 fill:#ff9896,color:#000; + classDef c7 fill:#9467bd,color:#fff; + classDef c8 fill:#c5b0d5,color:#000; + classDef c9 fill:#8c564b,color:#fff; + classDef c10 fill:#c49c94,color:#000; + classDef c11 fill:#e377c2,color:#fff; + classDef c12 fill:#f7b6d2,color:#000; + classDef c13 fill:#bcbd22,color:#fff; + classDef c14 fill:#dbdb8d,color:#000; + classDef c15 fill:#17becf,color:#fff; + classDef c16 fill:#9edae5,color:#000; + class seq1,seq7,seq14,seq23,seq25,i1,i7,i14,i23,i25 c1 + class seq2,seq10,n2,n10 c2 + class seq3,seq17,seq26,seq29,seq36,t3,t17,t26,t29,t36 c3 + class seq4,seq9,seq12,seq19,e4,e9,e12,e19 c4 + class seq5,seq6,seq24,l5,l6,l24 c5 + class seq8,g8 c6 + class seq11,c11 c7 + class seq13,seq16,seq20,seq28,seq31,sp13,sp16,sp20,sp28,sp31 c8 + class seq15,s15 c9 + class seq18,h18 c10 + class seq21,seq32,seq34,a21,a32,a34 c11 + class seq22,b22 c12 + class seq27,y27 c13 + class seq30,o30 c14 + class seq33,d33 c15 + class seq35,p35 c16 +``` Congeneric sequence for `E` ``` mermaid From 07fb4f6259a324f2d47e7d951dc4b577dd6b9d3c Mon Sep 17 00:00:00 2001 From: Igor Rodionov Date: Mon, 23 Jun 2025 11:13:54 +0200 Subject: [PATCH 20/35] Added binding and mode dedinitions --- docs/fundamentals/objects/alphabet.md | 76 ++++-- docs/fundamentals/objects/binding.md | 35 +++ docs/fundamentals/objects/carrier_set.md | 52 ++++ docs/fundamentals/objects/index_set.md | 17 ++ docs/fundamentals/objects/interval.md | 22 +- docs/fundamentals/objects/intervals_order.md | 119 ++++++++- docs/fundamentals/objects/mode.md | 259 +++++++++++++++++++ docs/fundamentals/objects/order.md | 110 +++++++- docs/fundamentals/objects/sequence.md | 22 +- mkdocs.yml | 3 + 10 files changed, 682 insertions(+), 33 deletions(-) create mode 100644 docs/fundamentals/objects/binding.md create mode 100644 docs/fundamentals/objects/carrier_set.md create mode 100644 docs/fundamentals/objects/index_set.md create mode 100644 docs/fundamentals/objects/mode.md diff --git a/docs/fundamentals/objects/alphabet.md b/docs/fundamentals/objects/alphabet.md index 0c06aac6..d21cc4b5 100644 --- a/docs/fundamentals/objects/alphabet.md +++ b/docs/fundamentals/objects/alphabet.md @@ -1,38 +1,70 @@ # Alphabet -An alphabet is an ordered set of unique elements of a sequence. -The order of elements in the alphabet is defined by the order of their appearance in the original sequence. +An alphabet is a m-tuple of unique elements. ## Mathematical Definition -The alphabet $A$ is defined as an ordered set: -$$A = \{a_1, a_2, ..., a_m\}$$ +Let $X$ is [_Carrier set_](./carrier_set.md#Mathematical Definition) + +The _alphabet_ $A$ is a m-tuple with a uniqueness constraint, can be defined: + +$$A = ,$$ + +$$\forall i,j \in \{1, ... ,m\}, i \neq j \implies a_i \neq a_j,$$ + +$$\forall i \in \{1, ... ,m\} \exists a_i \in X $$ Where: -- $m$ is called a power of the alphabet -- $a_i \neq a_j$ for all $i \neq j$ where $i,j \in [1..n]$ -- $a_i \in X$ for all $i \in \{1,2,...,m\}$ -- $X$ is an unordered set -- $=$ is the equivalence relation defined on $X$ + +- $m := |A|$ is called _power_ of the alphabet, $m \in N$ +- $a_i$​ is called the $i$-th _element_ (or coordinate) of the alphabet. ## Examples ### Binary Sequence -For sequence $S = <0,1,1,0,1,0,0,1,1,0>$ -The alphabet is $A = \{0,1\}$ +A binary sequence `0110100110` + +represented as + +$X = \{0,1\}$ + +$A = <0,1>$ + +### Musical Chorus Sequence +A musical chorus for `Jingle bell rock` -### Musical Chorus -For sequence $S = $ -The alphabet is $A = \{D,Dmaj7,D6,D,D\#dim,Em,A7,A9\}$ +``` +D Dmaj7 D6 +Jingle-bell, Jingle-bell, Jingle-bell Rock. + D D#dim +Jingle-bell swing and + Em A7 Em A7 Em A7 +Jingle-bell ring. Snowin' and blowin' up bushels of fun. +Em A9 A7 +Now the jingle-hop has begun. +``` + +$X = \{A7, A9, D, D6, Dmaj7, D\#dim, Em\}$ + +$A = $ ### DNA Sequence -For sequence $S = $ -The alphabet is $A = \{A,T,G,C\}$ +A DNA sequence `ATGCTAGCATGCTAGCATGCTAGC` + +$X = \{A,C,T,G\}$ + +$A = $ + +### English Text Sequence as char sequence +An English text sentence `the quick brown fox jumps over the lazy dog` + +$X = \{\ ,a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z\}$ + +$A = $ + +### English Text Sequence as word sequence +An English text sentence `the quick brown fox jumps over the lazy dog` -### Character Sequence -For sequence $S = $ -The alphabet is $A = \{t,h,e,\ ,q,u,i,c,k,b,r,o,w,n,f,x,j,m,p,s,v,l,a,z,y,d,g}$ +$X = \{\ ,quick, fox, brown, the, over, dog, fox, lazy\}$ -### Word Sequence -For sequence $S = $ -The alphabet is $A = \{the,\ ,quick, brown, fox, , jumps, over, lazy, dog\}$ +$A = $ diff --git a/docs/fundamentals/objects/binding.md b/docs/fundamentals/objects/binding.md new file mode 100644 index 00000000..7fb43897 --- /dev/null +++ b/docs/fundamentals/objects/binding.md @@ -0,0 +1,35 @@ +# Binding + +A __binding__ determines the way of reading the sequence when computing intervals. +Two binding values ​​are defined - $start$ and $end$. +$start$ binding counts intervals back to the previous occurrence of the element and the $end$ binding forward to the next occurrence. +In other words, you can think of $start$ as looking for `right-to-left` and $end$ as looking for `left-to-right`. +In practice, there is no good reason to prefer one binding over the other. +We define `binding` in the interests of a consistent and fully encompassing mathematical theory. + +## Mathematical Definition + +Define _binding_ $B = \{ start, end \}$ + + +## Examples + +The interval for the second appearance of the symbol `A` in the following sequence would be `3` for $start$ bidning and `4` for $end$. +``` mermaid +block-beta + columns 9 + space l1["<-- start --"]:3 space:5 + space start1["3"]:3 space:5 + s1["A"] s2["C"] s3["T"] s4["A"] s5["C"] s6["G"] s7["G"] s8["A"] s9["G"] + space:3 end1["4"]:4 space:2 + space:3 l3["-- end -->"]:4 + + classDef c3 fill:#2ca02c,color:#fff; + classDef c4 fill:#98df8a,color:#000; + classDef active fill:#98df8a,color:#000,stroke-width:4px; + classDef label fill:#fff,color:#000,stroke-width:0px; + class s1,s8 c3 + class s4 active + class start1,end1 c4 + class l1,l2,l3 label +``` diff --git a/docs/fundamentals/objects/carrier_set.md b/docs/fundamentals/objects/carrier_set.md new file mode 100644 index 00000000..7dfe8628 --- /dev/null +++ b/docs/fundamentals/objects/carrier_set.md @@ -0,0 +1,52 @@ +# Carrier set + +A _carrier set_ $X$ is a _set_ of all possible elements of a sequence + +## Mathematical Definition + +Let $X$ be a (possibly infinite) [set](https://en.wikipedia.org/wiki/Set_(mathematics)). + +## Examples + +### Binary Sequence + +A binary sequence `0110100110` + +represented as + +$X = \{0,1\}$ + +### Musical Chorus Sequence + +A musical chorus for `Jingle bell rock` + +``` +D Dmaj7 D6 +Jingle-bell, Jingle-bell, Jingle-bell Rock. + D D#dim +Jingle-bell swing and + Em A7 Em A7 Em A7 +Jingle-bell ring. Snowin' and blowin' up bushels of fun. +Em A9 A7 +Now the jingle-hop has begun. +``` + +$X = \{A7, A9, D, D6, Dmaj7, D\#dim, Em\}$ + +### DNA Sequence + +A DNA sequence `ATGCTAGCATGCTAGCATGCTAGC` + +$X = \{A,C,G,T\}$ + +### English Text Sequence as char sequence + +An English text sentence `the quick brown fox jumps over the lazy dog` + +$X = \{\ ,a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z \}$ + +### English Text Sequence as word sequence + +An English text sentence `the quick brown fox jumps over the lazy dog` + +$X = \{\ , brown, dog, quick, fox, lazy, over, the\}$ diff --git a/docs/fundamentals/objects/index_set.md b/docs/fundamentals/objects/index_set.md new file mode 100644 index 00000000..2d9b9c7c --- /dev/null +++ b/docs/fundamentals/objects/index_set.md @@ -0,0 +1,17 @@ +# Index set + +A _index set_ $J$ is a _set_ of natrual numbers from 1 to $n$ + +## Mathematical Definition + +$$\forall n \in N \exists J = \{1, ... n \} \subset N$$ + +## Examples + +### Binary Sequence + +$J = \{1, 2, 3, 4, 5, 6, 7, 8, 9, 10\}$ + +$J = \{1\}$ + +$J = \{1, 2, 3, 4\}$ diff --git a/docs/fundamentals/objects/interval.md b/docs/fundamentals/objects/interval.md index 473d9beb..d36e976e 100644 --- a/docs/fundamentals/objects/interval.md +++ b/docs/fundamentals/objects/interval.md @@ -1,3 +1,23 @@ # Interval -Coming soon +An __interval__ is a natural number representing the count of different elements that occur between reseated elements in a sequence + 1. + +## Mathematical Definition + +Let _interval_ $i \in N \backslash \{0\}$ + + +## Examples + +The intervals for symbol `A` in the following sequence would be `2 + 1 = 3` +``` mermaid +block-beta + columns 6 + s1["A"] s2["C"] s3["T"] s4["A"] s5["C"] s6["G"] + i1["3"]:3 + + classDef c3 fill:#2ca02c,color:#fff; + classDef c4 fill:#98df8a,color:#000; + class s1,s4,s7,s8,s9,s11,s12 c3 + class i1,i2,i3,i4,i5,i6,i7 c4 +``` diff --git a/docs/fundamentals/objects/intervals_order.md b/docs/fundamentals/objects/intervals_order.md index 49c2649a..f9fb9417 100644 --- a/docs/fundamentals/objects/intervals_order.md +++ b/docs/fundamentals/objects/intervals_order.md @@ -1,3 +1,120 @@ # Intervals Order -Coming soon +An _intervals order_ is an n-tuple of natural numbers that represents the distance between equal elements in a sequence. + +## Mathematical Definition + +Let $B = \{start, end\}$ is binding and $M = \{ terminate, cycle\}$ is mode; + +Let $J = \{1, ..., n\} \subset N$ + +Define `follow` $F : B \times M \times J^n \longrightarrow (J)^n$ + +Define `traceble` $T : B \times M \times J^n \longrightarrow (\{True, False\})^n$ + +N-tuple of natual numbers $IO = \{ | \forall i \in J \exists o_i \in J \}$ + +are called `interval order` if and only if + +$$ + \exists (b, m) \in B \times M \Bigg| \forall i \Big( T(b, m, io_i) \land \forall j \ne i \big( F(b, m, io_i) \neq F(b, m, io_j) \big) \Big) +$$ + + + + +Where: + +- $n := |O|$ is called _length_ of the order, $n \in N$ +- $o_i$​ is called the $i$-th _element_ (or coordinate) of the order + +## Examples + +### Valid order + +``` mermaid +block-beta + columns 36 + i1["1"] i2["2"] i3["3"] i4["2"] i5["4"] i6["2"] + i7["5"] i8["2"] i9["6"] i10["2"] i11["7"] i12["2"] + i13["1"] i14["2"] i15["8"] i16["2"] i17["9"] + + classDef red fill:#d62728,color:#000; + +``` + +### Invalid order - Start different from `1` + + +``` mermaid +block-beta + columns 36 + i1["2"] i2["2"] i3["3"] i4["2"] i5["4"] i6["2"] + i7["5"] i8["2"] i9["6"] i10["2"] i11["7"] i12["2"] + i13["1"] i14["2"] i15["8"] i16["2"] i17["9"] + + classDef red fill:#d62728,color:#000; + + class i1 red +``` + +### Invalid order - Contains elements not in $N$ + +``` mermaid +block-beta + columns 36 + i1["1"] i2["2"] i3["3"] i4["2"] i5["4"] i6["2"] + i7["5"] i8["2"] i9["6"] i10["T"] i11["7"] i12["2"] + i13["1"] i14["-2"] i15["8"] i16["2"] i17["9"] + + classDef red fill:#d62728,color:#000; + + class i10,i14 red +``` + +### Invalid order - Violates `max + 1` contstraint + +``` mermaid +block-beta + columns 36 + i1["1"] i2["2"] i3["3"] i4["2"] i5["4"] i6["2"] + i7["5"] i8["2"] i9["6"] i10["2"] i11["7"] i12["2"] + i13["1"] i14["9"] i15["8"] i16["2"] i17["9"] + + classDef red fill:#d62728,color:#000; + + class i14 red +``` + +### Binary Sequence +A binary sequence `0110100110` + +represented as + +$O = <1, 2, 2, 1, 2, 1, 1, 2, 2, 1>$ + +### Musical Chorus Sequence +A musical chorus for `Jingle bell rock` + +``` +D Dmaj7 D6 +Jingle-bell, Jingle-bell, Jingle-bell Rock. + D D#dim +Jingle-bell swing and + Em A7 Em A7 Em A7 +Jingle-bell ring. Snowin' and blowin' up bushels of fun. +Em A9 A7 +Now the jingle-hop has begun. +``` + +$O = <1, 2, 3, 1, 4, 5, 6, 5, 6, 7, 5, 8, 6>$ + +### DNA Sequence +A DNA sequence `ATGCTAGCATGCTAGCATGCTAGC` + +$O = <1, 2, 3, 4, 2, 1, 3, 4, 1, 2, 3, 4, 2, 1, 3, 4, 1, 2, 3, 4, 2, 1, 3, 4>$ + +### English Text Sequence as word sequence +An English text sentence `the quick brown fox jumps over the lazy dog` + +$O = <1, 2, 3, 2, 4, 2, 5, 2, 6, 2, 7, 2, 1, 2, 8, 2, 9>$ diff --git a/docs/fundamentals/objects/mode.md b/docs/fundamentals/objects/mode.md new file mode 100644 index 00000000..09b159f3 --- /dev/null +++ b/docs/fundamentals/objects/mode.md @@ -0,0 +1,259 @@ +# Mode + +The _mode_ determines the method for computing intervals for the first or last appearances of the element. +There is uncertainty about how to count the interval for the first appearance with $start$ binding and +for the last appearance with $end$ binding, as there is no previous or following element appearance in the corresponding cases. + +This interval can be skipped or counted to some `imaginary` appearance of the element. + +The skipping option leads to cons that make reverse operation impossible in the general case - +count of intervals less than the count of elements in the initial sequence, +and/or intervals n-tuple contains `empty` elements. That's why the _mode_ does not have any value +corresponding to any kind of skip first/last interval. + +You can use `lossy` function defined in [Interval Order to Interval Tuple](./intervals_distribution.md) section to exclude the first/last interval that would be equivalent to the skipping approach. + +The _mode_ defines values that assume different ways of `imaginary` elements - $boundary$ and $cycle$. +The `imaginary` elements can be used as `previous` or `following` reference for any element of the sequence, +but do not produce any interval for their own. However, you can use `redundant` function defined in + +[Interval Order to Interval Tuple](./intervals_distribution.md) section to count intervals produced for `imaginary` elements. + +## Boundary + +The $boundary$ mode extends the sequence with `imaginary` elements - `Infimum` ($Inf$) and `Supremum` ($Sup$ ), +which are equal to any element of the sequence. `Infimum` element placed on $0$ position and `Supremum` on $n+1$ position of the sequence. + +=== "$Start$ binding" + + ``` mermaid + block-beta + columns 8 + p0["0"] p1["1"] space:4 p6["n"] p7["n + 1"] + inf["Infimum"] s1["A"] s2["C"] s3["T"] s4["C"] s5["A"] s6["G"] sup["Supremum"] + infa["Infimum"] ia1["1"]:1 space:6 + infc["Infimum"] ic1["2"]:2 space:5 + inft["Infimum"] it1["3"]:3 space:4 + infg["Infimum"] ig1["6"]:6 space:1 + + classDef imaginary fill:#526cfe09,color:#000,stroke-dasharray: 10 5; + classDef position fill:#fff,color:#000,stroke-width:0px; + class inf,sup imaginary + class p0,p1,p6,p7 position + + classDef c1 fill:#ff7f0e,color:#fff; + classDef c2 fill:#ffbb78,color:#000; + classDef c2a fill:#ffbb788a,color:#000; + classDef c3 fill:#2ca02c,color:#fff; + classDef c4 fill:#98df8a,color:#000; + classDef c4a fill:#98df8a8a,color:#000; + classDef c5 fill:#d62728,color:#fff; + classDef c6 fill:#ff9896,color:#000; + classDef c6a fill:#ff98968a,color:#000; + classDef c7 fill:#9467bd,color:#fff; + classDef c8 fill:#c5b0d5,color:#000; + classDef c9 fill:#8c564b,color:#fff; + classDef c10 fill:#c49c94,color:#000; + classDef c11 fill:#e377c2,color:#fff; + classDef c12 fill:#f7b6d2,color:#000; + classDef c13 fill:#bcbd22,color:#fff; + classDef c14 fill:#dbdb8d,color:#000; + classDef c14a fill:#dbdb8d8a,color:#000; + classDef c15 fill:#17becf,color:#fff; + classDef c16 fill:#9edae5,color:#000; + + class s1,ia1 c2 + class infa c2a + class s2,ic1 c4 + class infc c4a + class s3,it1 c6 + class inft c6a + class s6,ig1 c14 + class infg c14a + class p1,p2,p3,p4,p5,p6,p7,p8,p9,f1,f2,f3,f4,f5,f6,f7,f8,f9 imaginary + class pomn,p00,p01,p06,p07,p02n position + + ``` + +=== "$End$ binding" + + ``` mermaid + block-beta + columns 8 + p0["0"] p1["1"] space:4 p6["n"] p7["n + 1"] + inf["Infimum"] s1["A"] s2["C"] s3["T"] s4["C"] s5["A"] s6["G"] sup["Supremum"] + space:5 ia1["2"]:2 supa["Supremum"] + space:4 ic1["3"]:3 supc["Supremum"] + space:3 it1["4"]:4 supt["Supremum"] + space:6 ig1["1"]:1 supg["Supremum"] + + classDef imaginary fill:#526cfe09,color:#000,stroke-dasharray: 10 5; + classDef position fill:#fff,color:#000,stroke-width:0px; + class inf,sup imaginary + class p0,p1,p6,p7 position + + classDef c1 fill:#ff7f0e,color:#fff; + classDef c2 fill:#ffbb78,color:#000; + classDef c2a fill:#ffbb788a,color:#000; + classDef c3 fill:#2ca02c,color:#fff; + classDef c4 fill:#98df8a,color:#000; + classDef c4a fill:#98df8a8a,color:#000; + classDef c5 fill:#d62728,color:#fff; + classDef c6 fill:#ff9896,color:#000; + classDef c6a fill:#ff98968a,color:#000; + classDef c7 fill:#9467bd,color:#fff; + classDef c8 fill:#c5b0d5,color:#000; + classDef c9 fill:#8c564b,color:#fff; + classDef c10 fill:#c49c94,color:#000; + classDef c11 fill:#e377c2,color:#fff; + classDef c12 fill:#f7b6d2,color:#000; + classDef c13 fill:#bcbd22,color:#fff; + classDef c14 fill:#dbdb8d,color:#000; + classDef c14a fill:#dbdb8d8a,color:#000; + classDef c15 fill:#17becf,color:#fff; + classDef c16 fill:#9edae5,color:#000; + + class s5,ia1 c2 + class supa c2a + class s4,ic1 c4 + class supc c4a + class s3,it1 c6 + class supt c6a + class s6,ig1 c14 + class supg c14a + class p1,p2,p3,p4,p5,p6,p7,p8,p9,f1,f2,f3,f4,f5,f6,f7,f8,f9 imaginary + class pomn,p00,p01,p06,p07,p02n position + ``` + + +## Cycle + +In the $cycle$ mode, the sequence is extended by copying itself as an `imaginary` prefix/suffix to mock a cycled sequence (also known as a periodic sequence or an orbit). The first/last interval counts to the previous/following element in `imaginary` prefix/suffix. + + +=== "$Start$ binding" + + ``` mermaid + block-beta + columns 18 + pomn["-n"] space:4 p00["0"] p01["1"] space:4 p06["n"] p07["n + 1"] space:4 p02n["n + n"] + p1["A"] p2["C"] p3["T"] p4["C"] p5["A"] p6["G"] s1["A"] s2["C"] s3["T"] s4["C"] s5["A"] s6["G"] f1["A"] f2["C"] f3["T"] f4["C"] f5["A"] f6["G"] + space:5 ia1["2"]:2 space:11 + space:4 ic1["4"]:4 space:10 + space:3 it1["6"]:6 space:9 + space:6 ig1["6"]:6 space:6 + + classDef imaginary fill:#526cfe09,color:#000,stroke-dasharray: 10 5; + classDef position fill:#fff,color:#000,stroke-width:0px; + + classDef c1 fill:#ff7f0e,color:#fff; + classDef c2 fill:#ffbb78,color:#000; + classDef c2a fill:#ffbb788a,color:#000; + classDef c3 fill:#2ca02c,color:#fff; + classDef c4 fill:#98df8a,color:#000; + classDef c4a fill:#98df8a8a,color:#000; + classDef c5 fill:#d62728,color:#fff; + classDef c6 fill:#ff9896,color:#000; + classDef c6a fill:#ff98968a,color:#000; + classDef c7 fill:#9467bd,color:#fff; + classDef c8 fill:#c5b0d5,color:#000; + classDef c9 fill:#8c564b,color:#fff; + classDef c10 fill:#c49c94,color:#000; + classDef c11 fill:#e377c2,color:#fff; + classDef c12 fill:#f7b6d2,color:#000; + classDef c13 fill:#bcbd22,color:#fff; + classDef c14 fill:#dbdb8d,color:#000; + classDef c14a fill:#dbdb8d8a,color:#000; + classDef c15 fill:#17becf,color:#fff; + classDef c16 fill:#9edae5,color:#000; + + class s1,ia1 c2 + class p5 c2a + class s2,ic1 c4 + class p4 c4a + class s3,it1 c6 + class p3 c6a + class s6,ig1 c14 + class p6 c14a + class p1,p2,p3,p4,p5,p6,p7,p8,p9,f1,f2,f3,f4,f5,f6,f7,f8,f9 imaginary + class pomn,p00,p01,p06,p07,p02n position + + ``` + +=== "$End$ binding" + + ``` mermaid + block-beta + columns 18 + pomn["-n"] space:4 p00["0"] p01["1"] space:4 p06["n"] p07["n + 1"] space:4 p02n["n + n"] + p1["A"] p2["C"] p3["T"] p4["C"] p5["A"] p6["G"] s1["A"] s2["C"] s3["T"] s4["C"] s5["A"] s6["G"] f1["A"] f2["C"] f3["T"] f4["C"] f5["A"] f6["G"] + space:10 ia1["2"]:2 space:6 + space:9 ic1["4"]:4 space:5 + space:8 it1["6"]:6 space:5 + space:10 ig1["6"]:6 space:1 + + classDef imaginary fill:#526cfe09,color:#000,stroke-dasharray: 10 5; + classDef position fill:#fff,color:#000,stroke-width:0px; + + classDef c1 fill:#ff7f0e,color:#fff; + classDef c2 fill:#ffbb78,color:#000; + classDef c2a fill:#ffbb788a,color:#000; + classDef c3 fill:#2ca02c,color:#fff; + classDef c4 fill:#98df8a,color:#000; + classDef c4a fill:#98df8a8a,color:#000; + classDef c5 fill:#d62728,color:#fff; + classDef c6 fill:#ff9896,color:#000; + classDef c6a fill:#ff98968a,color:#000; + classDef c7 fill:#9467bd,color:#fff; + classDef c8 fill:#c5b0d5,color:#000; + classDef c9 fill:#8c564b,color:#fff; + classDef c10 fill:#c49c94,color:#000; + classDef c11 fill:#e377c2,color:#fff; + classDef c12 fill:#f7b6d2,color:#000; + classDef c13 fill:#bcbd22,color:#fff; + classDef c14 fill:#dbdb8d,color:#000; + classDef c14a fill:#dbdb8d8a,color:#000; + classDef c15 fill:#17becf,color:#fff; + classDef c16 fill:#9edae5,color:#000; + + class s5,ia1 c2 + class f1 c2a + class s4,ic1 c4 + class f2 c4a + class s3,it1 c6 + class f3 c6a + class s6,ig1 c14 + class f6 c14a + class p1,p2,p3,p4,p5,p6,p7,p8,p9,f1,f2,f3,f4,f5,f6,f7,f8,f9 imaginary + class pomn,p00,p01,p06,p07,p02n position + + ``` + +The $cycle$ mode is inspired and aligned with the idea of representativeness heuristic, which is fundamental in probability and statistics, and the Necklace problems in combinatorics. + +At the same time, the $boundary$ mode looks like related to tree structures and graph theory. + +## Mathematical Definition + +Let $X$ is [_Carrier set_](./carrier_set.md#Mathematical Definition) + +Let $S$ is [_Sequence_](./sequence.md#Mathematical Definition) length of $n$ described as function $S : \{1,...,n\} \longrightarrow X$ + +Define _mode_ $M = \{ boundary, cycle \}$ + +Define set $\bot = \{ Inf, Sup \ | \forall s \in X(s = Inf \land s = Sup) \}$ + +Define $X_\bot = X \cup \bot$ set + +$$\forall S \exists S_{boundary} : \{0,...,n+1\} \longrightarrow X_\bot \implies S_{boundary}(i) = \Biggl\{ \begin{array}{l} Inf, i=0 \\ S(i), 1 \le i \le n \\ Sup, i = n+1\end{array}$$ + + + + +$$\forall S \exists S_{cycle} : Z \longrightarrow X \implies S_{cycle}(i) = S\Big( i - n \times \big( ( i - 1) (\ mod\ n) \big) \Big)$$ diff --git a/docs/fundamentals/objects/order.md b/docs/fundamentals/objects/order.md index 7abd7c2d..f37056c7 100644 --- a/docs/fundamentals/objects/order.md +++ b/docs/fundamentals/objects/order.md @@ -1,3 +1,111 @@ # Order -Coming soon +An _order_ is a n-tuple of natural numbers starting from `1` with `max+1` constraint. + +## Mathematical Definition + +The _order_ $O$ is defined as a n-tuple with additional constraints: + +$$O = ,$$ + +$$\forall i \in \{1, ..., n\} \exists o_i \in N $$ + +$$ o_1 = 1, $$ + +$$\forall i \in \{1, ..., n\}, o_i \leq max(o_1, ..., o_{i-1}) + 1$$ + +Where: + +- $n := |O|$ is called _length_ of the order, $n \in N$ +- $o_i$​ is called the $i$-th _element_ (or coordinate) of the order + +## Examples + +### Valid order + +``` mermaid +block-beta + columns 36 + i1["1"] i2["2"] i3["3"] i4["2"] i5["4"] i6["2"] + i7["5"] i8["2"] i9["6"] i10["2"] i11["7"] i12["2"] + i13["1"] i14["2"] i15["8"] i16["2"] i17["9"] + + classDef red fill:#d62728,color:#000; + +``` + +### Invalid order - Start different from `1` + + +``` mermaid +block-beta + columns 36 + i1["2"] i2["2"] i3["3"] i4["2"] i5["4"] i6["2"] + i7["5"] i8["2"] i9["6"] i10["2"] i11["7"] i12["2"] + i13["1"] i14["2"] i15["8"] i16["2"] i17["9"] + + classDef red fill:#d62728,color:#000; + + class i1 red +``` + +### Invalid order - Contains elements not in `N` + +``` mermaid +block-beta + columns 36 + i1["1"] i2["2"] i3["3"] i4["2"] i5["4"] i6["2"] + i7["5"] i8["2"] i9["6"] i10["T"] i11["7"] i12["2"] + i13["1"] i14["-2"] i15["8"] i16["2"] i17["9"] + + classDef red fill:#d62728,color:#000; + + class i10,i14 red +``` + +### Invalid order - Violates `max + 1` contstraint + +``` mermaid +block-beta + columns 36 + i1["1"] i2["2"] i3["3"] i4["2"] i5["4"] i6["2"] + i7["5"] i8["2"] i9["6"] i10["2"] i11["7"] i12["2"] + i13["1"] i14["9"] i15["8"] i16["2"] i17["9"] + + classDef red fill:#d62728,color:#000; + + class i14 red +``` + +### Binary Sequence +A binary sequence `0110100110` + +represented as + +$O = <1, 2, 2, 1, 2, 1, 1, 2, 2, 1>$ + +### Musical Chorus Sequence +A musical chorus for `Jingle bell rock` + +``` +D Dmaj7 D6 +Jingle-bell, Jingle-bell, Jingle-bell Rock. + D D#dim +Jingle-bell swing and + Em A7 Em A7 Em A7 +Jingle-bell ring. Snowin' and blowin' up bushels of fun. +Em A9 A7 +Now the jingle-hop has begun. +``` + +$O = <1, 2, 3, 1, 4, 5, 6, 5, 6, 7, 5, 8, 6>$ + +### DNA Sequence +A DNA sequence `ATGCTAGCATGCTAGCATGCTAGC` + +$O = <1, 2, 3, 4, 2, 1, 3, 4, 1, 2, 3, 4, 2, 1, 3, 4, 1, 2, 3, 4, 2, 1, 3, 4>$ + +### English Text Sequence as word sequence +An English text sentence `the quick brown fox jumps over the lazy dog` + +$O = <1, 2, 3, 2, 4, 2, 5, 2, 6, 2, 7, 2, 1, 2, 8, 2, 9>$ diff --git a/docs/fundamentals/objects/sequence.md b/docs/fundamentals/objects/sequence.md index 9724cc74..8f65b0e3 100644 --- a/docs/fundamentals/objects/sequence.md +++ b/docs/fundamentals/objects/sequence.md @@ -1,20 +1,22 @@ # Sequence A sequence is a fundamental concept in formal order analysis that is defined as a finite, enumerated collection of objects in which repetitions are allowed and order matters. -It is the basic object for analyzing patterns, relationships, and structural properties in ordered data. +This is the basic object for analyzing patterns, relationships, and structural properties in ordered data. ## Mathematical Definition -A sequence $S$ is as tuple: +Let $X$ is [_Carrier set_](./carrier_set.md#Mathematical Definition) -$$S = $$ +A _sequence_ $S$ is a n-tuple defined as + +$$S = ,$$ + +$$\forall i \in \{1, ..., n\} \exists s_i \in X$$ where: -- $n$ is the length of the sequence -- $s_i \in X$ for all $i \in \{1,2,...,n\}$ -- $X$ is an unordered set -- $=$ is the equivalence relation defined on $X$ +- $s_i$​ is called the $i$-th _element_ (or coordinate) of the sequence. +- $n := |S|$ is _length_, $n \in N$ ## Examples @@ -41,23 +43,27 @@ Em A9 A7 Now the jingle-hop has begun. ``` -$X = \{D, D6, D\#dim, A7, A9, Dmaj7, Em\}$ +$X = \{A7, A9, D, D6, Dmaj7, D\#dim, Em\}$ + $S = $ ### DNA Sequence A DNA sequence `ATGCTAGCATGCTAGCATGCTAGC` $X = \{A,C,T,G\}$ + $S = $ ### English Text Sequence as char sequence An English text sentence `the quick brown fox jumps over the lazy dog` $X = \{\ ,a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z\}$ + $S = $ ### English Text Sequence as word sequence An English text sentence `the quick brown fox jumps over the lazy dog` $X = \{\ ,quick, fox, brown, the, over, dog, fox, lazy\}$ + $S = $ diff --git a/mkdocs.yml b/mkdocs.yml index a96bf592..724318ad 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -13,10 +13,13 @@ nav: - "Geomteric mean as alternative to probability": fundamentals/ideas/geometric_mean_based_characteristics.md - "Objects": - fundamentals/objects/index.md + - "Carrier set": fundamentals/objects/carrier_set.md - "Sequence": fundamentals/objects/sequence.md - "Alphabet": fundamentals/objects/alphabet.md - "Order": fundamentals/objects/order.md - "Interval": fundamentals/objects/interval.md + - "Binding": fundamentals/objects/binding.md + - "Mode": fundamentals/objects/mode.md - "Intervals Order": fundamentals/objects/intervals_order.md - "Intervals Tuple": fundamentals/objects/intervals_tuple.md - "Intervals Distribution": fundamentals/objects/intervals_distribution.md From 6f0de88e02ff61bba5a75cafd2ad5caaac1593e7 Mon Sep 17 00:00:00 2001 From: Igor Rodionov Date: Mon, 23 Jun 2025 11:16:30 +0200 Subject: [PATCH 21/35] Added binding and mode dedinitions --- docs/fundamentals/objects/mode.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/fundamentals/objects/mode.md b/docs/fundamentals/objects/mode.md index 09b159f3..13bcbaf2 100644 --- a/docs/fundamentals/objects/mode.md +++ b/docs/fundamentals/objects/mode.md @@ -256,4 +256,4 @@ def index(x): return x - (high - low + 1) * ((x - low) // (high - low + 1)) ``` --> -$$\forall S \exists S_{cycle} : Z \longrightarrow X \implies S_{cycle}(i) = S\Big( i - n \times \big( ( i - 1) (\ mod\ n) \big) \Big)$$ +$$\forall S \exists S_{cycle} : Z \longrightarrow X \implies S_{cycle}(i) = S\Big( i - n \times \big( ( i - 1) \ mod\ n \big) \Big)$$ From caf737952ff81864579bea380a3899e0ff39740d Mon Sep 17 00:00:00 2001 From: Igor Rodionov Date: Mon, 23 Jun 2025 11:26:44 +0200 Subject: [PATCH 22/35] Added binding and mode dedinitions --- docs/fundamentals/objects/mode.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/fundamentals/objects/mode.md b/docs/fundamentals/objects/mode.md index 13bcbaf2..fc5f1212 100644 --- a/docs/fundamentals/objects/mode.md +++ b/docs/fundamentals/objects/mode.md @@ -256,4 +256,4 @@ def index(x): return x - (high - low + 1) * ((x - low) // (high - low + 1)) ``` --> -$$\forall S \exists S_{cycle} : Z \longrightarrow X \implies S_{cycle}(i) = S\Big( i - n \times \big( ( i - 1) \ mod\ n \big) \Big)$$ +$$\forall S \exists S_{cycle} : Z \longrightarrow X \implies S_{cycle}(i) = S\big( i - n \times \lfloor ( i - 1) \div n \rfloor \big)$$ From 7a72e6fee14b9fd24d86bf80d4adda33de71a07b Mon Sep 17 00:00:00 2001 From: Igor Rodionov Date: Sun, 29 Jun 2025 13:43:06 +0200 Subject: [PATCH 23/35] Added temporary docs --- docs/fundamentals/objects/binding.md | 184 ++++++++++-- ...{intervals_order.md => intervals_chain.md} | 31 +- docs/fundamentals/objects/mode.md | 109 ++++--- docs/fundamentals/objects/mode/bounded.md | 269 ++++++++++++++++++ docs/fundamentals/objects/mode/cycle.md | 269 ++++++++++++++++++ docs/fundamentals/objects/mode/index.md | 269 ++++++++++++++++++ docs/fundamentals/objects/sequence.md | 6 + mkdocs.yml | 2 +- 8 files changed, 1067 insertions(+), 72 deletions(-) rename docs/fundamentals/objects/{intervals_order.md => intervals_chain.md} (70%) create mode 100644 docs/fundamentals/objects/mode/bounded.md create mode 100644 docs/fundamentals/objects/mode/cycle.md create mode 100644 docs/fundamentals/objects/mode/index.md diff --git a/docs/fundamentals/objects/binding.md b/docs/fundamentals/objects/binding.md index 7fb43897..ced68d9c 100644 --- a/docs/fundamentals/objects/binding.md +++ b/docs/fundamentals/objects/binding.md @@ -1,35 +1,169 @@ # Binding -A __binding__ determines the way of reading the sequence when computing intervals. -Two binding values ​​are defined - $start$ and $end$. -$start$ binding counts intervals back to the previous occurrence of the element and the $end$ binding forward to the next occurrence. -In other words, you can think of $start$ as looking for `right-to-left` and $end$ as looking for `left-to-right`. +A __binding__ is a method of iterating over equivalent elements of the sequence. +Two binding ​are defined - $Start$ and $End$. +$Start$ binding seeks back the previous occurrence of the element, and the $End$ binding seeks the next occurrence. In practice, there is no good reason to prefer one binding over the other. -We define `binding` in the interests of a consistent and fully encompassing mathematical theory. +The definition of all possible `binding` is made in the interests of a consistent and fully encompassing mathematical theory. ## Mathematical Definition -Define _binding_ $B = \{ start, end \}$ +=== "Old" + Let $X$ is [_Carrier set_](./carrier_set.md#Mathematical Definition) + + Let $S$ is [_Sequence_](./sequence.md#Mathematical Definition) length of $n$ described as function $S : \{1,...,n\} \longrightarrow X$ + + Let $P$ is _n-tuple_ of `iterating positions` of equivalent elements $P : \{1,...,n\} \longrightarrow \{0,...,n+1\}$ + + Define + + $$Binding : \big\{S\big\} \longrightarrow \big\{P \big\},$$ + + $$if \ \exists \ Binding^{-1} : \big\{P \big\} \longrightarrow \big\{\{1,...,n\} \longrightarrow \{1,...,m\}\big\}\ that$$ + + $$\forall i \in \{1,...,n\} Binding(S)(i) = Binding(Binding^{-1}(Binding(S)))(i)$$ + + $$Start(S)(i) = \Bigg\{\begin{array}{l} max \big\{j \in \{1,..., i - 1\}\big|S(j) = S(i) \big\} & if \ exists \\ 0 & otherwise \end{array}$$ + + $$Start^{-1}(P)(i) = \Bigg\{\begin{array}{l} \big|\big| & if \ P(i)=0 \\ Start^{-1}(P, P(i)) & otherwise \end{array}$$ + + $$End(S)(i) = \Bigg\{\begin{array}{l} min \big\{j \in \{i+1,..., n\}\big|S(j) = S(i) \big\} & if \ exists \\ n+1 & \ otherwise \end{array}$$ + + $$End^{-1}(P)(i) = \Bigg\{\begin{array}{l} \big|\big| & if \ P(i)=n+1 \\ End^{-1}(P, P(i)) & otherwise \end{array}$$ + + Define $B = \{ Start, End \} \subset \{ Binding \}$ + + +=== "New" + Let $X$ is [_Carrier set_](./carrier_set.md#Mathematical Definition) + + Let $S$ is [_Sequence_](./sequence.md#Mathematical Definition) length of $n$ described as function $S : \{1,...,n\} \longrightarrow X$ + + Let $R$ is _n-tuple_ of `iterating positions` of equivalent elements $P : \{1,...,n\} \longrightarrow \{0,...,n+1\}$ + + Let $M$ is Mode - $M : \{1,...,n\} \longrightarrow \{0,...,n+1\}$ + + Define + + $$Boundary(S)(i) = \Bigg\{\begin{array}{l} 0 & if \nonempty \big\{j \in \{1,..., i - 1\}\big|S(j) = S(i) \big\} \\ n+1 & if \nonempty \big\{j \in \{i,..., n\}\big|S(j) = S(i) \big\} + \end{array}$$ + + $$Binding : M \times \big\{S\big\} \longrightarrow \big\{R \big\},$$ + + + $$if \ \exists \ Binding^{-1} : M \times \big\{R \big\} \longrightarrow \big\{\{1,...,n\} \longrightarrow \{1,...,m\}\big\}\ that$$ + + $$\forall i \in \{1,...,n\} Binding(mo, R)(i) = Binding(mo, R)( Binding^{-1}(mo, Binding(mo, R)) )(i)$$ + + $$Start(S)(i) = \Bigg\{\begin{array}{l} max \big\{j \in \{1,..., i - 1\}\big|S(j) = S(i) \big\} & if \ exists \\ m(S, i) & otherwise \end{array}$$ + + $$Start^{-1}(P)(i) = \Bigg\{\begin{array}{l} \big|\big| & if \ P(i)=0 \\ Start^{-1}(P, P(i)) & otherwise \end{array}$$ + + $$End(S)(i) = \Bigg\{\begin{array}{l} min \big\{j \in \{i+1,..., n\}\big|S(j) = S(i) \big\} & if \ exists \\ n+1 & \ otherwise \end{array}$$ + + $$End^{-1}(P)(i) = \Bigg\{\begin{array}{l} \big|\big| & if \ P(i)=n+1 \\ End^{-1}(P, P(i)) & otherwise \end{array}$$ + + Define $B = \{ Start, End \} \subset \{ Binding \}$ + + + + ## Examples -The interval for the second appearance of the symbol `A` in the following sequence would be `3` for $start$ bidning and `4` for $end$. -``` mermaid -block-beta - columns 9 - space l1["<-- start --"]:3 space:5 - space start1["3"]:3 space:5 - s1["A"] s2["C"] s3["T"] s4["A"] s5["C"] s6["G"] s7["G"] s8["A"] s9["G"] - space:3 end1["4"]:4 space:2 - space:3 l3["-- end -->"]:4 - - classDef c3 fill:#2ca02c,color:#fff; - classDef c4 fill:#98df8a,color:#000; - classDef active fill:#98df8a,color:#000,stroke-width:4px; - classDef label fill:#fff,color:#000,stroke-width:0px; - class s1,s8 c3 - class s4 active - class start1,end1 c4 - class l1,l2,l3 label -``` +=== "$Start$ binding" + + ``` mermaid + block-beta + columns 8 + p0["0"] p1["1"] space:3 p5["5"] p6["n"] p7["n + 1"] + inf["⊥"] s1["A"] s2["C"] s3["T"] s4["C"] s5["A"] s6["G"] sup["⊥"] + e0["0 = Start(1)"]:2 space:6 + space t1["1 = Start(5)"]:5 space:2 + + classDef imaginary fill:#526cfe09,color:#000,stroke-dasharray: 10 5; + classDef position fill:#fff,color:#000,stroke-width:0px; + class inf,sup imaginary + class p0,p1,p5,p6,p7 position + + classDef c1 fill:#ff7f0e,color:#fff; + classDef c2 fill:#ffbb78,color:#000; + classDef c2a fill:#ffbb788a,color:#000; + classDef c3 fill:#2ca02c,color:#fff; + classDef c4 fill:#98df8a,color:#000; + classDef c4a fill:#98df8a8a,color:#000; + classDef c5 fill:#d62728,color:#fff; + classDef c6 fill:#ff9896,color:#000; + classDef c6a fill:#ff98968a,color:#000; + classDef c7 fill:#9467bd,color:#fff; + classDef c8 fill:#c5b0d5,color:#000; + classDef c9 fill:#8c564b,color:#fff; + classDef c10 fill:#c49c94,color:#000; + classDef c11 fill:#e377c2,color:#fff; + classDef c12 fill:#f7b6d2,color:#000; + classDef c13 fill:#bcbd22,color:#fff; + classDef c14 fill:#dbdb8d,color:#000; + classDef c14a fill:#dbdb8d8a,color:#000; + classDef c15 fill:#17becf,color:#fff; + classDef c16 fill:#9edae5,color:#000; + + class s1,s5 c4 + class inf,t1,e0 c4a + class pomn,p00,p01,p06,p07,p02n position + class t1,t2,t5,e0,e1 position + + ``` + +=== "$End$ binding" + + ``` mermaid + block-beta + columns 8 + p0["0"] p1["1"] space:3 p5["5"] p6["n"] p7["n + 1"] + inf["⊥"] s1["A"] s2["C"] s3["T"] s4["C"] s5["A"] s6["G"] sup["⊥"] + space t1["End(1) = 5"]:5 space:2 + space:5 e0["End(5) = n+1"]:3 + + classDef imaginary fill:#526cfe09,color:#000,stroke-dasharray: 10 5; + classDef position fill:#fff,color:#000,stroke-width:0px; + class inf,sup imaginary + class p0,p1,p5,p6,p7 position + + classDef c1 fill:#ff7f0e,color:#fff; + classDef c2 fill:#ffbb78,color:#000; + classDef c2a fill:#ffbb788a,color:#000; + classDef c3 fill:#2ca02c,color:#fff; + classDef c4 fill:#98df8a,color:#000; + classDef c4a fill:#98df8a8a,color:#000; + classDef c5 fill:#d62728,color:#fff; + classDef c6 fill:#ff9896,color:#000; + classDef c6a fill:#ff98968a,color:#000; + classDef c7 fill:#9467bd,color:#fff; + classDef c8 fill:#c5b0d5,color:#000; + classDef c9 fill:#8c564b,color:#fff; + classDef c10 fill:#c49c94,color:#000; + classDef c11 fill:#e377c2,color:#fff; + classDef c12 fill:#f7b6d2,color:#000; + classDef c13 fill:#bcbd22,color:#fff; + classDef c14 fill:#dbdb8d,color:#000; + classDef c14a fill:#dbdb8d8a,color:#000; + classDef c15 fill:#17becf,color:#fff; + classDef c16 fill:#9edae5,color:#000; + + class s1,s5 c4 + class sup,t1,e0 c4a + class pomn,p00,p01,p06,p07,p02n position + class t1,t2,t5,e0,e1 position + + ``` diff --git a/docs/fundamentals/objects/intervals_order.md b/docs/fundamentals/objects/intervals_chain.md similarity index 70% rename from docs/fundamentals/objects/intervals_order.md rename to docs/fundamentals/objects/intervals_chain.md index f9fb9417..2afb3cd9 100644 --- a/docs/fundamentals/objects/intervals_order.md +++ b/docs/fundamentals/objects/intervals_chain.md @@ -1,24 +1,35 @@ -# Intervals Order +# Intervals Chain An _intervals order_ is an n-tuple of natural numbers that represents the distance between equal elements in a sequence. ## Mathematical Definition -Let $B = \{start, end\}$ is binding and $M = \{ terminate, cycle\}$ is mode; +Let $B = \{Start, End\}$ is [_Binding_](./binding.md#Mathematical Definition) -Let $J = \{1, ..., n\} \subset N$ +Let $M = \{Boundary, Cycle\}$ is [_Mode_](./mode.md#Mathematical Definition) -Define `follow` $F : B \times M \times J^n \longrightarrow (J)^n$ +Define -Define `traceble` $T : B \times M \times J^n \longrightarrow (\{True, False\})^n$ +$$Follow : B \times M \times \big\{ \{1,...,n\} \longrightarrow \{1,...,n\} \big\} \longrightarrow \big\{ \{1,...,n\} \longrightarrow \{0,...,n+1\} \big\}$$ -N-tuple of natual numbers $IO = \{ | \forall i \in J \exists o_i \in J \}$ +$$Traceble : B \times M \times \big\{ \{1,...,n\} \longrightarrow \{1,...,n\} \big\} \longrightarrow \big\{ \{1,...,n\} \longrightarrow \{0, 1\} \big\}$$ -are called `interval order` if and only if + + +N-tuple of natual numbers + +$$IO = \{ | \forall j \in \{1,...,n\} \exists io_j \in \{1,...,n\} \}$$ + +is called `Intervals chain` if and only if + +$$\exists (b, m) \in B \times M$$ + +that makes these statments true: + +1. Tracebility criteria - $\forall i \ Traceble(b, m)(IO)(i)$ +2. Chained criteria - $f=Follow(b,m)(IO),\ \forall i \forall j \ne i | f(i) \neq f(j) \lor f(i) \in \{0, n+1\}$ diff --git a/docs/fundamentals/objects/mode.md b/docs/fundamentals/objects/mode.md index fc5f1212..4211559f 100644 --- a/docs/fundamentals/objects/mode.md +++ b/docs/fundamentals/objects/mode.md @@ -1,23 +1,6 @@ # Mode -The _mode_ determines the method for computing intervals for the first or last appearances of the element. -There is uncertainty about how to count the interval for the first appearance with $start$ binding and -for the last appearance with $end$ binding, as there is no previous or following element appearance in the corresponding cases. - -This interval can be skipped or counted to some `imaginary` appearance of the element. - -The skipping option leads to cons that make reverse operation impossible in the general case - -count of intervals less than the count of elements in the initial sequence, -and/or intervals n-tuple contains `empty` elements. That's why the _mode_ does not have any value -corresponding to any kind of skip first/last interval. - -You can use `lossy` function defined in [Interval Order to Interval Tuple](./intervals_distribution.md) section to exclude the first/last interval that would be equivalent to the skipping approach. - -The _mode_ defines values that assume different ways of `imaginary` elements - $boundary$ and $cycle$. -The `imaginary` elements can be used as `previous` or `following` reference for any element of the sequence, -but do not produce any interval for their own. However, you can use `redundant` function defined in - -[Interval Order to Interval Tuple](./intervals_distribution.md) section to count intervals produced for `imaginary` elements. +The _mode_ determines the method for computing intervals between occurrences of equivalent elements. ## Boundary @@ -30,11 +13,11 @@ which are equal to any element of the sequence. `Infimum` element placed on $0$ block-beta columns 8 p0["0"] p1["1"] space:4 p6["n"] p7["n + 1"] - inf["Infimum"] s1["A"] s2["C"] s3["T"] s4["C"] s5["A"] s6["G"] sup["Supremum"] - infa["Infimum"] ia1["1"]:1 space:6 - infc["Infimum"] ic1["2"]:2 space:5 - inft["Infimum"] it1["3"]:3 space:4 - infg["Infimum"] ig1["6"]:6 space:1 + inf["⊥"] s1["A"] s2["C"] s3["T"] s4["C"] s5["A"] s6["G"] sup["⊥"] + infa["⊥"] ia1["1"]:1 space:6 + infc["⊥"] ic1["2"]:2 space:5 + inft["⊥"] it1["3"]:3 space:4 + infg["⊥"] ig1["6"]:6 space:1 classDef imaginary fill:#526cfe09,color:#000,stroke-dasharray: 10 5; classDef position fill:#fff,color:#000,stroke-width:0px; @@ -235,25 +218,79 @@ At the same time, the $boundary$ mode looks like related to tree structures and ## Mathematical Definition -Let $X$ is [_Carrier set_](./carrier_set.md#Mathematical Definition) +=== "Current" + + Let $X$ is [_Carrier set_](./carrier_set.md#Mathematical Definition) + + Let $S$ is [_Sequence_](./sequence.md#Mathematical Definition) length of $n$ described as function $S : \{1,...,n\} \longrightarrow X$ + + Let $B = \{Start, End\}$ is [_Binding_](./binding.md#Mathematical Definition) + + + Define + + Let $IO$ is n-tuple described as function $IO : \{1,...,n\} \longrightarrow \{1,...,n\}$ + + $$Mode : B \times \big\{ S \big\} \longrightarrow \big\{ IO \big\}, $$ + + $$if \ \exists \ Mode^{-1} : B \times \big\{ IO \big\} \longrightarrow \big\{\{1,...,n\} \longrightarrow \{1,...,m\}\big\}\ that$$ + + $$\forall i \in \{1,...,n\} \ m=Mode(b),\ m^{-1}=Mode(b)^{-1}, m(S)(i) = m(m^{-1}(m(S)))(i)$$ + + + $$Boundary(b, S)(i) = \big| i - b(S)(i) \big|$$ + + $$Boundary^{-1}(b, IO)(i) = \Bigg\{\begin{array}{l} b^{-1}(IO(i) - i)(i) & if \ exists \\ 0 & otherwise \end{array}$$ + + $$S_{cycled} : \big\{ \{1,...,n\} \longrightarrow X \big\} \longrightarrow \big\{ \{1,...,3 \times n\} \longrightarrow X \big\}$$ + + $$S_{cycled}(S)(i) = S\big( i - n \times \lfloor ( i - 1) \div n \rfloor \big)$$ + + $$Cycle(b, S)(i) = Boundary(b,\ S_{cycled}(S))(i+n)$$ + + + + Define _mode_ $M = \{ Boundary, Cycle \} \subset \{ Mode \}$ + + + +=== "New" + + Let $P$ is [_Interator positions_](./binding.md#Mathematical Definition) length of $n$ described as function $P : \{1,...,n\} \longrightarrow \{0,...,n+1\}$ + + Define + + + + $$Mode : \big\{ \{1,...,n\} \longrightarrow \{0,...,n+1\} \big\} \longrightarrow \big\{ \{1,...,n\} \longrightarrow \{1,...,n\} \big\}, $$ + + $$if \ \exists \ Mode^{-1} : \big\{ \{1,...,n\} \longrightarrow \{1,...,n\} \big\} \longrightarrow \big\{\{1,...,n\} \longrightarrow \{0,...,n+1\}\big\}\ that$$ + + $$\forall i \in \{1,...,n\} \ Mode(P)(i) = Mode(Mode^{-1}(Mode(P)))(i)$$ -Let $S$ is [_Sequence_](./sequence.md#Mathematical Definition) length of $n$ described as function $S : \{1,...,n\} \longrightarrow X$ -Define _mode_ $M = \{ boundary, cycle \}$ + $$Boundary(P)(i) = \big| i - P(i) \big|$$ -Define set $\bot = \{ Inf, Sup \ | \forall s \in X(s = Inf \land s = Sup) \}$ + $$Boundary^{-1}(IO)(i) = \Bigg\{\begin{array}{l} i - IO(i) & \ \exists \ j \in \{1,...,n\} | IO(j) = j \\ i + IO(i) & \ \exists \ j \in \{1,...,n\} | IO(j) = n + 1 - j \end{array}$$ -Define $X_\bot = X \cup \bot$ set + $$P_{cycled} : \big\{ \{1,...,n\} \longrightarrow \{0,...,n+1\} \big\} \longrightarrow \big\{ \{1,...,3 \times n\} \longrightarrow \{0,...,n+1\} \big\}$$ -$$\forall S \exists S_{boundary} : \{0,...,n+1\} \longrightarrow X_\bot \implies S_{boundary}(i) = \Biggl\{ \begin{array}{l} Inf, i=0 \\ S(i), 1 \le i \le n \\ Sup, i = n+1\end{array}$$ + $$P_{cycled}(S)(i) = \Bigg\{\begin{array}{l} P(i) &, \lfloor ( i - 1) \div n \rfloor = 0 \\ ??? &, \lfloor ( i - 1) \div n \rfloor = 1 \end{array}$$ + $$Cycle(b, S)(i) = Boundary(b,\ S_{cycled}(S))(i+n)$$ - + def index(x): + return x - (high - low + 1) * ((x - low) // (high - low + 1)) + ``` --> -$$\forall S \exists S_{cycle} : Z \longrightarrow X \implies S_{cycle}(i) = S\big( i - n \times \lfloor ( i - 1) \div n \rfloor \big)$$ + Define _mode_ $M = \{ Boundary, Cycle \} \subset \{ Mode \}$ diff --git a/docs/fundamentals/objects/mode/bounded.md b/docs/fundamentals/objects/mode/bounded.md new file mode 100644 index 00000000..7684e606 --- /dev/null +++ b/docs/fundamentals/objects/mode/bounded.md @@ -0,0 +1,269 @@ +# Mode + +The _mode_ determines the method for computing intervals for the first or last appearances of the element. +There is uncertainty about how to count the interval for the first appearance with $start$ binding and +for the last appearance with $end$ binding, as there is no previous or following element appearance in the corresponding cases. + +This interval can be skipped or counted to some `imaginary` appearance of the element. + +The skipping option leads to cons that make reverse operation impossible in the general case - +count of intervals less than the count of elements in the initial sequence, +and/or intervals n-tuple contains `empty` elements. That's why the _mode_ does not have any value +corresponding to any kind of skip first/last interval. + +You can use `lossy` function defined in [Interval Order to Interval Tuple](./intervals_distribution.md) section to exclude the first/last interval that would be equivalent to the skipping approach. + +The _mode_ defines values that assume different ways of `imaginary` elements - $boundary$ and $cycle$. +The `imaginary` elements can be used as `previous` or `following` reference for any element of the sequence, +but do not produce any interval for their own. However, you can use `redundant` function defined in + +[Interval Order to Interval Tuple](./intervals_distribution.md) section to count intervals produced for `imaginary` elements. + +## Boundary + +The $boundary$ mode extends the sequence with `imaginary` elements - `Infimum` ($Inf$) and `Supremum` ($Sup$ ), +which are equal to any element of the sequence. `Infimum` element placed on $0$ position and `Supremum` on $n+1$ position of the sequence. + +=== "$Start$ binding" + + ``` mermaid + block-beta + columns 8 + p0["0"] p1["1"] space:4 p6["n"] p7["n + 1"] + inf["⊥"] s1["A"] s2["C"] s3["T"] s4["C"] s5["A"] s6["G"] sup["⊥"] + infa["⊥"] ia1["1"]:1 space:6 + infc["⊥"] ic1["2"]:2 space:5 + inft["⊥"] it1["3"]:3 space:4 + infg["⊥"] ig1["6"]:6 space:1 + + classDef imaginary fill:#526cfe09,color:#000,stroke-dasharray: 10 5; + classDef position fill:#fff,color:#000,stroke-width:0px; + class inf,sup imaginary + class p0,p1,p6,p7 position + + classDef c1 fill:#ff7f0e,color:#fff; + classDef c2 fill:#ffbb78,color:#000; + classDef c2a fill:#ffbb788a,color:#000; + classDef c3 fill:#2ca02c,color:#fff; + classDef c4 fill:#98df8a,color:#000; + classDef c4a fill:#98df8a8a,color:#000; + classDef c5 fill:#d62728,color:#fff; + classDef c6 fill:#ff9896,color:#000; + classDef c6a fill:#ff98968a,color:#000; + classDef c7 fill:#9467bd,color:#fff; + classDef c8 fill:#c5b0d5,color:#000; + classDef c9 fill:#8c564b,color:#fff; + classDef c10 fill:#c49c94,color:#000; + classDef c11 fill:#e377c2,color:#fff; + classDef c12 fill:#f7b6d2,color:#000; + classDef c13 fill:#bcbd22,color:#fff; + classDef c14 fill:#dbdb8d,color:#000; + classDef c14a fill:#dbdb8d8a,color:#000; + classDef c15 fill:#17becf,color:#fff; + classDef c16 fill:#9edae5,color:#000; + + class s1,ia1 c2 + class infa c2a + class s2,ic1 c4 + class infc c4a + class s3,it1 c6 + class inft c6a + class s6,ig1 c14 + class infg c14a + class p1,p2,p3,p4,p5,p6,p7,p8,p9,f1,f2,f3,f4,f5,f6,f7,f8,f9 imaginary + class pomn,p00,p01,p06,p07,p02n position + + ``` + +=== "$End$ binding" + + ``` mermaid + block-beta + columns 8 + p0["0"] p1["1"] space:4 p6["n"] p7["n + 1"] + inf["Infimum"] s1["A"] s2["C"] s3["T"] s4["C"] s5["A"] s6["G"] sup["Supremum"] + space:5 ia1["2"]:2 supa["Supremum"] + space:4 ic1["3"]:3 supc["Supremum"] + space:3 it1["4"]:4 supt["Supremum"] + space:6 ig1["1"]:1 supg["Supremum"] + + classDef imaginary fill:#526cfe09,color:#000,stroke-dasharray: 10 5; + classDef position fill:#fff,color:#000,stroke-width:0px; + class inf,sup imaginary + class p0,p1,p6,p7 position + + classDef c1 fill:#ff7f0e,color:#fff; + classDef c2 fill:#ffbb78,color:#000; + classDef c2a fill:#ffbb788a,color:#000; + classDef c3 fill:#2ca02c,color:#fff; + classDef c4 fill:#98df8a,color:#000; + classDef c4a fill:#98df8a8a,color:#000; + classDef c5 fill:#d62728,color:#fff; + classDef c6 fill:#ff9896,color:#000; + classDef c6a fill:#ff98968a,color:#000; + classDef c7 fill:#9467bd,color:#fff; + classDef c8 fill:#c5b0d5,color:#000; + classDef c9 fill:#8c564b,color:#fff; + classDef c10 fill:#c49c94,color:#000; + classDef c11 fill:#e377c2,color:#fff; + classDef c12 fill:#f7b6d2,color:#000; + classDef c13 fill:#bcbd22,color:#fff; + classDef c14 fill:#dbdb8d,color:#000; + classDef c14a fill:#dbdb8d8a,color:#000; + classDef c15 fill:#17becf,color:#fff; + classDef c16 fill:#9edae5,color:#000; + + class s5,ia1 c2 + class supa c2a + class s4,ic1 c4 + class supc c4a + class s3,it1 c6 + class supt c6a + class s6,ig1 c14 + class supg c14a + class p1,p2,p3,p4,p5,p6,p7,p8,p9,f1,f2,f3,f4,f5,f6,f7,f8,f9 imaginary + class pomn,p00,p01,p06,p07,p02n position + ``` + + +## Cycle + +In the $cycle$ mode, the sequence is extended by copying itself as an `imaginary` prefix/suffix to mock a cycled sequence (also known as a periodic sequence or an orbit). The first/last interval counts to the previous/following element in `imaginary` prefix/suffix. + + +=== "$Start$ binding" + + ``` mermaid + block-beta + columns 18 + pomn["-n"] space:4 p00["0"] p01["1"] space:4 p06["n"] p07["n + 1"] space:4 p02n["n + n"] + p1["A"] p2["C"] p3["T"] p4["C"] p5["A"] p6["G"] s1["A"] s2["C"] s3["T"] s4["C"] s5["A"] s6["G"] f1["A"] f2["C"] f3["T"] f4["C"] f5["A"] f6["G"] + space:5 ia1["2"]:2 space:11 + space:4 ic1["4"]:4 space:10 + space:3 it1["6"]:6 space:9 + space:6 ig1["6"]:6 space:6 + + classDef imaginary fill:#526cfe09,color:#000,stroke-dasharray: 10 5; + classDef position fill:#fff,color:#000,stroke-width:0px; + + classDef c1 fill:#ff7f0e,color:#fff; + classDef c2 fill:#ffbb78,color:#000; + classDef c2a fill:#ffbb788a,color:#000; + classDef c3 fill:#2ca02c,color:#fff; + classDef c4 fill:#98df8a,color:#000; + classDef c4a fill:#98df8a8a,color:#000; + classDef c5 fill:#d62728,color:#fff; + classDef c6 fill:#ff9896,color:#000; + classDef c6a fill:#ff98968a,color:#000; + classDef c7 fill:#9467bd,color:#fff; + classDef c8 fill:#c5b0d5,color:#000; + classDef c9 fill:#8c564b,color:#fff; + classDef c10 fill:#c49c94,color:#000; + classDef c11 fill:#e377c2,color:#fff; + classDef c12 fill:#f7b6d2,color:#000; + classDef c13 fill:#bcbd22,color:#fff; + classDef c14 fill:#dbdb8d,color:#000; + classDef c14a fill:#dbdb8d8a,color:#000; + classDef c15 fill:#17becf,color:#fff; + classDef c16 fill:#9edae5,color:#000; + + class s1,ia1 c2 + class p5 c2a + class s2,ic1 c4 + class p4 c4a + class s3,it1 c6 + class p3 c6a + class s6,ig1 c14 + class p6 c14a + class p1,p2,p3,p4,p5,p6,p7,p8,p9,f1,f2,f3,f4,f5,f6,f7,f8,f9 imaginary + class pomn,p00,p01,p06,p07,p02n position + + ``` + +=== "$End$ binding" + + ``` mermaid + block-beta + columns 18 + pomn["-n"] space:4 p00["0"] p01["1"] space:4 p06["n"] p07["n + 1"] space:4 p02n["n + n"] + p1["A"] p2["C"] p3["T"] p4["C"] p5["A"] p6["G"] s1["A"] s2["C"] s3["T"] s4["C"] s5["A"] s6["G"] f1["A"] f2["C"] f3["T"] f4["C"] f5["A"] f6["G"] + space:10 ia1["2"]:2 space:6 + space:9 ic1["4"]:4 space:5 + space:8 it1["6"]:6 space:5 + space:10 ig1["6"]:6 space:1 + + classDef imaginary fill:#526cfe09,color:#000,stroke-dasharray: 10 5; + classDef position fill:#fff,color:#000,stroke-width:0px; + + classDef c1 fill:#ff7f0e,color:#fff; + classDef c2 fill:#ffbb78,color:#000; + classDef c2a fill:#ffbb788a,color:#000; + classDef c3 fill:#2ca02c,color:#fff; + classDef c4 fill:#98df8a,color:#000; + classDef c4a fill:#98df8a8a,color:#000; + classDef c5 fill:#d62728,color:#fff; + classDef c6 fill:#ff9896,color:#000; + classDef c6a fill:#ff98968a,color:#000; + classDef c7 fill:#9467bd,color:#fff; + classDef c8 fill:#c5b0d5,color:#000; + classDef c9 fill:#8c564b,color:#fff; + classDef c10 fill:#c49c94,color:#000; + classDef c11 fill:#e377c2,color:#fff; + classDef c12 fill:#f7b6d2,color:#000; + classDef c13 fill:#bcbd22,color:#fff; + classDef c14 fill:#dbdb8d,color:#000; + classDef c14a fill:#dbdb8d8a,color:#000; + classDef c15 fill:#17becf,color:#fff; + classDef c16 fill:#9edae5,color:#000; + + class s5,ia1 c2 + class f1 c2a + class s4,ic1 c4 + class f2 c4a + class s3,it1 c6 + class f3 c6a + class s6,ig1 c14 + class f6 c14a + class p1,p2,p3,p4,p5,p6,p7,p8,p9,f1,f2,f3,f4,f5,f6,f7,f8,f9 imaginary + class pomn,p00,p01,p06,p07,p02n position + + ``` + +The $cycle$ mode is inspired and aligned with the idea of representativeness heuristic, which is fundamental in probability and statistics, and the Necklace problems in combinatorics. + +At the same time, the $boundary$ mode looks like related to tree structures and graph theory. + +## Mathematical Definition + +Let $X$ is [_Carrier set_](./carrier_set.md#Mathematical Definition) + +Let $S$ is [_Sequence_](./sequence.md#Mathematical Definition) length of $n$ described as function $S : \{1,...,n\} \longrightarrow X$ + +Let $\bot \notin X$ is a special _sentinel_ value. + +Define $X_\bot = X \cup \{ \bot \}$ set + +$\forall S \ \exists \ S_{\bot} : J \longrightarrow X_{\bot} \Big| \{1,...,n\} \subset J$ + +Define $Mode : S \longrightarrow S_{\bot}$ + +$\forall S \exists S_{boundary} : \{0,...,n+1\} \longrightarrow X_\bot$ + +Define $boundary : S \longrightarrow S_{boundary}, boundary(s)(i) = \Biggl\{ \begin{array}{l} Inf, i=0 \\ s(i), 1 \le i \le n \\ Sup, i = n+1\end{array}$ + + +$\forall S \exists S_{cycle} : Z \longrightarrow X_\bot$ + + + + + +Define $cycle : S \longrightarrow S_{cycle}, cycle(s)(i) = s\big( i - n \times \lfloor ( i - 1) \div n \rfloor \big) \Big| n = |s|$ + +Define _mode_ $M = \{ boundary, cycle \}$ diff --git a/docs/fundamentals/objects/mode/cycle.md b/docs/fundamentals/objects/mode/cycle.md new file mode 100644 index 00000000..7684e606 --- /dev/null +++ b/docs/fundamentals/objects/mode/cycle.md @@ -0,0 +1,269 @@ +# Mode + +The _mode_ determines the method for computing intervals for the first or last appearances of the element. +There is uncertainty about how to count the interval for the first appearance with $start$ binding and +for the last appearance with $end$ binding, as there is no previous or following element appearance in the corresponding cases. + +This interval can be skipped or counted to some `imaginary` appearance of the element. + +The skipping option leads to cons that make reverse operation impossible in the general case - +count of intervals less than the count of elements in the initial sequence, +and/or intervals n-tuple contains `empty` elements. That's why the _mode_ does not have any value +corresponding to any kind of skip first/last interval. + +You can use `lossy` function defined in [Interval Order to Interval Tuple](./intervals_distribution.md) section to exclude the first/last interval that would be equivalent to the skipping approach. + +The _mode_ defines values that assume different ways of `imaginary` elements - $boundary$ and $cycle$. +The `imaginary` elements can be used as `previous` or `following` reference for any element of the sequence, +but do not produce any interval for their own. However, you can use `redundant` function defined in + +[Interval Order to Interval Tuple](./intervals_distribution.md) section to count intervals produced for `imaginary` elements. + +## Boundary + +The $boundary$ mode extends the sequence with `imaginary` elements - `Infimum` ($Inf$) and `Supremum` ($Sup$ ), +which are equal to any element of the sequence. `Infimum` element placed on $0$ position and `Supremum` on $n+1$ position of the sequence. + +=== "$Start$ binding" + + ``` mermaid + block-beta + columns 8 + p0["0"] p1["1"] space:4 p6["n"] p7["n + 1"] + inf["⊥"] s1["A"] s2["C"] s3["T"] s4["C"] s5["A"] s6["G"] sup["⊥"] + infa["⊥"] ia1["1"]:1 space:6 + infc["⊥"] ic1["2"]:2 space:5 + inft["⊥"] it1["3"]:3 space:4 + infg["⊥"] ig1["6"]:6 space:1 + + classDef imaginary fill:#526cfe09,color:#000,stroke-dasharray: 10 5; + classDef position fill:#fff,color:#000,stroke-width:0px; + class inf,sup imaginary + class p0,p1,p6,p7 position + + classDef c1 fill:#ff7f0e,color:#fff; + classDef c2 fill:#ffbb78,color:#000; + classDef c2a fill:#ffbb788a,color:#000; + classDef c3 fill:#2ca02c,color:#fff; + classDef c4 fill:#98df8a,color:#000; + classDef c4a fill:#98df8a8a,color:#000; + classDef c5 fill:#d62728,color:#fff; + classDef c6 fill:#ff9896,color:#000; + classDef c6a fill:#ff98968a,color:#000; + classDef c7 fill:#9467bd,color:#fff; + classDef c8 fill:#c5b0d5,color:#000; + classDef c9 fill:#8c564b,color:#fff; + classDef c10 fill:#c49c94,color:#000; + classDef c11 fill:#e377c2,color:#fff; + classDef c12 fill:#f7b6d2,color:#000; + classDef c13 fill:#bcbd22,color:#fff; + classDef c14 fill:#dbdb8d,color:#000; + classDef c14a fill:#dbdb8d8a,color:#000; + classDef c15 fill:#17becf,color:#fff; + classDef c16 fill:#9edae5,color:#000; + + class s1,ia1 c2 + class infa c2a + class s2,ic1 c4 + class infc c4a + class s3,it1 c6 + class inft c6a + class s6,ig1 c14 + class infg c14a + class p1,p2,p3,p4,p5,p6,p7,p8,p9,f1,f2,f3,f4,f5,f6,f7,f8,f9 imaginary + class pomn,p00,p01,p06,p07,p02n position + + ``` + +=== "$End$ binding" + + ``` mermaid + block-beta + columns 8 + p0["0"] p1["1"] space:4 p6["n"] p7["n + 1"] + inf["Infimum"] s1["A"] s2["C"] s3["T"] s4["C"] s5["A"] s6["G"] sup["Supremum"] + space:5 ia1["2"]:2 supa["Supremum"] + space:4 ic1["3"]:3 supc["Supremum"] + space:3 it1["4"]:4 supt["Supremum"] + space:6 ig1["1"]:1 supg["Supremum"] + + classDef imaginary fill:#526cfe09,color:#000,stroke-dasharray: 10 5; + classDef position fill:#fff,color:#000,stroke-width:0px; + class inf,sup imaginary + class p0,p1,p6,p7 position + + classDef c1 fill:#ff7f0e,color:#fff; + classDef c2 fill:#ffbb78,color:#000; + classDef c2a fill:#ffbb788a,color:#000; + classDef c3 fill:#2ca02c,color:#fff; + classDef c4 fill:#98df8a,color:#000; + classDef c4a fill:#98df8a8a,color:#000; + classDef c5 fill:#d62728,color:#fff; + classDef c6 fill:#ff9896,color:#000; + classDef c6a fill:#ff98968a,color:#000; + classDef c7 fill:#9467bd,color:#fff; + classDef c8 fill:#c5b0d5,color:#000; + classDef c9 fill:#8c564b,color:#fff; + classDef c10 fill:#c49c94,color:#000; + classDef c11 fill:#e377c2,color:#fff; + classDef c12 fill:#f7b6d2,color:#000; + classDef c13 fill:#bcbd22,color:#fff; + classDef c14 fill:#dbdb8d,color:#000; + classDef c14a fill:#dbdb8d8a,color:#000; + classDef c15 fill:#17becf,color:#fff; + classDef c16 fill:#9edae5,color:#000; + + class s5,ia1 c2 + class supa c2a + class s4,ic1 c4 + class supc c4a + class s3,it1 c6 + class supt c6a + class s6,ig1 c14 + class supg c14a + class p1,p2,p3,p4,p5,p6,p7,p8,p9,f1,f2,f3,f4,f5,f6,f7,f8,f9 imaginary + class pomn,p00,p01,p06,p07,p02n position + ``` + + +## Cycle + +In the $cycle$ mode, the sequence is extended by copying itself as an `imaginary` prefix/suffix to mock a cycled sequence (also known as a periodic sequence or an orbit). The first/last interval counts to the previous/following element in `imaginary` prefix/suffix. + + +=== "$Start$ binding" + + ``` mermaid + block-beta + columns 18 + pomn["-n"] space:4 p00["0"] p01["1"] space:4 p06["n"] p07["n + 1"] space:4 p02n["n + n"] + p1["A"] p2["C"] p3["T"] p4["C"] p5["A"] p6["G"] s1["A"] s2["C"] s3["T"] s4["C"] s5["A"] s6["G"] f1["A"] f2["C"] f3["T"] f4["C"] f5["A"] f6["G"] + space:5 ia1["2"]:2 space:11 + space:4 ic1["4"]:4 space:10 + space:3 it1["6"]:6 space:9 + space:6 ig1["6"]:6 space:6 + + classDef imaginary fill:#526cfe09,color:#000,stroke-dasharray: 10 5; + classDef position fill:#fff,color:#000,stroke-width:0px; + + classDef c1 fill:#ff7f0e,color:#fff; + classDef c2 fill:#ffbb78,color:#000; + classDef c2a fill:#ffbb788a,color:#000; + classDef c3 fill:#2ca02c,color:#fff; + classDef c4 fill:#98df8a,color:#000; + classDef c4a fill:#98df8a8a,color:#000; + classDef c5 fill:#d62728,color:#fff; + classDef c6 fill:#ff9896,color:#000; + classDef c6a fill:#ff98968a,color:#000; + classDef c7 fill:#9467bd,color:#fff; + classDef c8 fill:#c5b0d5,color:#000; + classDef c9 fill:#8c564b,color:#fff; + classDef c10 fill:#c49c94,color:#000; + classDef c11 fill:#e377c2,color:#fff; + classDef c12 fill:#f7b6d2,color:#000; + classDef c13 fill:#bcbd22,color:#fff; + classDef c14 fill:#dbdb8d,color:#000; + classDef c14a fill:#dbdb8d8a,color:#000; + classDef c15 fill:#17becf,color:#fff; + classDef c16 fill:#9edae5,color:#000; + + class s1,ia1 c2 + class p5 c2a + class s2,ic1 c4 + class p4 c4a + class s3,it1 c6 + class p3 c6a + class s6,ig1 c14 + class p6 c14a + class p1,p2,p3,p4,p5,p6,p7,p8,p9,f1,f2,f3,f4,f5,f6,f7,f8,f9 imaginary + class pomn,p00,p01,p06,p07,p02n position + + ``` + +=== "$End$ binding" + + ``` mermaid + block-beta + columns 18 + pomn["-n"] space:4 p00["0"] p01["1"] space:4 p06["n"] p07["n + 1"] space:4 p02n["n + n"] + p1["A"] p2["C"] p3["T"] p4["C"] p5["A"] p6["G"] s1["A"] s2["C"] s3["T"] s4["C"] s5["A"] s6["G"] f1["A"] f2["C"] f3["T"] f4["C"] f5["A"] f6["G"] + space:10 ia1["2"]:2 space:6 + space:9 ic1["4"]:4 space:5 + space:8 it1["6"]:6 space:5 + space:10 ig1["6"]:6 space:1 + + classDef imaginary fill:#526cfe09,color:#000,stroke-dasharray: 10 5; + classDef position fill:#fff,color:#000,stroke-width:0px; + + classDef c1 fill:#ff7f0e,color:#fff; + classDef c2 fill:#ffbb78,color:#000; + classDef c2a fill:#ffbb788a,color:#000; + classDef c3 fill:#2ca02c,color:#fff; + classDef c4 fill:#98df8a,color:#000; + classDef c4a fill:#98df8a8a,color:#000; + classDef c5 fill:#d62728,color:#fff; + classDef c6 fill:#ff9896,color:#000; + classDef c6a fill:#ff98968a,color:#000; + classDef c7 fill:#9467bd,color:#fff; + classDef c8 fill:#c5b0d5,color:#000; + classDef c9 fill:#8c564b,color:#fff; + classDef c10 fill:#c49c94,color:#000; + classDef c11 fill:#e377c2,color:#fff; + classDef c12 fill:#f7b6d2,color:#000; + classDef c13 fill:#bcbd22,color:#fff; + classDef c14 fill:#dbdb8d,color:#000; + classDef c14a fill:#dbdb8d8a,color:#000; + classDef c15 fill:#17becf,color:#fff; + classDef c16 fill:#9edae5,color:#000; + + class s5,ia1 c2 + class f1 c2a + class s4,ic1 c4 + class f2 c4a + class s3,it1 c6 + class f3 c6a + class s6,ig1 c14 + class f6 c14a + class p1,p2,p3,p4,p5,p6,p7,p8,p9,f1,f2,f3,f4,f5,f6,f7,f8,f9 imaginary + class pomn,p00,p01,p06,p07,p02n position + + ``` + +The $cycle$ mode is inspired and aligned with the idea of representativeness heuristic, which is fundamental in probability and statistics, and the Necklace problems in combinatorics. + +At the same time, the $boundary$ mode looks like related to tree structures and graph theory. + +## Mathematical Definition + +Let $X$ is [_Carrier set_](./carrier_set.md#Mathematical Definition) + +Let $S$ is [_Sequence_](./sequence.md#Mathematical Definition) length of $n$ described as function $S : \{1,...,n\} \longrightarrow X$ + +Let $\bot \notin X$ is a special _sentinel_ value. + +Define $X_\bot = X \cup \{ \bot \}$ set + +$\forall S \ \exists \ S_{\bot} : J \longrightarrow X_{\bot} \Big| \{1,...,n\} \subset J$ + +Define $Mode : S \longrightarrow S_{\bot}$ + +$\forall S \exists S_{boundary} : \{0,...,n+1\} \longrightarrow X_\bot$ + +Define $boundary : S \longrightarrow S_{boundary}, boundary(s)(i) = \Biggl\{ \begin{array}{l} Inf, i=0 \\ s(i), 1 \le i \le n \\ Sup, i = n+1\end{array}$ + + +$\forall S \exists S_{cycle} : Z \longrightarrow X_\bot$ + + + + + +Define $cycle : S \longrightarrow S_{cycle}, cycle(s)(i) = s\big( i - n \times \lfloor ( i - 1) \div n \rfloor \big) \Big| n = |s|$ + +Define _mode_ $M = \{ boundary, cycle \}$ diff --git a/docs/fundamentals/objects/mode/index.md b/docs/fundamentals/objects/mode/index.md new file mode 100644 index 00000000..7684e606 --- /dev/null +++ b/docs/fundamentals/objects/mode/index.md @@ -0,0 +1,269 @@ +# Mode + +The _mode_ determines the method for computing intervals for the first or last appearances of the element. +There is uncertainty about how to count the interval for the first appearance with $start$ binding and +for the last appearance with $end$ binding, as there is no previous or following element appearance in the corresponding cases. + +This interval can be skipped or counted to some `imaginary` appearance of the element. + +The skipping option leads to cons that make reverse operation impossible in the general case - +count of intervals less than the count of elements in the initial sequence, +and/or intervals n-tuple contains `empty` elements. That's why the _mode_ does not have any value +corresponding to any kind of skip first/last interval. + +You can use `lossy` function defined in [Interval Order to Interval Tuple](./intervals_distribution.md) section to exclude the first/last interval that would be equivalent to the skipping approach. + +The _mode_ defines values that assume different ways of `imaginary` elements - $boundary$ and $cycle$. +The `imaginary` elements can be used as `previous` or `following` reference for any element of the sequence, +but do not produce any interval for their own. However, you can use `redundant` function defined in + +[Interval Order to Interval Tuple](./intervals_distribution.md) section to count intervals produced for `imaginary` elements. + +## Boundary + +The $boundary$ mode extends the sequence with `imaginary` elements - `Infimum` ($Inf$) and `Supremum` ($Sup$ ), +which are equal to any element of the sequence. `Infimum` element placed on $0$ position and `Supremum` on $n+1$ position of the sequence. + +=== "$Start$ binding" + + ``` mermaid + block-beta + columns 8 + p0["0"] p1["1"] space:4 p6["n"] p7["n + 1"] + inf["⊥"] s1["A"] s2["C"] s3["T"] s4["C"] s5["A"] s6["G"] sup["⊥"] + infa["⊥"] ia1["1"]:1 space:6 + infc["⊥"] ic1["2"]:2 space:5 + inft["⊥"] it1["3"]:3 space:4 + infg["⊥"] ig1["6"]:6 space:1 + + classDef imaginary fill:#526cfe09,color:#000,stroke-dasharray: 10 5; + classDef position fill:#fff,color:#000,stroke-width:0px; + class inf,sup imaginary + class p0,p1,p6,p7 position + + classDef c1 fill:#ff7f0e,color:#fff; + classDef c2 fill:#ffbb78,color:#000; + classDef c2a fill:#ffbb788a,color:#000; + classDef c3 fill:#2ca02c,color:#fff; + classDef c4 fill:#98df8a,color:#000; + classDef c4a fill:#98df8a8a,color:#000; + classDef c5 fill:#d62728,color:#fff; + classDef c6 fill:#ff9896,color:#000; + classDef c6a fill:#ff98968a,color:#000; + classDef c7 fill:#9467bd,color:#fff; + classDef c8 fill:#c5b0d5,color:#000; + classDef c9 fill:#8c564b,color:#fff; + classDef c10 fill:#c49c94,color:#000; + classDef c11 fill:#e377c2,color:#fff; + classDef c12 fill:#f7b6d2,color:#000; + classDef c13 fill:#bcbd22,color:#fff; + classDef c14 fill:#dbdb8d,color:#000; + classDef c14a fill:#dbdb8d8a,color:#000; + classDef c15 fill:#17becf,color:#fff; + classDef c16 fill:#9edae5,color:#000; + + class s1,ia1 c2 + class infa c2a + class s2,ic1 c4 + class infc c4a + class s3,it1 c6 + class inft c6a + class s6,ig1 c14 + class infg c14a + class p1,p2,p3,p4,p5,p6,p7,p8,p9,f1,f2,f3,f4,f5,f6,f7,f8,f9 imaginary + class pomn,p00,p01,p06,p07,p02n position + + ``` + +=== "$End$ binding" + + ``` mermaid + block-beta + columns 8 + p0["0"] p1["1"] space:4 p6["n"] p7["n + 1"] + inf["Infimum"] s1["A"] s2["C"] s3["T"] s4["C"] s5["A"] s6["G"] sup["Supremum"] + space:5 ia1["2"]:2 supa["Supremum"] + space:4 ic1["3"]:3 supc["Supremum"] + space:3 it1["4"]:4 supt["Supremum"] + space:6 ig1["1"]:1 supg["Supremum"] + + classDef imaginary fill:#526cfe09,color:#000,stroke-dasharray: 10 5; + classDef position fill:#fff,color:#000,stroke-width:0px; + class inf,sup imaginary + class p0,p1,p6,p7 position + + classDef c1 fill:#ff7f0e,color:#fff; + classDef c2 fill:#ffbb78,color:#000; + classDef c2a fill:#ffbb788a,color:#000; + classDef c3 fill:#2ca02c,color:#fff; + classDef c4 fill:#98df8a,color:#000; + classDef c4a fill:#98df8a8a,color:#000; + classDef c5 fill:#d62728,color:#fff; + classDef c6 fill:#ff9896,color:#000; + classDef c6a fill:#ff98968a,color:#000; + classDef c7 fill:#9467bd,color:#fff; + classDef c8 fill:#c5b0d5,color:#000; + classDef c9 fill:#8c564b,color:#fff; + classDef c10 fill:#c49c94,color:#000; + classDef c11 fill:#e377c2,color:#fff; + classDef c12 fill:#f7b6d2,color:#000; + classDef c13 fill:#bcbd22,color:#fff; + classDef c14 fill:#dbdb8d,color:#000; + classDef c14a fill:#dbdb8d8a,color:#000; + classDef c15 fill:#17becf,color:#fff; + classDef c16 fill:#9edae5,color:#000; + + class s5,ia1 c2 + class supa c2a + class s4,ic1 c4 + class supc c4a + class s3,it1 c6 + class supt c6a + class s6,ig1 c14 + class supg c14a + class p1,p2,p3,p4,p5,p6,p7,p8,p9,f1,f2,f3,f4,f5,f6,f7,f8,f9 imaginary + class pomn,p00,p01,p06,p07,p02n position + ``` + + +## Cycle + +In the $cycle$ mode, the sequence is extended by copying itself as an `imaginary` prefix/suffix to mock a cycled sequence (also known as a periodic sequence or an orbit). The first/last interval counts to the previous/following element in `imaginary` prefix/suffix. + + +=== "$Start$ binding" + + ``` mermaid + block-beta + columns 18 + pomn["-n"] space:4 p00["0"] p01["1"] space:4 p06["n"] p07["n + 1"] space:4 p02n["n + n"] + p1["A"] p2["C"] p3["T"] p4["C"] p5["A"] p6["G"] s1["A"] s2["C"] s3["T"] s4["C"] s5["A"] s6["G"] f1["A"] f2["C"] f3["T"] f4["C"] f5["A"] f6["G"] + space:5 ia1["2"]:2 space:11 + space:4 ic1["4"]:4 space:10 + space:3 it1["6"]:6 space:9 + space:6 ig1["6"]:6 space:6 + + classDef imaginary fill:#526cfe09,color:#000,stroke-dasharray: 10 5; + classDef position fill:#fff,color:#000,stroke-width:0px; + + classDef c1 fill:#ff7f0e,color:#fff; + classDef c2 fill:#ffbb78,color:#000; + classDef c2a fill:#ffbb788a,color:#000; + classDef c3 fill:#2ca02c,color:#fff; + classDef c4 fill:#98df8a,color:#000; + classDef c4a fill:#98df8a8a,color:#000; + classDef c5 fill:#d62728,color:#fff; + classDef c6 fill:#ff9896,color:#000; + classDef c6a fill:#ff98968a,color:#000; + classDef c7 fill:#9467bd,color:#fff; + classDef c8 fill:#c5b0d5,color:#000; + classDef c9 fill:#8c564b,color:#fff; + classDef c10 fill:#c49c94,color:#000; + classDef c11 fill:#e377c2,color:#fff; + classDef c12 fill:#f7b6d2,color:#000; + classDef c13 fill:#bcbd22,color:#fff; + classDef c14 fill:#dbdb8d,color:#000; + classDef c14a fill:#dbdb8d8a,color:#000; + classDef c15 fill:#17becf,color:#fff; + classDef c16 fill:#9edae5,color:#000; + + class s1,ia1 c2 + class p5 c2a + class s2,ic1 c4 + class p4 c4a + class s3,it1 c6 + class p3 c6a + class s6,ig1 c14 + class p6 c14a + class p1,p2,p3,p4,p5,p6,p7,p8,p9,f1,f2,f3,f4,f5,f6,f7,f8,f9 imaginary + class pomn,p00,p01,p06,p07,p02n position + + ``` + +=== "$End$ binding" + + ``` mermaid + block-beta + columns 18 + pomn["-n"] space:4 p00["0"] p01["1"] space:4 p06["n"] p07["n + 1"] space:4 p02n["n + n"] + p1["A"] p2["C"] p3["T"] p4["C"] p5["A"] p6["G"] s1["A"] s2["C"] s3["T"] s4["C"] s5["A"] s6["G"] f1["A"] f2["C"] f3["T"] f4["C"] f5["A"] f6["G"] + space:10 ia1["2"]:2 space:6 + space:9 ic1["4"]:4 space:5 + space:8 it1["6"]:6 space:5 + space:10 ig1["6"]:6 space:1 + + classDef imaginary fill:#526cfe09,color:#000,stroke-dasharray: 10 5; + classDef position fill:#fff,color:#000,stroke-width:0px; + + classDef c1 fill:#ff7f0e,color:#fff; + classDef c2 fill:#ffbb78,color:#000; + classDef c2a fill:#ffbb788a,color:#000; + classDef c3 fill:#2ca02c,color:#fff; + classDef c4 fill:#98df8a,color:#000; + classDef c4a fill:#98df8a8a,color:#000; + classDef c5 fill:#d62728,color:#fff; + classDef c6 fill:#ff9896,color:#000; + classDef c6a fill:#ff98968a,color:#000; + classDef c7 fill:#9467bd,color:#fff; + classDef c8 fill:#c5b0d5,color:#000; + classDef c9 fill:#8c564b,color:#fff; + classDef c10 fill:#c49c94,color:#000; + classDef c11 fill:#e377c2,color:#fff; + classDef c12 fill:#f7b6d2,color:#000; + classDef c13 fill:#bcbd22,color:#fff; + classDef c14 fill:#dbdb8d,color:#000; + classDef c14a fill:#dbdb8d8a,color:#000; + classDef c15 fill:#17becf,color:#fff; + classDef c16 fill:#9edae5,color:#000; + + class s5,ia1 c2 + class f1 c2a + class s4,ic1 c4 + class f2 c4a + class s3,it1 c6 + class f3 c6a + class s6,ig1 c14 + class f6 c14a + class p1,p2,p3,p4,p5,p6,p7,p8,p9,f1,f2,f3,f4,f5,f6,f7,f8,f9 imaginary + class pomn,p00,p01,p06,p07,p02n position + + ``` + +The $cycle$ mode is inspired and aligned with the idea of representativeness heuristic, which is fundamental in probability and statistics, and the Necklace problems in combinatorics. + +At the same time, the $boundary$ mode looks like related to tree structures and graph theory. + +## Mathematical Definition + +Let $X$ is [_Carrier set_](./carrier_set.md#Mathematical Definition) + +Let $S$ is [_Sequence_](./sequence.md#Mathematical Definition) length of $n$ described as function $S : \{1,...,n\} \longrightarrow X$ + +Let $\bot \notin X$ is a special _sentinel_ value. + +Define $X_\bot = X \cup \{ \bot \}$ set + +$\forall S \ \exists \ S_{\bot} : J \longrightarrow X_{\bot} \Big| \{1,...,n\} \subset J$ + +Define $Mode : S \longrightarrow S_{\bot}$ + +$\forall S \exists S_{boundary} : \{0,...,n+1\} \longrightarrow X_\bot$ + +Define $boundary : S \longrightarrow S_{boundary}, boundary(s)(i) = \Biggl\{ \begin{array}{l} Inf, i=0 \\ s(i), 1 \le i \le n \\ Sup, i = n+1\end{array}$ + + +$\forall S \exists S_{cycle} : Z \longrightarrow X_\bot$ + + + + + +Define $cycle : S \longrightarrow S_{cycle}, cycle(s)(i) = s\big( i - n \times \lfloor ( i - 1) \div n \rfloor \big) \Big| n = |s|$ + +Define _mode_ $M = \{ boundary, cycle \}$ diff --git a/docs/fundamentals/objects/sequence.md b/docs/fundamentals/objects/sequence.md index 8f65b0e3..1451d50d 100644 --- a/docs/fundamentals/objects/sequence.md +++ b/docs/fundamentals/objects/sequence.md @@ -18,6 +18,12 @@ where: - $s_i$​ is called the $i$-th _element_ (or coordinate) of the sequence. - $n := |S|$ is _length_, $n \in N$ +The _sequence_ $S$ can be also defined as a function + +$$S : \{1, ..., n\} \longrightarrow X,$$ + +$$S(i)=s_i | i \in \{1, ..., n\}$$ + ## Examples ### Binary Sequence diff --git a/mkdocs.yml b/mkdocs.yml index 724318ad..6d98fc6a 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -20,7 +20,7 @@ nav: - "Interval": fundamentals/objects/interval.md - "Binding": fundamentals/objects/binding.md - "Mode": fundamentals/objects/mode.md - - "Intervals Order": fundamentals/objects/intervals_order.md + - "Intervals Chain": fundamentals/objects/intervals_chain.md - "Intervals Tuple": fundamentals/objects/intervals_tuple.md - "Intervals Distribution": fundamentals/objects/intervals_distribution.md - "Congeneric decomposition": From 769bc6a325006a851221b0cdcc7282d28f067618 Mon Sep 17 00:00:00 2001 From: Igor Rodionov Date: Fri, 4 Jul 2025 19:55:00 +0200 Subject: [PATCH 24/35] Added fundamentals --- docs/fundamentals/objects/binding.md | 46 +++++- docs/fundamentals/objects/index.md | 39 ++++- .../{intervals_tuple.md => intervals.md} | 0 .../boundary.md} | 2 +- .../objects/intervals_chained/cycled.md | 131 ++++++++++++++++ .../objects/intervals_chained/index.md | 148 ++++++++++++++++++ docs/fundamentals/objects/references.md | 126 +++++++++++++++ mkdocs.yml | 10 +- 8 files changed, 490 insertions(+), 12 deletions(-) rename docs/fundamentals/objects/{intervals_tuple.md => intervals.md} (100%) rename docs/fundamentals/objects/{intervals_chain.md => intervals_chained/boundary.md} (99%) create mode 100644 docs/fundamentals/objects/intervals_chained/cycled.md create mode 100644 docs/fundamentals/objects/intervals_chained/index.md create mode 100644 docs/fundamentals/objects/references.md diff --git a/docs/fundamentals/objects/binding.md b/docs/fundamentals/objects/binding.md index ced68d9c..d9145c53 100644 --- a/docs/fundamentals/objects/binding.md +++ b/docs/fundamentals/objects/binding.md @@ -39,16 +39,52 @@ The definition of all possible `binding` is made in the interests of a consisten Let $S$ is [_Sequence_](./sequence.md#Mathematical Definition) length of $n$ described as function $S : \{1,...,n\} \longrightarrow X$ - Let $R$ is _n-tuple_ of `iterating positions` of equivalent elements $P : \{1,...,n\} \longrightarrow \{0,...,n+1\}$ + Let - Let $M$ is Mode - $M : \{1,...,n\} \longrightarrow \{0,...,n+1\}$ + $$S_{cycled} : \big\{ \{1,...,n\} \longrightarrow X \big\} \longrightarrow \big\{ Z \longrightarrow X \big\}$$ + + $$S_{cycled}(S)(i) = S\big( i - n \times \lfloor ( i - 1) \div n \rfloor \big)$$ + + $$R : \{1,...,n\} \longrightarrow \{-n,...,2n\} $$ + + $$Binding : \big\{S\big\} \longrightarrow \big\{ R \big\},$$ + + + $$if \ \exists \ Binding^{-1} : \big\{R \big\} \longrightarrow \big\{\{1,...,n\} \longrightarrow \{1,...,m\}\big\}\ that$$ + + $$\forall i \in \{1,...,n\} Binding(R)(i) = Binding(Binding^{-1}(Binding(R)) )(i)$$ + + + $$Start(S)(i) = max(\big\{j \in Z \big|S_{cycled}(j) = S(i) \land j \leq i-1 \big\})$$ + + $$Start^{-1}(R)(i) = \Bigg\{\begin{array}{l} \big|\big| & if \ R(i) \leq 0 \\ Start^{-1}(R, R(i)) & otherwise \end{array}$$ + + $$End(S)(i) = min(\big\{j \in Z \big|S_{cycled}(j) = S(i) \land j \geq i+1 \big\}$$ + + $$End^{-1}(R)(i) = \Bigg\{\begin{array}{l} \big|\big| & if \ R(i) \geq n+1 \\ End^{-1}(R, R(i)) & otherwise \end{array}$$ + + Lemma: + + $$\forall S : \{1,...,n\} \longrightarrow X, \ \forall i \in \{1,..n\} \Big| 1 \leq |\ Start(S)(i) - i\ | \leq n \land 1 \leq | End(S)(i) - i\ | \leq n$$ + + + Let $Mode$ is __Mode__ + + $$Mode : \big\{ \{1,...,n\} \longrightarrow \{-n,...,2n\} \big\} \longrightarrow \big\{ \{1,...,n\} \longrightarrow \{1,...,n\} \big\}$$ Define - $$Boundary(S)(i) = \Bigg\{\begin{array}{l} 0 & if \nonempty \big\{j \in \{1,..., i - 1\}\big|S(j) = S(i) \big\} \\ n+1 & if \nonempty \big\{j \in \{i,..., n\}\big|S(j) = S(i) \big\} - \end{array}$$ + $$Cycle(R)(i) = \Bigg\{\begin{array}{l} R(i) - i & , R(j) > j \ | \ \forall j \in \{1,..,n\} \\ i - R(i) & , R(j) < j \ | \ \forall j \in \{1,..,n\}\end{array}$$ + + $$Cycle^{-1}(IO)(i) = \Bigg\{\begin{array}{l} i - IO(i) & , \exists j \in \{1,..,n\} | IO(j) > j \\ i + IO(i) & , \exists j \in \{1,..,n\} | IO(j) > n - j \end{array}$$ + + $$Boundary(R)(i) = \Bigg\{\begin{array}{l} i & , R(i) < 1 \\ Cycle(R)(i) & , 1 \leq R(i) \leq n \\ n - i + 1 & , R(i) > n \end{array}$$ + + $$Boundary^{-1}(IO)(i) = \Bigg\{\begin{array}{l} i - IO(i) & , \exists j \in \{1,..,n\} | IO(j) = j \\ i + IO(i) & , \exists j \in \{1,..,n\} | IO(j) = n - j +1\end{array}$$ + + - $$Binding : M \times \big\{S\big\} \longrightarrow \big\{R \big\},$$ + $$Binding : M \times \big\{S\big\} \longrightarrow \big\{ \big\},$$ $$if \ \exists \ Binding^{-1} : M \times \big\{R \big\} \longrightarrow \big\{\{1,...,n\} \longrightarrow \{1,...,m\}\big\}\ that$$ diff --git a/docs/fundamentals/objects/index.md b/docs/fundamentals/objects/index.md index a314562c..1f9d2ec2 100644 --- a/docs/fundamentals/objects/index.md +++ b/docs/fundamentals/objects/index.md @@ -1,3 +1,40 @@ # Objects -Coming soon +```mermaid +flowchart TB + Start@{ shape: sm-circ, label: "" }-- Sequence -->alphabet + alphabet-- Alphabet -->OA@{ shape: cross-circ, label: "order + alphabet" } + Start-- Sequence -->O@{label: "order"} + O@{label: "order"}-- Order -->OA@{ shape: cross-circ, label: "order + alphabet" } + OA@{ label: "order + alphabet" }-- Sequence -->intervals + intervals-- Intervals Chained -->decompose + decompose-- Intervals -->aggregate + aggregate-- Intervals Distribution --> da@{ label: "Δa" } + aggregate-- Intervals Distribution --> dg@{ label: "Δg" } + aggregate-- Intervals Distribution --> g@{ label: "g" } + aggregate-- Intervals Distribution --> G@{ label: "G" } + aggregate-- Intervals Distribution --> t@{ label: "t" } + +``` + + +```mermaid +flowchart TB + Sequence-- alphabet -->Alphabet + Sequence-- order -->Order + Order-->OA@{ shape: diamond, label: "+" } + Alphabet-->OA@{ shape: diamond, label: "+" } + OA@{ shape: diamond, label: "\\+" }-->Sequencetwo@{ label: "Sequence" } + Sequencetwo@{ label: "Sequence" }-->fork@{ shape: fork, label: "" } + fork@{ shape: fork, label: "" }-- intervals(cycled) --> ICC@{ label: "Intervals Chained" } + fork@{ shape: fork, label: "" }-- intervals(bondary) --> ICB@{ label: "Intervals Chained" } + ICC@{ label: "Intervals Chained" }-- decompose -->IT@{ label: "Intervals" } + ICB@{ label: "Intervals Chained" }-- decompose -->IT@{ label: "Intervals" } + IT@{ label: "Intervals" }-- aggregate -->ID@{ label: "Intervals Distribution" } + ID@{ label: "Intervals Distribution" }-- arithmetic interval -->da@{ label: "Δa" } + ID@{ label: "Intervals Distribution" }-- geometric interval -->dg@{ label: "Δg" } + ID@{ label: "Intervals Distribution" }-- average remotness -->g@{ label: "g" } + ID@{ label: "Intervals Distribution" }-- depth -->G@{ label: "G" } + ID@{ label: "Intervals Distribution" }-- volume -->V@{ label: "V" } + ID@{ label: "Intervals Distribution" }-- t -->t@{ label: "t" } +``` diff --git a/docs/fundamentals/objects/intervals_tuple.md b/docs/fundamentals/objects/intervals.md similarity index 100% rename from docs/fundamentals/objects/intervals_tuple.md rename to docs/fundamentals/objects/intervals.md diff --git a/docs/fundamentals/objects/intervals_chain.md b/docs/fundamentals/objects/intervals_chained/boundary.md similarity index 99% rename from docs/fundamentals/objects/intervals_chain.md rename to docs/fundamentals/objects/intervals_chained/boundary.md index 2afb3cd9..9e74cc55 100644 --- a/docs/fundamentals/objects/intervals_chain.md +++ b/docs/fundamentals/objects/intervals_chained/boundary.md @@ -1,4 +1,4 @@ -# Intervals Chain +# Intervals Chained An _intervals order_ is an n-tuple of natural numbers that represents the distance between equal elements in a sequence. diff --git a/docs/fundamentals/objects/intervals_chained/cycled.md b/docs/fundamentals/objects/intervals_chained/cycled.md new file mode 100644 index 00000000..9e74cc55 --- /dev/null +++ b/docs/fundamentals/objects/intervals_chained/cycled.md @@ -0,0 +1,131 @@ +# Intervals Chained + +An _intervals order_ is an n-tuple of natural numbers that represents the distance between equal elements in a sequence. + +## Mathematical Definition + +Let $B = \{Start, End\}$ is [_Binding_](./binding.md#Mathematical Definition) + +Let $M = \{Boundary, Cycle\}$ is [_Mode_](./mode.md#Mathematical Definition) + +Define + +$$Follow : B \times M \times \big\{ \{1,...,n\} \longrightarrow \{1,...,n\} \big\} \longrightarrow \big\{ \{1,...,n\} \longrightarrow \{0,...,n+1\} \big\}$$ + +$$Traceble : B \times M \times \big\{ \{1,...,n\} \longrightarrow \{1,...,n\} \big\} \longrightarrow \big\{ \{1,...,n\} \longrightarrow \{0, 1\} \big\}$$ + + + +N-tuple of natual numbers + +$$IO = \{ | \forall j \in \{1,...,n\} \exists io_j \in \{1,...,n\} \}$$ + +is called `Intervals chain` if and only if + +$$\exists (b, m) \in B \times M$$ + +that makes these statments true: + +1. Tracebility criteria - $\forall i \ Traceble(b, m)(IO)(i)$ +2. Chained criteria - $f=Follow(b,m)(IO),\ \forall i \forall j \ne i | f(i) \neq f(j) \lor f(i) \in \{0, n+1\}$ + + + + +Where: + +- $n := |O|$ is called _length_ of the order, $n \in N$ +- $o_i$​ is called the $i$-th _element_ (or coordinate) of the order + +## Examples + +### Valid order + +``` mermaid +block-beta + columns 36 + i1["1"] i2["2"] i3["3"] i4["2"] i5["4"] i6["2"] + i7["5"] i8["2"] i9["6"] i10["2"] i11["7"] i12["2"] + i13["1"] i14["2"] i15["8"] i16["2"] i17["9"] + + classDef red fill:#d62728,color:#000; + +``` + +### Invalid order - Start different from `1` + + +``` mermaid +block-beta + columns 36 + i1["2"] i2["2"] i3["3"] i4["2"] i5["4"] i6["2"] + i7["5"] i8["2"] i9["6"] i10["2"] i11["7"] i12["2"] + i13["1"] i14["2"] i15["8"] i16["2"] i17["9"] + + classDef red fill:#d62728,color:#000; + + class i1 red +``` + +### Invalid order - Contains elements not in $N$ + +``` mermaid +block-beta + columns 36 + i1["1"] i2["2"] i3["3"] i4["2"] i5["4"] i6["2"] + i7["5"] i8["2"] i9["6"] i10["T"] i11["7"] i12["2"] + i13["1"] i14["-2"] i15["8"] i16["2"] i17["9"] + + classDef red fill:#d62728,color:#000; + + class i10,i14 red +``` + +### Invalid order - Violates `max + 1` contstraint + +``` mermaid +block-beta + columns 36 + i1["1"] i2["2"] i3["3"] i4["2"] i5["4"] i6["2"] + i7["5"] i8["2"] i9["6"] i10["2"] i11["7"] i12["2"] + i13["1"] i14["9"] i15["8"] i16["2"] i17["9"] + + classDef red fill:#d62728,color:#000; + + class i14 red +``` + +### Binary Sequence +A binary sequence `0110100110` + +represented as + +$O = <1, 2, 2, 1, 2, 1, 1, 2, 2, 1>$ + +### Musical Chorus Sequence +A musical chorus for `Jingle bell rock` + +``` +D Dmaj7 D6 +Jingle-bell, Jingle-bell, Jingle-bell Rock. + D D#dim +Jingle-bell swing and + Em A7 Em A7 Em A7 +Jingle-bell ring. Snowin' and blowin' up bushels of fun. +Em A9 A7 +Now the jingle-hop has begun. +``` + +$O = <1, 2, 3, 1, 4, 5, 6, 5, 6, 7, 5, 8, 6>$ + +### DNA Sequence +A DNA sequence `ATGCTAGCATGCTAGCATGCTAGC` + +$O = <1, 2, 3, 4, 2, 1, 3, 4, 1, 2, 3, 4, 2, 1, 3, 4, 1, 2, 3, 4, 2, 1, 3, 4>$ + +### English Text Sequence as word sequence +An English text sentence `the quick brown fox jumps over the lazy dog` + +$O = <1, 2, 3, 2, 4, 2, 5, 2, 6, 2, 7, 2, 1, 2, 8, 2, 9>$ diff --git a/docs/fundamentals/objects/intervals_chained/index.md b/docs/fundamentals/objects/intervals_chained/index.md new file mode 100644 index 00000000..59708b3f --- /dev/null +++ b/docs/fundamentals/objects/intervals_chained/index.md @@ -0,0 +1,148 @@ +# Intervals Chained + +An _intervals chained is an n-tuple of natural numbers that represents the distance between equal elements in a sequence. + +## Mathematical Definition + +Let $X$ is [_Carrier set_](./carrier_set.md#Mathematical Definition) + +Let $S$ is [_Sequence_](./sequence.md#Mathematical Definition) length of $n$ described as function $S : \{1,...,n\} \longrightarrow X$ + +Define + +$$IntervalsChained = | \forall j \in \{1,...,n\} \exists io_j \in \{1,...,n\},$$ + +if exists + +$$Intervals : \big\{S\} \longrightarrow \big\{ IntervalsChained \big\},$$ + +$$Intervals^{-1} : \big\{ IntervalsChained \big\} \longrightarrow \big\{ \{1,...,n\} \longrightarrow \{1,...,m\} \big\},$$ + + +$$Intervals(S) = Intervals(Intervals^{-1}(Intervals(S)))$$ + +and exists + +$$Follow : B \times \big\{ IntervalsChained \big\} \longrightarrow \big\{ \{1,...,n\} \longrightarrow \{1,...,n\} \big\}$$ + + + + + + + + + + + + + +Where: + +- $n := |O|$ is called _length_ of the order, $n \in N$ +- $o_i$​ is called the $i$-th _element_ (or coordinate) of the order + +## Examples + +### Valid order + +``` mermaid +block-beta + columns 36 + i1["1"] i2["2"] i3["3"] i4["2"] i5["4"] i6["2"] + i7["5"] i8["2"] i9["6"] i10["2"] i11["7"] i12["2"] + i13["1"] i14["2"] i15["8"] i16["2"] i17["9"] + + classDef red fill:#d62728,color:#000; + +``` + +### Invalid order - Start different from `1` + + +``` mermaid +block-beta + columns 36 + i1["2"] i2["2"] i3["3"] i4["2"] i5["4"] i6["2"] + i7["5"] i8["2"] i9["6"] i10["2"] i11["7"] i12["2"] + i13["1"] i14["2"] i15["8"] i16["2"] i17["9"] + + classDef red fill:#d62728,color:#000; + + class i1 red +``` + +### Invalid order - Contains elements not in $N$ + +``` mermaid +block-beta + columns 36 + i1["1"] i2["2"] i3["3"] i4["2"] i5["4"] i6["2"] + i7["5"] i8["2"] i9["6"] i10["T"] i11["7"] i12["2"] + i13["1"] i14["-2"] i15["8"] i16["2"] i17["9"] + + classDef red fill:#d62728,color:#000; + + class i10,i14 red +``` + +### Invalid order - Violates `max + 1` contstraint + +``` mermaid +block-beta + columns 36 + i1["1"] i2["2"] i3["3"] i4["2"] i5["4"] i6["2"] + i7["5"] i8["2"] i9["6"] i10["2"] i11["7"] i12["2"] + i13["1"] i14["9"] i15["8"] i16["2"] i17["9"] + + classDef red fill:#d62728,color:#000; + + class i14 red +``` + +### Binary Sequence +A binary sequence `0110100110` + +represented as + +$O = <1, 2, 2, 1, 2, 1, 1, 2, 2, 1>$ + +### Musical Chorus Sequence +A musical chorus for `Jingle bell rock` + +``` +D Dmaj7 D6 +Jingle-bell, Jingle-bell, Jingle-bell Rock. + D D#dim +Jingle-bell swing and + Em A7 Em A7 Em A7 +Jingle-bell ring. Snowin' and blowin' up bushels of fun. +Em A9 A7 +Now the jingle-hop has begun. +``` + +$O = <1, 2, 3, 1, 4, 5, 6, 5, 6, 7, 5, 8, 6>$ + +### DNA Sequence +A DNA sequence `ATGCTAGCATGCTAGCATGCTAGC` + +$O = <1, 2, 3, 4, 2, 1, 3, 4, 1, 2, 3, 4, 2, 1, 3, 4, 1, 2, 3, 4, 2, 1, 3, 4>$ + +### English Text Sequence as word sequence +An English text sentence `the quick brown fox jumps over the lazy dog` + +$O = <1, 2, 3, 2, 4, 2, 5, 2, 6, 2, 7, 2, 1, 2, 8, 2, 9>$ diff --git a/docs/fundamentals/objects/references.md b/docs/fundamentals/objects/references.md new file mode 100644 index 00000000..e91513be --- /dev/null +++ b/docs/fundamentals/objects/references.md @@ -0,0 +1,126 @@ +# References + +## Mathematical Definition + + +Let $X$ is [_Carrier set_](./carrier_set.md#Mathematical Definition) + +Let $S$ is [_Sequence_](./sequence.md#Mathematical Definition) length of $n$ described as function $S : \{1,...,n\} \longrightarrow X$ + +Let + +$$S_{cycled} : \big\{ \{1,...,n\} \longrightarrow X \big\} \longrightarrow \big\{ Z \longrightarrow X \big\}$$ + +$$S_{cycled}(S)(i) = S\big( i - n \times \lfloor ( i - 1) \div n \rfloor \big)$$ + +$$R : \{1,...,n\} \longrightarrow \{-n,...,2n\} $$ + +$$Binding : \big\{S\big\} \longrightarrow \big\{ R \big\},$$ + + +$$if \ \exists \ Binding^{-1} : \big\{R \big\} \longrightarrow \big\{\{1,...,n\} \longrightarrow \{1,...,m\}\big\}\ that$$ + +$$\forall i \in \{1,...,n\} Binding(R)(i) = Binding(Binding^{-1}(Binding(R)) )(i)$$ + + +$$Start(S)(i) = max(\big\{j \in Z \big|S_{cycled}(j) = S(i) \land j \leq i-1 \big\})$$ + +$$Start^{-1}(R)(i) = \Bigg\{\begin{array}{l} \big|\big| & if \ R(i) \leq 0 \\ Start^{-1}(R, R(i)) & otherwise \end{array}$$ + +$$End(S)(i) = min(\big\{j \in Z \big|S_{cycled}(j) = S(i) \land j \geq i+1 \big\}$$ + +$$End^{-1}(R)(i) = \Bigg\{\begin{array}{l} \big|\big| & if \ R(i) \geq n+1 \\ End^{-1}(R, R(i)) & otherwise \end{array}$$ + +Lemma: + +$$\forall S : \{1,...,n\} \longrightarrow X, \ \forall i \in \{1,..n\} \Big| 1 \leq |\ Start(S)(i) - i\ | \leq n \land 1 \leq | End(S)(i) - i\ | \leq n$$ + +Define $B = \{ Start, End \} \subset \{ Binding \}$ + +## Examples + +=== "$Start$ binding" + + ``` mermaid + block-beta + columns 8 + p0["0"] p1["1"] space:3 p5["5"] p6["n"] p7["n + 1"] + inf["⊥"] s1["A"] s2["C"] s3["T"] s4["C"] s5["A"] s6["G"] sup["⊥"] + e0["0 = Start(1)"]:2 space:6 + space t1["1 = Start(5)"]:5 space:2 + + classDef imaginary fill:#526cfe09,color:#000,stroke-dasharray: 10 5; + classDef position fill:#fff,color:#000,stroke-width:0px; + class inf,sup imaginary + class p0,p1,p5,p6,p7 position + + classDef c1 fill:#ff7f0e,color:#fff; + classDef c2 fill:#ffbb78,color:#000; + classDef c2a fill:#ffbb788a,color:#000; + classDef c3 fill:#2ca02c,color:#fff; + classDef c4 fill:#98df8a,color:#000; + classDef c4a fill:#98df8a8a,color:#000; + classDef c5 fill:#d62728,color:#fff; + classDef c6 fill:#ff9896,color:#000; + classDef c6a fill:#ff98968a,color:#000; + classDef c7 fill:#9467bd,color:#fff; + classDef c8 fill:#c5b0d5,color:#000; + classDef c9 fill:#8c564b,color:#fff; + classDef c10 fill:#c49c94,color:#000; + classDef c11 fill:#e377c2,color:#fff; + classDef c12 fill:#f7b6d2,color:#000; + classDef c13 fill:#bcbd22,color:#fff; + classDef c14 fill:#dbdb8d,color:#000; + classDef c14a fill:#dbdb8d8a,color:#000; + classDef c15 fill:#17becf,color:#fff; + classDef c16 fill:#9edae5,color:#000; + + class s1,s5 c4 + class inf,t1,e0 c4a + class pomn,p00,p01,p06,p07,p02n position + class t1,t2,t5,e0,e1 position + + ``` + +=== "$End$ binding" + + ``` mermaid + block-beta + columns 8 + p0["0"] p1["1"] space:3 p5["5"] p6["n"] p7["n + 1"] + inf["⊥"] s1["A"] s2["C"] s3["T"] s4["C"] s5["A"] s6["G"] sup["⊥"] + space t1["End(1) = 5"]:5 space:2 + space:5 e0["End(5) = n+1"]:3 + + classDef imaginary fill:#526cfe09,color:#000,stroke-dasharray: 10 5; + classDef position fill:#fff,color:#000,stroke-width:0px; + class inf,sup imaginary + class p0,p1,p5,p6,p7 position + + classDef c1 fill:#ff7f0e,color:#fff; + classDef c2 fill:#ffbb78,color:#000; + classDef c2a fill:#ffbb788a,color:#000; + classDef c3 fill:#2ca02c,color:#fff; + classDef c4 fill:#98df8a,color:#000; + classDef c4a fill:#98df8a8a,color:#000; + classDef c5 fill:#d62728,color:#fff; + classDef c6 fill:#ff9896,color:#000; + classDef c6a fill:#ff98968a,color:#000; + classDef c7 fill:#9467bd,color:#fff; + classDef c8 fill:#c5b0d5,color:#000; + classDef c9 fill:#8c564b,color:#fff; + classDef c10 fill:#c49c94,color:#000; + classDef c11 fill:#e377c2,color:#fff; + classDef c12 fill:#f7b6d2,color:#000; + classDef c13 fill:#bcbd22,color:#fff; + classDef c14 fill:#dbdb8d,color:#000; + classDef c14a fill:#dbdb8d8a,color:#000; + classDef c15 fill:#17becf,color:#fff; + classDef c16 fill:#9edae5,color:#000; + + class s1,s5 c4 + class sup,t1,e0 c4a + class pomn,p00,p01,p06,p07,p02n position + class t1,t2,t5,e0,e1 position + + ``` diff --git a/mkdocs.yml b/mkdocs.yml index 6d98fc6a..0455d0c9 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -17,11 +17,11 @@ nav: - "Sequence": fundamentals/objects/sequence.md - "Alphabet": fundamentals/objects/alphabet.md - "Order": fundamentals/objects/order.md - - "Interval": fundamentals/objects/interval.md - - "Binding": fundamentals/objects/binding.md - - "Mode": fundamentals/objects/mode.md - - "Intervals Chain": fundamentals/objects/intervals_chain.md - - "Intervals Tuple": fundamentals/objects/intervals_tuple.md + - "Intervals Chained": + - fundamentals/objects/intervals_chained/index.md + - "Cycled": fundamentals/objects/intervals_chained/cycled.md + - "Boundary": fundamentals/objects/intervals_chained/boundary.md + - "Intervals": fundamentals/objects/intervals.md - "Intervals Distribution": fundamentals/objects/intervals_distribution.md - "Congeneric decomposition": - fundamentals/congeneric_decomposition/index.md From d2a3bf373210c5cf80244dafd6bc1cd50497e9bf Mon Sep 17 00:00:00 2001 From: Igor Rodionov Date: Sun, 6 Jul 2025 03:05:30 +0200 Subject: [PATCH 25/35] Iterate intervals_chain --- .../objects/intervals_chain/bounded.md | 247 +++++++++ .../objects/intervals_chain/cycled.md | 264 ++++++++++ .../objects/intervals_chain/index.md | 483 ++++++++++++++++++ .../objects/intervals_chained/boundary.md | 131 ----- .../objects/intervals_chained/cycled.md | 131 ----- .../objects/intervals_chained/index.md | 148 ------ mkdocs.yml | 9 +- 7 files changed, 999 insertions(+), 414 deletions(-) create mode 100644 docs/fundamentals/objects/intervals_chain/bounded.md create mode 100644 docs/fundamentals/objects/intervals_chain/cycled.md create mode 100644 docs/fundamentals/objects/intervals_chain/index.md delete mode 100644 docs/fundamentals/objects/intervals_chained/boundary.md delete mode 100644 docs/fundamentals/objects/intervals_chained/cycled.md delete mode 100644 docs/fundamentals/objects/intervals_chained/index.md diff --git a/docs/fundamentals/objects/intervals_chain/bounded.md b/docs/fundamentals/objects/intervals_chain/bounded.md new file mode 100644 index 00000000..1ae8e731 --- /dev/null +++ b/docs/fundamentals/objects/intervals_chain/bounded.md @@ -0,0 +1,247 @@ +# Bounded Intervals Chain + +A _bounded intervals chain_ is an [_intervals chain_](index.md) produced with _Bounded Binding_. +_Bounded Binding_ treats a sequence as a finite and uses $0$ and $n+1$ positions (depedns of _Iterator_ direction) +as _corresponding position_ anytime there is no `next` matching element. +The approach simplifies implementation functions and enables obtaining _binding direction_ based on a given _bounded intervals chain_ due to its specific properties. +This comes with a cost of the intervals' consistency that depends on _binding direction_ and leads to different measure values. +_Bounded Binding_ identifies _Start_ and _End_ directions. + + +=== "$Start$ binding" + + ``` mermaid + block-beta + columns 8 + p0["0"] p1["1"] space:3 p5["5"] p6["n"] space + inf["⊥"] s1["A"] s2["C"] s3["T"] s4["C"] s5["A"] s6["G"] space + e0["0 = Iterator(1)"]:2 space:6 + space t1["1 = Iterator(5)"]:5 space:2 + + classDef imaginary fill:#526cfe09,color:#000,stroke-dasharray: 10 5; + classDef position fill:#fff,color:#000,stroke-width:0px; + class inf,sup imaginary + class p0,p1,p5,p6,p7 position + + classDef c1 fill:#ff7f0e,color:#fff; + classDef c2 fill:#ffbb78,color:#000; + classDef c2a fill:#ffbb788a,color:#000; + classDef c3 fill:#2ca02c,color:#fff; + classDef c4 fill:#98df8a,color:#000; + classDef c4a fill:#98df8a8a,color:#000; + classDef c5 fill:#d62728,color:#fff; + classDef c6 fill:#ff9896,color:#000; + classDef c6a fill:#ff98968a,color:#000; + classDef c7 fill:#9467bd,color:#fff; + classDef c8 fill:#c5b0d5,color:#000; + classDef c9 fill:#8c564b,color:#fff; + classDef c10 fill:#c49c94,color:#000; + classDef c11 fill:#e377c2,color:#fff; + classDef c12 fill:#f7b6d2,color:#000; + classDef c13 fill:#bcbd22,color:#fff; + classDef c14 fill:#dbdb8d,color:#000; + classDef c14a fill:#dbdb8d8a,color:#000; + classDef c15 fill:#17becf,color:#fff; + classDef c16 fill:#9edae5,color:#000; + + class s1,s5 c4 + class inf,t1,e0 c4a + class pomn,p00,p01,p06,p07,p02n position + class t1,t2,t5,e0,e1 position + + ``` + +=== "$End$ binding" + + ``` mermaid + block-beta + columns 8 + space p1["1"] space:3 p5["5"] p6["n"] p7["n + 1"] + space s1["A"] s2["C"] s3["T"] s4["C"] s5["A"] s6["G"] sup["⊥"] + space t1["Iterator(1) = 5"]:5 space:2 + space:5 e0["Iterator(5) = n+1"]:3 + + classDef imaginary fill:#526cfe09,color:#000,stroke-dasharray: 10 5; + classDef position fill:#fff,color:#000,stroke-width:0px; + class inf,sup imaginary + class p0,p1,p5,p6,p7 position + + classDef c1 fill:#ff7f0e,color:#fff; + classDef c2 fill:#ffbb78,color:#000; + classDef c2a fill:#ffbb788a,color:#000; + classDef c3 fill:#2ca02c,color:#fff; + classDef c4 fill:#98df8a,color:#000; + classDef c4a fill:#98df8a8a,color:#000; + classDef c5 fill:#d62728,color:#fff; + classDef c6 fill:#ff9896,color:#000; + classDef c6a fill:#ff98968a,color:#000; + classDef c7 fill:#9467bd,color:#fff; + classDef c8 fill:#c5b0d5,color:#000; + classDef c9 fill:#8c564b,color:#fff; + classDef c10 fill:#c49c94,color:#000; + classDef c11 fill:#e377c2,color:#fff; + classDef c12 fill:#f7b6d2,color:#000; + classDef c13 fill:#bcbd22,color:#fff; + classDef c14 fill:#dbdb8d,color:#000; + classDef c14a fill:#dbdb8d8a,color:#000; + classDef c15 fill:#17becf,color:#fff; + classDef c16 fill:#9edae5,color:#000; + + class s1,s5 c4 + class sup,t1,e0 c4a + class pomn,p00,p01,p06,p07,p02n position + class t1,t2,t5,e0,e1 position + + ``` + + + +## Mathematical Definition + +Let $X$ is [_Carrier set_](../carrier_set.md#Mathematical Definition) + +Let $S$ is [_Sequence_](../sequence.md#Mathematical Definition) length of $n$ described as function $S : \{1,...,n\} \longrightarrow X$ + +Let $Binding$ is [Binding](./index.md#define-bindings) + +### Define Bindings + +=== "$Start$ binding" + Define a set of terminal values - $\bot = \{0\}$ + + Let $R : \{1,...,n\} \longrightarrow \{1,...,n\} \cup \bot,$ is a corresponding _references_ + + Define + + $$Iterator : \big\{ S \big\} \longrightarrow \big\{ R \big\},$$ + + $$Iterator(S)(i) = \Bigg\{\begin{array}{l} max \big\{j \in \{1,...,i\}\big|S(j) = S(i) \land j \ne i \big\} & if \ exists \\ 0 & otherwise \end{array}$$ + + $$Start = \in \{Binding\}$$ + + $$\exists Start^{-1} = \in \{Binding^{-1}\},$$ + + $$Iterator^{-1} : \big\{ R \big\} \longrightarrow \big\{ \{1,...,n\} \longrightarrow \{1,...,m\} | m \leq n \big\}$$ + + $$Iterator^{-1}(R)(i) = \Bigg\{\begin{array}{l} \Big|\Big|, & \ R(i) \in \bot \\ Iterator^{-1}(R, R(i)), & R(i) \in \{1,...,n\} \end{array}$$ + + $$Iterator(S) = Iterator(Iterator^{-1}(Iterator(S)))$$ + + +=== "$End$ binding" + Define a set of terminal values - $\bot = \{n+1\}$ + + Let $R : \{1,...,n\} \longrightarrow \{1,...,n\} \cup \bot,$ is a corresponding _references_ + + Define + + $$Iterator : \big\{ S \big\} \longrightarrow \big\{ R \big\},$$ + + $$Iterator(S)(i) = \Bigg\{\begin{array}{l} min \big\{j \in \{i,...,n\}\big|S(j) = S(i) \land j \ne i \big\} & if \ exists \\ n+1 & otherwise \end{array}$$ + + $$End = \in \{Binding\}$$ + + $$\exists End^{-1} = \in \{Binding^{-1}\},$$ + + $$Iterator^{-1} : \big\{ R \big\} \longrightarrow \big\{ \{1,...,n\} \longrightarrow \{1,...,m\} | m \leq n \big\}$$ + + $$Iterator^{-1}(R)(i) = \Bigg\{\begin{array}{l} \Big|\Big|, & \ R(i) \in \bot \\ Iterator^{-1}(R, R(i)), & R(i) \in \{1,...,n\} \end{array}$$ + + $$Iterator(S) = Iterator(Iterator^{-1}(Iterator(S)))$$ + +--- + +### Define Intervals Chain + +=== "$Start$ binding" + + Define + + $$IC = | \forall j \in \{1,...,n\} \exists ic_j \in \{1,...,n\},$$ + + $$\exists \ Intervals : \big\{S\} \longrightarrow \big\{ IC \big\},$$ + + $$Intervals(S)(i) = | i - Iterator(S)(i)|,$$ + + $$\exists \ Follow : \big\{ IC \big\} \longrightarrow \big\{ R \big\},$$ + + $$Follow(IC)(i) = i - IC(i),$$ + + $$\exists Intervals^{-1} : \big\{ IC \big\} \longrightarrow \big\{ \{1,...,n\} \longrightarrow \{1,...,m\} | m \leq n \big\},$$ + + $$Intervals^{-1}(IC)(i) = Iterator^{-1}(Follow(IC))(i),$$ + + $$Intervals(S) = Intervals(Intervals^{-1}(Intervals(S)))$$ + + $$\exists Trace : \big\{ IC \big\} \longrightarrow \big\{ R \big\}$$ + + $$Trace(IC)(i) = \Bigg\{\begin{array}{l} i, & \ i \in \bot \\ Trace\big(IC\big)\big(Follow(IC, i)\big) & i \in \{1,...,n\} \end{array}$$ + + + Where: + + - $n := |IC|$ is called _length_ of the _intervals chained_, $n \in N$ + - $ic_i$​ is called the $i$-th _element_ (or interval) of the _intervals chained_ + + +=== "$End$ binding" + + Define + + $$IC = | \forall j \in \{1,...,n\} \exists ic_j \in \{1,...,n\},$$ + + $$\exists \ Intervals : \big\{S\} \longrightarrow \big\{ IC \big\},$$ + + $$Intervals(S)(i) = | i - Iterator(S)(i)|,$$ + + $$\exists \ Follow : \big\{ IC \big\} \longrightarrow \big\{ R \big\},$$ + + $$Follow(IC)(i) = i + IC(i),$$ + + $$\exists Intervals^{-1} : \big\{ IC \big\} \longrightarrow \big\{ \{1,...,n\} \longrightarrow \{1,...,m\} | m \leq n \big\},$$ + + $$Intervals^{-1}(IC)(i) = Iterator^{-1}(Follow(IC))(i),$$ + + $$Intervals(S) = Intervals(Intervals^{-1}(Intervals(S)))$$ + + $$\exists Trace : \big\{ IC \big\} \longrightarrow \big\{ R \big\}$$ + + $$Trace(IC)(i) = \Bigg\{\begin{array}{l} i, & \ i \in \bot \\ Trace\big(IC\big)\big(Follow(IC, i)\big) & i \in \{1,...,n\} \end{array}$$ + + + Where: + + - $n := |IC|$ is called _length_ of the _intervals chained_, $n \in N$ + - $ic_i$​ is called the $i$-th _element_ (or interval) of the _intervals chained_ + + +--- + +#### Special properties + +_Intervals chain_ $IC$ have been calculated with _Bounded binding_ have a special properties + +=== "$Start$ binding" + + $$IC(1) = 1$$ + + $$IC(i) \le i | \forall i \in \{1,...,n\}$$ + + $$Follow(IC)(i) <> Follow(IC)(j) \lor Follow(IC)(i) \in \bot | \forall i != j$$ + + $$Trace(IC)(i) = 0 | \forall i \in \{1,...,n\}$$ + +=== "$End$ binding" + + $$IC(n) = 1$$ + + $$IC(i) \le n - i | \forall i \in \{1,...,n\}$$ + + $$Follow(IC)(i) <> Follow(IC)(j) \lor Follow(IC)(i) \in \bot | \forall i != j$$ + + $$Trace(IC)(i) = n + 1 | \forall i \in \{1,...,n\}$$ + + +--- + +Let $B = \{Start, End\} \subset \{Binding\}$ is set of [_Bounded Binding_](./binding.md#Mathematical Definition) diff --git a/docs/fundamentals/objects/intervals_chain/cycled.md b/docs/fundamentals/objects/intervals_chain/cycled.md new file mode 100644 index 00000000..add2f31b --- /dev/null +++ b/docs/fundamentals/objects/intervals_chain/cycled.md @@ -0,0 +1,264 @@ +# Cycled Intervals Chain + +A _cycled intervals chain_ is an [_intervals chain_](index.md) produced with _Cycled Binding_. +_Cycled Binding_ treats a sequence as a subsequence representing an infinite sequence. + +The approach alignged with [Representativeness heuristic](https://en.wikipedia.org/wiki/Representativeness_heuristic) idea, +connects FOA with [Necklace](https://en.wikipedia.org/wiki/Necklace_(combinatorics)) problem and +makes intervals based measures indeferent to _binding direction_. + +_Cycled Binding_ identifies _Start_ and _End_ directions. + +_Cycled Binding_ extends the sequence by copying itself as a prefix and suffix. +This is enough to mock it as a cycled sequence (also known as a periodic sequence or an orbit) and +use the prefix and suffix to find the corresponding position for the element in edge cases. + + +=== "$Start$ binding" + + ``` mermaid + block-beta + columns 18 + pomn["-n+1"] space:4 p00["0"] p01["1"] space:4 p06["n"] p07["n + 1"] space:4 p02n["n + n"] + p1["A"] p2["C"] p3["T"] p4["C"] p5["A"] p6["G"] s1["A"] s2["C"] s3["T"] s4["C"] s5["A"] s6["G"] f1["A"] f2["C"] f3["T"] f4["C"] f5["A"] f6["G"] + space:5 ia1["2"]:2 space:11 + space:4 ic1["4"]:4 space:10 + space:3 it1["6"]:6 space:9 + space:6 ig1["6"]:6 space:6 + + classDef imaginary fill:#526cfe09,color:#000,stroke-dasharray: 10 5; + classDef position fill:#fff,color:#000,stroke-width:0px; + + classDef c1 fill:#ff7f0e,color:#fff; + classDef c2 fill:#ffbb78,color:#000; + classDef c2a fill:#ffbb788a,color:#000; + classDef c3 fill:#2ca02c,color:#fff; + classDef c4 fill:#98df8a,color:#000; + classDef c4a fill:#98df8a8a,color:#000; + classDef c5 fill:#d62728,color:#fff; + classDef c6 fill:#ff9896,color:#000; + classDef c6a fill:#ff98968a,color:#000; + classDef c7 fill:#9467bd,color:#fff; + classDef c8 fill:#c5b0d5,color:#000; + classDef c9 fill:#8c564b,color:#fff; + classDef c10 fill:#c49c94,color:#000; + classDef c11 fill:#e377c2,color:#fff; + classDef c12 fill:#f7b6d2,color:#000; + classDef c13 fill:#bcbd22,color:#fff; + classDef c14 fill:#dbdb8d,color:#000; + classDef c14a fill:#dbdb8d8a,color:#000; + classDef c15 fill:#17becf,color:#fff; + classDef c16 fill:#9edae5,color:#000; + + class s1,ia1 c2 + class p5 c2a + class s2,ic1 c4 + class p4 c4a + class s3,it1 c6 + class p3 c6a + class s6,ig1 c14 + class p6 c14a + class p1,p2,p3,p4,p5,p6,p7,p8,p9,f1,f2,f3,f4,f5,f6,f7,f8,f9 imaginary + class pomn,p00,p01,p06,p07,p02n position + + ``` + +=== "$End$ binding" + + ``` mermaid + block-beta + columns 18 + pomn["-n+1"] space:4 p00["0"] p01["1"] space:4 p06["n"] p07["n + 1"] space:4 p02n["n + n"] + p1["A"] p2["C"] p3["T"] p4["C"] p5["A"] p6["G"] s1["A"] s2["C"] s3["T"] s4["C"] s5["A"] s6["G"] f1["A"] f2["C"] f3["T"] f4["C"] f5["A"] f6["G"] + space:10 ia1["2"]:2 space:6 + space:9 ic1["4"]:4 space:5 + space:8 it1["6"]:6 space:5 + space:10 ig1["6"]:6 space:1 + + classDef imaginary fill:#526cfe09,color:#000,stroke-dasharray: 10 5; + classDef position fill:#fff,color:#000,stroke-width:0px; + + classDef c1 fill:#ff7f0e,color:#fff; + classDef c2 fill:#ffbb78,color:#000; + classDef c2a fill:#ffbb788a,color:#000; + classDef c3 fill:#2ca02c,color:#fff; + classDef c4 fill:#98df8a,color:#000; + classDef c4a fill:#98df8a8a,color:#000; + classDef c5 fill:#d62728,color:#fff; + classDef c6 fill:#ff9896,color:#000; + classDef c6a fill:#ff98968a,color:#000; + classDef c7 fill:#9467bd,color:#fff; + classDef c8 fill:#c5b0d5,color:#000; + classDef c9 fill:#8c564b,color:#fff; + classDef c10 fill:#c49c94,color:#000; + classDef c11 fill:#e377c2,color:#fff; + classDef c12 fill:#f7b6d2,color:#000; + classDef c13 fill:#bcbd22,color:#fff; + classDef c14 fill:#dbdb8d,color:#000; + classDef c14a fill:#dbdb8d8a,color:#000; + classDef c15 fill:#17becf,color:#fff; + classDef c16 fill:#9edae5,color:#000; + + class s5,ia1 c2 + class f1 c2a + class s4,ic1 c4 + class f2 c4a + class s3,it1 c6 + class f3 c6a + class s6,ig1 c14 + class f6 c14a + class p1,p2,p3,p4,p5,p6,p7,p8,p9,f1,f2,f3,f4,f5,f6,f7,f8,f9 imaginary + class pomn,p00,p01,p06,p07,p02n position + + ``` + +## Mathematical Definition + +Let $X$ is [_Carrier set_](../carrier_set.md#Mathematical Definition) + +Let $S$ is [_Sequence_](../sequence.md#Mathematical Definition) length of $n$ described as function $S : \{1,...,n\} \longrightarrow X$ + +Let $Binding$ is [Binding](./index.md#define-bindings) + +Let $S_{cycled} : \big\{ \{1,...,n\} \longrightarrow X \big\} \longrightarrow \big\{ Z \longrightarrow X \big\}$ is a cycled sequence + +$$S_{cycled}(S)(i) = S\big( i - n \times \lfloor ( i - 1) \div n \rfloor \big)$$ + + +### Define Bindings + +=== "$Start$ binding" + Define a set of terminal values - $\bot = \{-n+1,...,0\}$ + + Let $R : \{1,...,n\} \longrightarrow \{1,...,n\} \cup \bot,$ is a corresponding _references_ + + Define + + $$Iterator : \big\{ S \big\} \longrightarrow \big\{ R \big\},$$ + + $$Iterator(S)(i) = max \big\{j \in \{-n+1,...,i\}\big|S_{cycled}(j) = S(i) \land j \ne i \big\} $$ + + $$Start = \in \{Binding\}$$ + + $$\exists Start^{-1} = \in \{Binding^{-1}\},$$ + + $$Iterator^{-1} : \big\{ R \big\} \longrightarrow \big\{ \{1,...,n\} \longrightarrow \{1,...,m\} | m \leq n \big\}$$ + + $$Iterator^{-1}(R)(i) = \Bigg\{\begin{array}{l} \Big|\Big|, & \ R(i) \in \bot \\ Iterator^{-1}(R, R(i)), & R(i) \in \{1,...,n\} \end{array}$$ + + $$Iterator(S) = Iterator(Iterator^{-1}(Iterator(S)))$$ + + +=== "$End$ binding" + Define a set of terminal values - $\bot = \{n+1,...,2n\}$ + + Let $R : \{1,...,n\} \longrightarrow \{1,...,n\} \cup \bot,$ is a corresponding _references_ + + Define + + $$Iterator : \big\{ S \big\} \longrightarrow \big\{ R \big\},$$ + + $$Iterator(S)(i) = min \big\{j \in \{i,...,2n\}\big|S_{cycled}(j) = S(i) \land j \ne i \big\}$$ + + $$End = \in \{Binding\}$$ + + $$\exists End^{-1} = \in \{Binding^{-1}\},$$ + + $$Iterator^{-1} : \big\{ R \big\} \longrightarrow \big\{ \{1,...,n\} \longrightarrow \{1,...,m\} | m \leq n \big\}$$ + + $$Iterator^{-1}(R)(i) = \Bigg\{\begin{array}{l} \Big|\Big|, & \ R(i) \in \bot \\ Iterator^{-1}(R, R(i)), & R(i) \in \{1,...,n\} \end{array}$$ + + $$Iterator(S) = Iterator(Iterator^{-1}(Iterator(S)))$$ + +--- + +### Define Intervals Chain + +=== "$Start$ binding" + + Define + + $$IC = | \forall j \in \{1,...,n\} \exists ic_j \in \{1,...,n\},$$ + + $$\exists \ Intervals : \big\{S\} \longrightarrow \big\{ IC \big\},$$ + + $$Intervals(S)(i) = | i - Iterator(S)(i)|,$$ + + $$\exists \ Follow : \big\{ IC \big\} \longrightarrow \big\{ R \big\},$$ + + $$Follow(IC)(i) = i - IC(i),$$ + + $$\exists Intervals^{-1} : \big\{ IC \big\} \longrightarrow \big\{ \{1,...,n\} \longrightarrow \{1,...,m\} | m \leq n \big\},$$ + + $$Intervals^{-1}(IC)(i) = Iterator^{-1}(Follow(IC))(i),$$ + + $$Intervals(S) = Intervals(Intervals^{-1}(Intervals(S)))$$ + + $$\exists Trace : \big\{ IC \big\} \longrightarrow \big\{ R \big\}$$ + + $$Trace(IC)(i) = \Bigg\{\begin{array}{l} i, & \ i \in \bot \\ Trace\big(IC\big)\big(Follow(IC, i)\big) & i \in \{1,...,n\} \end{array}$$ + + + Where: + + - $n := |IC|$ is called _length_ of the _intervals chained_, $n \in N$ + - $ic_i$​ is called the $i$-th _element_ (or interval) of the _intervals chained_ + + +=== "$End$ binding" + + Define + + $$IC = | \forall j \in \{1,...,n\} \exists ic_j \in \{1,...,n\},$$ + + $$\exists \ Intervals : \big\{S\} \longrightarrow \big\{ IC \big\},$$ + + $$Intervals(S)(i) = | i - Iterator(S)(i)|,$$ + + $$\exists \ Follow : \big\{ IC \big\} \longrightarrow \big\{ R \big\},$$ + + $$Follow(IC)(i) = i + IC(i),$$ + + $$\exists Intervals^{-1} : \big\{ IC \big\} \longrightarrow \big\{ \{1,...,n\} \longrightarrow \{1,...,m\} | m \leq n \big\},$$ + + $$Intervals^{-1}(IC)(i) = Iterator^{-1}(Follow(IC))(i),$$ + + $$Intervals(S) = Intervals(Intervals^{-1}(Intervals(S)))$$ + + $$\exists Trace : \big\{ IC \big\} \longrightarrow \big\{ R \big\}$$ + + $$Trace(IC)(i) = \Bigg\{\begin{array}{l} i, & \ i \in \bot \\ Trace\big(IC\big)\big(Follow(IC, i)\big) & i \in \{1,...,n\} \end{array}$$ + + + Where: + + - $n := |IC|$ is called _length_ of the _intervals chained_, $n \in N$ + - $ic_i$​ is called the $i$-th _element_ (or interval) of the _intervals chained_ + + +--- + +#### Special properties + +_Intervals chain_ $IC$ have been calculated with _Bounded binding_ have a special properties + +=== "$Start$ binding" + + $$IC(i) \le n | \forall i \in \{1,...,n\}$$ + + $$Follow(IC)(i) <> Follow(IC)(j) | \forall i != j$$ + + $$j < 1 \land j = Trace(IC)(n + j) | \forall i \in \{1,...,n\} \exists j = Trace(IC)(i)$$ + +=== "$End$ binding" + + $$IC(i) \le n | \forall i \in \{1,...,n\}$$ + + $$Follow(IC)(i) <> Follow(IC)(j) | \forall i != j$$ + + $$j > n+1 \land j = Trace(IC)(j - n) | \forall i \in \{1,...,n\} \exists j = Trace(IC)(i)$$ + + +--- + +Let $B = \{Start, End\} \subset \{Binding\}$ is set of [_Cycled Binding_](./binding.md#Mathematical Definition) diff --git a/docs/fundamentals/objects/intervals_chain/index.md b/docs/fundamentals/objects/intervals_chain/index.md new file mode 100644 index 00000000..65eec2cb --- /dev/null +++ b/docs/fundamentals/objects/intervals_chain/index.md @@ -0,0 +1,483 @@ +# Intervals Chain + +An _intervals chain_ is an n-tuple of natural numbers that represents the distance between equal elements in a sequence, +if and only if there is an operation that takes as an input _current_ $(index, interval)$ and returns the next _index_. +The operation makes the intervals chained to each other, which is a required condition for the existence reverse function +that restores by _intervals chain_ a sequence with the same with the original sequence [order](../order.md). + +The idea of _intervals chain_ is easy to explain by a concrete example: + + +=== "From a sequence" + + ``` mermaid + block-beta + columns 8 + space p1["1"] space:3 p5["5"] p6["n"] space + space s1["A"] s2["C"] s3["T"] s4["C"] s5["A"] s6["G"] space + + classDef imaginary fill:#526cfe09,color:#000,stroke-dasharray: 10 5; + classDef position fill:#fff,color:#000,stroke-width:0px; + class inf,sup imaginary + class p0,p1,p5,p6,p7 position + + classDef c1 fill:#ff7f0e,color:#fff; + classDef c2 fill:#ffbb78,color:#000; + classDef c2a fill:#ffbb788a,color:#000; + classDef c3 fill:#2ca02c,color:#fff; + classDef c4 fill:#98df8a,color:#000; + classDef c4a fill:#98df8a8a,color:#000; + classDef c5 fill:#d62728,color:#fff; + classDef c6 fill:#ff9896,color:#000; + classDef c6a fill:#ff98968a,color:#000; + classDef c7 fill:#9467bd,color:#fff; + classDef c8 fill:#c5b0d5,color:#000; + classDef c9 fill:#8c564b,color:#fff; + classDef c10 fill:#c49c94,color:#000; + classDef c11 fill:#e377c2,color:#fff; + classDef c12 fill:#f7b6d2,color:#000; + classDef c13 fill:#bcbd22,color:#fff; + classDef c14 fill:#dbdb8d,color:#000; + classDef c14a fill:#dbdb8d8a,color:#000; + classDef c15 fill:#17becf,color:#fff; + classDef c16 fill:#9edae5,color:#000; + ``` + + Let there be a sequence length of $n=6$ (indexed from 1 to n=6) + +=== "with a binding" + + ``` mermaid + block-beta + columns 7 + p0["0"] p1["1"] space:3 p5["5"] p6["6"] + inf["⊥"] s1["A"] s2["C"] s3["T"] s4["C"] s5["A"] s6["G"] + e0["0 = Iterator(1)"]:2 space:5 + space t1["1 = Iterator(5)"]:5 space + + classDef imaginary fill:#526cfe09,color:#000,stroke-dasharray: 10 5; + classDef position fill:#fff,color:#000,stroke-width:0px; + class inf,sup imaginary + class p0,p1,p5,p6,p7 position + + classDef c1 fill:#ff7f0e,color:#fff; + classDef c2 fill:#ffbb78,color:#000; + classDef c2a fill:#ffbb788a,color:#000; + classDef c3 fill:#2ca02c,color:#fff; + classDef c4 fill:#98df8a,color:#000; + classDef c4a fill:#98df8a8a,color:#000; + classDef c5 fill:#d62728,color:#fff; + classDef c6 fill:#ff9896,color:#000; + classDef c6a fill:#ff98968a,color:#000; + classDef c7 fill:#9467bd,color:#fff; + classDef c8 fill:#c5b0d5,color:#000; + classDef c9 fill:#8c564b,color:#fff; + classDef c10 fill:#c49c94,color:#000; + classDef c11 fill:#e377c2,color:#fff; + classDef c12 fill:#f7b6d2,color:#000; + classDef c13 fill:#bcbd22,color:#fff; + classDef c14 fill:#dbdb8d,color:#000; + classDef c14a fill:#dbdb8d8a,color:#000; + classDef c15 fill:#17becf,color:#fff; + classDef c16 fill:#9edae5,color:#000; + + class s1,s5 c4 + class inf,t1,e0 c4a + class pomn,p00,p01,p06,p07,p02n position + class t1,t2,t5,e0,e1 position + + ``` + + Define _Binding_ as a pair of an _Iterator_ function, that seeks a corresponding referenced element, and + set of _terminate states_, to determine the interval when there is no matching element in the sequence. + + In the example, _Iterator_ seeks a position of a previous equivalent element as a matching reference. + If there is no such element, it returns $0$. That means _terminate states_ set is $\bot = {0}$. + This particular method is called - _Start binding_. + +=== "get correspoding indexes" + + ``` mermaid + block-beta + columns 7 + p0["0"] p1["1"] p2["2"] p3["3"] p4["4"] p5["5"] p6["6"] + inf["⊥"] s1["A"] s2["C"] s3["T"] s4["C"] s5["A"] s6["G"] + space i1["0"] i2["0"] i3["0"] i4["2"] i5["1"] i6["0"] + + classDef imaginary fill:#526cfe09,color:#000,stroke-dasharray: 10 5; + classDef position fill:#fff,color:#000,stroke-width:0px; + class inf,sup imaginary + class p0,p1,p2,p3,p4,p5,p6,p7 position + + classDef c1 fill:#ff7f0e,color:#fff; + classDef c2 fill:#ffbb78,color:#000; + classDef c2a fill:#ffbb788a,color:#000; + classDef c3 fill:#2ca02c,color:#fff; + classDef c4 fill:#98df8a,color:#000; + classDef c4a fill:#98df8a8a,color:#000; + classDef c5 fill:#d62728,color:#fff; + classDef c6 fill:#ff9896,color:#000; + classDef c6a fill:#ff98968a,color:#000; + classDef c7 fill:#9467bd,color:#fff; + classDef c8 fill:#c5b0d5,color:#000; + classDef c9 fill:#8c564b,color:#fff; + classDef c10 fill:#c49c94,color:#000; + classDef c11 fill:#e377c2,color:#fff; + classDef c12 fill:#f7b6d2,color:#000; + classDef c13 fill:#bcbd22,color:#fff; + classDef c14 fill:#dbdb8d,color:#000; + classDef c14a fill:#dbdb8d8a,color:#000; + classDef c15 fill:#17becf,color:#fff; + classDef c16 fill:#9edae5,color:#000; + + class s1,s5,i1,i5 c4 + class s2,s4,i2,i4 c1 + class s3,i3 c5 + class s6,i6 c7 + class pomn,p00,p01,p06,p07,p02n position + class t1,t2,t5,e0,e1 position + + ``` + + With _Binding_ we can get a sequence of corresponding indexes. + For all first appearances of the elements it would be $0$, + and for `C` at position `4` corresponding index would be `2`, for `A` at position `5` - `1`. + +=== "and calculate intervals chain" + + ``` mermaid + block-beta + columns 7 + p0["0"] p1["1"] p2["2"] p3["3"] p4["4"] p5["5"] p6["6"] + space i1["0"] i2["0"] i3["0"] i4["2"] i5["1"] i6["0"] + space s1["1"] s2["2"] s3["3"] s4["2"] s5["4"] s6["6"] + + classDef imaginary fill:#526cfe09,color:#000,stroke-dasharray: 10 5; + classDef position fill:#fff,color:#000,stroke-width:0px; + class inf,sup imaginary + class p0,p1,p2,p3,p4,p5,p6,p7 position + + classDef c1 fill:#ff7f0e,color:#fff; + classDef c2 fill:#ffbb78,color:#000; + classDef c2a fill:#ffbb788a,color:#000; + classDef c3 fill:#2ca02c,color:#fff; + classDef c4 fill:#98df8a,color:#000; + classDef c4a fill:#98df8a8a,color:#000; + classDef c5 fill:#d62728,color:#fff; + classDef c6 fill:#ff9896,color:#000; + classDef c6a fill:#ff98968a,color:#000; + classDef c7 fill:#9467bd,color:#fff; + classDef c8 fill:#c5b0d5,color:#000; + classDef c9 fill:#8c564b,color:#fff; + classDef c10 fill:#c49c94,color:#000; + classDef c11 fill:#e377c2,color:#fff; + classDef c12 fill:#f7b6d2,color:#000; + classDef c13 fill:#bcbd22,color:#fff; + classDef c14 fill:#dbdb8d,color:#000; + classDef c14a fill:#dbdb8d8a,color:#000; + classDef c15 fill:#17becf,color:#fff; + classDef c16 fill:#9edae5,color:#000; + + class s1,s5,i1,i5 c4 + class s2,s4,i2,i4 c1 + class s3,i3 c5 + class s6,i6 c7 + class pomn,p00,p01,p06,p07,p02n position + class t1,t2,t5,e0,e1 position + + ``` + + Calculated interval by $Intervals$ function is the [absolute value](https://en.wikipedia.org/wiki/Absolute_value) + of difference the _corresponding index_ and the _index_. For example, for index `5` interval would be $|5-1|=4$ + + +--- + +There should exists an inverse function that restores by _interval chain_ a sequence with the original [order](../order.md) + +=== "From an interval chain" + + ``` mermaid + block-beta + columns 7 + space p1["1"] p2["2"] p3["3"] p4["4"] p5["5"] p6["6"] + space s1["1"] s2["2"] s3["3"] s4["2"] s5["4"] s6["6"] + + classDef imaginary fill:#526cfe09,color:#000,stroke-dasharray: 10 5; + classDef position fill:#fff,color:#000,stroke-width:0px; + class inf,sup imaginary + class p0,p1,p2,p3,p4,p5,p6,p7 position + + classDef c1 fill:#ff7f0e,color:#fff; + classDef c2 fill:#ffbb78,color:#000; + classDef c2a fill:#ffbb788a,color:#000; + classDef c3 fill:#2ca02c,color:#fff; + classDef c4 fill:#98df8a,color:#000; + classDef c4a fill:#98df8a8a,color:#000; + classDef c5 fill:#d62728,color:#fff; + classDef c6 fill:#ff9896,color:#000; + classDef c6a fill:#ff98968a,color:#000; + classDef c7 fill:#9467bd,color:#fff; + classDef c8 fill:#c5b0d5,color:#000; + classDef c9 fill:#8c564b,color:#fff; + classDef c10 fill:#c49c94,color:#000; + classDef c11 fill:#e377c2,color:#fff; + classDef c12 fill:#f7b6d2,color:#000; + classDef c13 fill:#bcbd22,color:#fff; + classDef c14 fill:#dbdb8d,color:#000; + classDef c14a fill:#dbdb8d8a,color:#000; + classDef c15 fill:#17becf,color:#fff; + classDef c16 fill:#9edae5,color:#000; + + class pomn,p00,p01,p06,p07,p02n position + class t1,t2,t5,e0,e1 position + + ``` + + Let there be an _interval chain_. + +=== "calculate correspoding indexes" + + ``` mermaid + block-beta + columns 7 + p0["0"] p1["1"] p2["2"] p3["3"] p4["4"] p5["5"] p6["6"] + space s1["1"] s2["2"] s3["3"] s4["2"] s5["4"] s6["6"] + space i1["0"] i2["0"] i3["0"] i4["2"] i5["1"] i6["0"] + + classDef imaginary fill:#526cfe09,color:#000,stroke-dasharray: 10 5; + classDef position fill:#fff,color:#000,stroke-width:0px; + class inf,sup imaginary + class p0,p1,p2,p3,p4,p5,p6,p7 position + + classDef c1 fill:#ff7f0e,color:#fff; + classDef c2 fill:#ffbb78,color:#000; + classDef c2a fill:#ffbb788a,color:#000; + classDef c3 fill:#2ca02c,color:#fff; + classDef c4 fill:#98df8a,color:#000; + classDef c4a fill:#98df8a8a,color:#000; + classDef c5 fill:#d62728,color:#fff; + classDef c6 fill:#ff9896,color:#000; + classDef c6a fill:#ff98968a,color:#000; + classDef c7 fill:#9467bd,color:#fff; + classDef c8 fill:#c5b0d5,color:#000; + classDef c9 fill:#8c564b,color:#fff; + classDef c10 fill:#c49c94,color:#000; + classDef c11 fill:#e377c2,color:#fff; + classDef c12 fill:#f7b6d2,color:#000; + classDef c13 fill:#bcbd22,color:#fff; + classDef c14 fill:#dbdb8d,color:#000; + classDef c14a fill:#dbdb8d8a,color:#000; + classDef c15 fill:#17becf,color:#fff; + classDef c16 fill:#9edae5,color:#000; + + class pomn,p00,p01,p06,p07,p02n position + class t1,t2,t5,e0,e1 position + + ``` + + The $Intervals^{-1}$ function for calculating _corresponding index_ based on the current _index_ and _interval_ is closly coupled + with direction in selected _Binding_. The function has to be defined for each particular _Binding_ method. + Whether it is possible to obtain direction of _Binding_ given an _interval chain_, and whether there are two equivalent _interval chains_ + obtained by different _Binding_ methods, are open questions that need to be investigated. + + In the example $Intervals^{-1}(IC)(i) = IC(i)-i$ + +=== "and use binding⁻¹" + + ``` mermaid + block-beta + columns 6 + p1["1"] space:3 p5["5"] p6["6"] + s1["0"] s2["0"] s3["0"] s4["2"] s5["1"] s6["0"] + e0["Iterator⁻¹(1) = 1"] space:5 + t1["Iterator⁻¹(5) = 1"]:5 space + + classDef imaginary fill:#526cfe09,color:#000,stroke-dasharray: 10 5; + classDef position fill:#fff,color:#000,stroke-width:0px; + class inf,sup imaginary + class p0,p1,p5,p6,p7 position + + classDef c1 fill:#ff7f0e,color:#fff; + classDef c2 fill:#ffbb78,color:#000; + classDef c2a fill:#ffbb788a,color:#000; + classDef c3 fill:#2ca02c,color:#fff; + classDef c4 fill:#98df8a,color:#000; + classDef c4a fill:#98df8a8a,color:#000; + classDef c5 fill:#d62728,color:#fff; + classDef c6 fill:#ff9896,color:#000; + classDef c6a fill:#ff98968a,color:#000; + classDef c7 fill:#9467bd,color:#fff; + classDef c8 fill:#c5b0d5,color:#000; + classDef c9 fill:#8c564b,color:#fff; + classDef c10 fill:#c49c94,color:#000; + classDef c11 fill:#e377c2,color:#fff; + classDef c12 fill:#f7b6d2,color:#000; + classDef c13 fill:#bcbd22,color:#fff; + classDef c14 fill:#dbdb8d,color:#000; + classDef c14a fill:#dbdb8d8a,color:#000; + classDef c15 fill:#17becf,color:#fff; + classDef c16 fill:#9edae5,color:#000; + + class s1,s5 c4 + class inf,t1,e0 c4a + class pomn,p00,p01,p06,p07,p02n position + class t1,t2,t5,e0,e1 position + + ``` + + For each _Binding_ should exists $Binding^{-1}$ with an $Iterator^{-1}$ that allows + to relabel elements of _interval chain_ with a unique number of the traversed path that it belongs to. + + $$Iterator^{-1}(P)(i) = \Bigg\{\begin{array}{l} \big|\big| & if \ P(i)=0 \\ Iterator^{-1}(P, P(i)) & otherwise \end{array}$$ + +=== "to reconstruct sequence" + + ``` mermaid + block-beta + columns 6 + p1["1"] p2["2"] p3["3"] p4["4"] p5["5"] p6["6"] + i1["0"] i2["0"] i3["0"] i4["2"] i5["1"] i6["0"] + s1["1"] s2["2"] s3["3"] s4["2"] s5["1"] s6["4"] + + classDef imaginary fill:#526cfe09,color:#000,stroke-dasharray: 10 5; + classDef position fill:#fff,color:#000,stroke-width:0px; + class inf,sup imaginary + class p0,p1,p2,p3,p4,p5,p6,p7 position + + classDef c1 fill:#ff7f0e,color:#fff; + classDef c2 fill:#ffbb78,color:#000; + classDef c2a fill:#ffbb788a,color:#000; + classDef c3 fill:#2ca02c,color:#fff; + classDef c4 fill:#98df8a,color:#000; + classDef c4a fill:#98df8a8a,color:#000; + classDef c5 fill:#d62728,color:#fff; + classDef c6 fill:#ff9896,color:#000; + classDef c6a fill:#ff98968a,color:#000; + classDef c7 fill:#9467bd,color:#fff; + classDef c8 fill:#c5b0d5,color:#000; + classDef c9 fill:#8c564b,color:#fff; + classDef c10 fill:#c49c94,color:#000; + classDef c11 fill:#e377c2,color:#fff; + classDef c12 fill:#f7b6d2,color:#000; + classDef c13 fill:#bcbd22,color:#fff; + classDef c14 fill:#dbdb8d,color:#000; + classDef c14a fill:#dbdb8d8a,color:#000; + classDef c15 fill:#17becf,color:#fff; + classDef c16 fill:#9edae5,color:#000; + + class s1,s5,i1,i5 c4 + class s2,s4,i2,i4 c1 + class s3,i3 c5 + class s6,i6 c7 + class pomn,p00,p01,p06,p07,p02n position + class t1,t2,t5,e0,e1 position + + ``` + + The reconstructed sequence is not equal to the original one, but it preserves the same [order](../order.md) of elements + and its _intervals chain_ would be equal to the _interval chain_ of the original sequence. + + ``` mermaid + block-beta + columns 6 + p1["1"] p2["2"] p3["3"] p4["4"] p5["5"] p6["6"] + s1["1"] s2["2"] s3["3"] s4["2"] s5["1"] s6["4"] + i1["A"] i2["C"] i3["T"] i4["C"] i5["A"] i6["G"] + + classDef imaginary fill:#526cfe09,color:#000,stroke-dasharray: 10 5; + classDef position fill:#fff,color:#000,stroke-width:0px; + class inf,sup imaginary + class p0,p1,p2,p3,p4,p5,p6,p7 position + + classDef c1 fill:#ff7f0e,color:#fff; + classDef c2 fill:#ffbb78,color:#000; + classDef c2a fill:#ffbb788a,color:#000; + classDef c3 fill:#2ca02c,color:#fff; + classDef c4 fill:#98df8a,color:#000; + classDef c4a fill:#98df8a8a,color:#000; + classDef c5 fill:#d62728,color:#fff; + classDef c6 fill:#ff9896,color:#000; + classDef c6a fill:#ff98968a,color:#000; + classDef c7 fill:#9467bd,color:#fff; + classDef c8 fill:#c5b0d5,color:#000; + classDef c9 fill:#8c564b,color:#fff; + classDef c10 fill:#c49c94,color:#000; + classDef c11 fill:#e377c2,color:#fff; + classDef c12 fill:#f7b6d2,color:#000; + classDef c13 fill:#bcbd22,color:#fff; + classDef c14 fill:#dbdb8d,color:#000; + classDef c14a fill:#dbdb8d8a,color:#000; + classDef c15 fill:#17becf,color:#fff; + classDef c16 fill:#9edae5,color:#000; + + class s1,s5,i1,i5 c4 + class s2,s4,i2,i4 c1 + class s3,i3 c5 + class s6,i6 c7 + class pomn,p00,p01,p06,p07,p02n position + class t1,t2,t5,e0,e1 position + + ``` + +--- + +Formal order analysis identifies two groups of _Bindings_: + +- [Bounded](./bounded.md.md) - consider a sequence to be finite and bounded. Operates with the minimum data required to determine _intervals chains_ and _sequence_. +- [Cycled](./cycled.md) - treats a sequence as a subsequence representing an infinite sequence. Connects FOA with the fundamental ideas underlying statistics and probability theory. + +## Mathematical Definition + +Let $X$ is [_Carrier set_](../carrier_set.md#Mathematical Definition) + +Let $S$ is [_Sequence_](../sequence.md#Mathematical Definition) length of $n$ described as function $S : \{1,...,n\} \longrightarrow X$ + +### Define Bindings + +Define a set of terminal values - $\bot \subset N \setminus \{1,..,n\}$ + +Let $R : \{1,...,n\} \longrightarrow \{1,...,n\} \cup \bot,$ is a corresponding _references_ + +Define + +$$Iterator : \big\{ S \big\} \longrightarrow \big\{ R \big\},$$ + +$$Binding = $$ + +$$\exists Binding^{-1} = ,$$ + +$$Iterator^{-1} : \big\{ R \big\} \longrightarrow \big\{ \{1,...,n\} \longrightarrow \{1,...,m\} | m \leq n \big\}$$ + +$$Iterator(S) = Iterator(Iterator^{-1}(Iterator(S)))$$ + +### Define Intervals Chain + +as n-tuple of natural numbers + +$$IC = | \forall j \in \{1,...,n\} \exists ic_j \in \{1,...,n\},$$ + +if and only if + +$$\exists \ Intervals : \big\{Binding\big\} \times \big\{S\} \longrightarrow \big\{ IC \big\},$$ + +$$Intervals(, S)(i) = | i - iterator(S)(i)|,$$ + +$$\exists \ Intervals^{-1} : \big\{Binding^{-1}\big\} \times \big\{ IC \big\} \longrightarrow \big\{ \{1,...,n\} \longrightarrow \{1,...,m\} | m \leq n \big\},$$ + +$$Intervals(b, S) = Intervals(b, Intervals^{-1}(b^{-1}, Intervals(b, S)))$$ + +$$\exists \ Follow : \big\{Binding\big\} \times \big\{ IC \big\} \longrightarrow \big\{ R \big\},$$ + +$$Follow(b, IC)(i) <> Follow(b, IC)(j) \lor Follow(b, IC)(i) \in \bot | \forall i != j $$ + +$$\exists \ Trace : \big\{Binding\big\} \times \big\{ IC \big\} \longrightarrow \big\{ R \big\}$$ + +$$Trace(, IC)(i) = \Bigg\{\begin{array}{l} i, & \ i \in \bot \\ Trace\big(Follow(IC, i)\big) & i \in \{1,...,n\} \end{array}$$ + +$$Trace(IC)(i) \in \bot | \forall i \in \{1,...,n\}$$ + +Where: + +- $n := |IC|$ is called _length_ of the _intervals chained_, $n \in N$ +- $ic_i$​ is called the $i$-th _element_ (or interval) of the _intervals chained_ diff --git a/docs/fundamentals/objects/intervals_chained/boundary.md b/docs/fundamentals/objects/intervals_chained/boundary.md deleted file mode 100644 index 9e74cc55..00000000 --- a/docs/fundamentals/objects/intervals_chained/boundary.md +++ /dev/null @@ -1,131 +0,0 @@ -# Intervals Chained - -An _intervals order_ is an n-tuple of natural numbers that represents the distance between equal elements in a sequence. - -## Mathematical Definition - -Let $B = \{Start, End\}$ is [_Binding_](./binding.md#Mathematical Definition) - -Let $M = \{Boundary, Cycle\}$ is [_Mode_](./mode.md#Mathematical Definition) - -Define - -$$Follow : B \times M \times \big\{ \{1,...,n\} \longrightarrow \{1,...,n\} \big\} \longrightarrow \big\{ \{1,...,n\} \longrightarrow \{0,...,n+1\} \big\}$$ - -$$Traceble : B \times M \times \big\{ \{1,...,n\} \longrightarrow \{1,...,n\} \big\} \longrightarrow \big\{ \{1,...,n\} \longrightarrow \{0, 1\} \big\}$$ - - - -N-tuple of natual numbers - -$$IO = \{ | \forall j \in \{1,...,n\} \exists io_j \in \{1,...,n\} \}$$ - -is called `Intervals chain` if and only if - -$$\exists (b, m) \in B \times M$$ - -that makes these statments true: - -1. Tracebility criteria - $\forall i \ Traceble(b, m)(IO)(i)$ -2. Chained criteria - $f=Follow(b,m)(IO),\ \forall i \forall j \ne i | f(i) \neq f(j) \lor f(i) \in \{0, n+1\}$ - - - - -Where: - -- $n := |O|$ is called _length_ of the order, $n \in N$ -- $o_i$​ is called the $i$-th _element_ (or coordinate) of the order - -## Examples - -### Valid order - -``` mermaid -block-beta - columns 36 - i1["1"] i2["2"] i3["3"] i4["2"] i5["4"] i6["2"] - i7["5"] i8["2"] i9["6"] i10["2"] i11["7"] i12["2"] - i13["1"] i14["2"] i15["8"] i16["2"] i17["9"] - - classDef red fill:#d62728,color:#000; - -``` - -### Invalid order - Start different from `1` - - -``` mermaid -block-beta - columns 36 - i1["2"] i2["2"] i3["3"] i4["2"] i5["4"] i6["2"] - i7["5"] i8["2"] i9["6"] i10["2"] i11["7"] i12["2"] - i13["1"] i14["2"] i15["8"] i16["2"] i17["9"] - - classDef red fill:#d62728,color:#000; - - class i1 red -``` - -### Invalid order - Contains elements not in $N$ - -``` mermaid -block-beta - columns 36 - i1["1"] i2["2"] i3["3"] i4["2"] i5["4"] i6["2"] - i7["5"] i8["2"] i9["6"] i10["T"] i11["7"] i12["2"] - i13["1"] i14["-2"] i15["8"] i16["2"] i17["9"] - - classDef red fill:#d62728,color:#000; - - class i10,i14 red -``` - -### Invalid order - Violates `max + 1` contstraint - -``` mermaid -block-beta - columns 36 - i1["1"] i2["2"] i3["3"] i4["2"] i5["4"] i6["2"] - i7["5"] i8["2"] i9["6"] i10["2"] i11["7"] i12["2"] - i13["1"] i14["9"] i15["8"] i16["2"] i17["9"] - - classDef red fill:#d62728,color:#000; - - class i14 red -``` - -### Binary Sequence -A binary sequence `0110100110` - -represented as - -$O = <1, 2, 2, 1, 2, 1, 1, 2, 2, 1>$ - -### Musical Chorus Sequence -A musical chorus for `Jingle bell rock` - -``` -D Dmaj7 D6 -Jingle-bell, Jingle-bell, Jingle-bell Rock. - D D#dim -Jingle-bell swing and - Em A7 Em A7 Em A7 -Jingle-bell ring. Snowin' and blowin' up bushels of fun. -Em A9 A7 -Now the jingle-hop has begun. -``` - -$O = <1, 2, 3, 1, 4, 5, 6, 5, 6, 7, 5, 8, 6>$ - -### DNA Sequence -A DNA sequence `ATGCTAGCATGCTAGCATGCTAGC` - -$O = <1, 2, 3, 4, 2, 1, 3, 4, 1, 2, 3, 4, 2, 1, 3, 4, 1, 2, 3, 4, 2, 1, 3, 4>$ - -### English Text Sequence as word sequence -An English text sentence `the quick brown fox jumps over the lazy dog` - -$O = <1, 2, 3, 2, 4, 2, 5, 2, 6, 2, 7, 2, 1, 2, 8, 2, 9>$ diff --git a/docs/fundamentals/objects/intervals_chained/cycled.md b/docs/fundamentals/objects/intervals_chained/cycled.md deleted file mode 100644 index 9e74cc55..00000000 --- a/docs/fundamentals/objects/intervals_chained/cycled.md +++ /dev/null @@ -1,131 +0,0 @@ -# Intervals Chained - -An _intervals order_ is an n-tuple of natural numbers that represents the distance between equal elements in a sequence. - -## Mathematical Definition - -Let $B = \{Start, End\}$ is [_Binding_](./binding.md#Mathematical Definition) - -Let $M = \{Boundary, Cycle\}$ is [_Mode_](./mode.md#Mathematical Definition) - -Define - -$$Follow : B \times M \times \big\{ \{1,...,n\} \longrightarrow \{1,...,n\} \big\} \longrightarrow \big\{ \{1,...,n\} \longrightarrow \{0,...,n+1\} \big\}$$ - -$$Traceble : B \times M \times \big\{ \{1,...,n\} \longrightarrow \{1,...,n\} \big\} \longrightarrow \big\{ \{1,...,n\} \longrightarrow \{0, 1\} \big\}$$ - - - -N-tuple of natual numbers - -$$IO = \{ | \forall j \in \{1,...,n\} \exists io_j \in \{1,...,n\} \}$$ - -is called `Intervals chain` if and only if - -$$\exists (b, m) \in B \times M$$ - -that makes these statments true: - -1. Tracebility criteria - $\forall i \ Traceble(b, m)(IO)(i)$ -2. Chained criteria - $f=Follow(b,m)(IO),\ \forall i \forall j \ne i | f(i) \neq f(j) \lor f(i) \in \{0, n+1\}$ - - - - -Where: - -- $n := |O|$ is called _length_ of the order, $n \in N$ -- $o_i$​ is called the $i$-th _element_ (or coordinate) of the order - -## Examples - -### Valid order - -``` mermaid -block-beta - columns 36 - i1["1"] i2["2"] i3["3"] i4["2"] i5["4"] i6["2"] - i7["5"] i8["2"] i9["6"] i10["2"] i11["7"] i12["2"] - i13["1"] i14["2"] i15["8"] i16["2"] i17["9"] - - classDef red fill:#d62728,color:#000; - -``` - -### Invalid order - Start different from `1` - - -``` mermaid -block-beta - columns 36 - i1["2"] i2["2"] i3["3"] i4["2"] i5["4"] i6["2"] - i7["5"] i8["2"] i9["6"] i10["2"] i11["7"] i12["2"] - i13["1"] i14["2"] i15["8"] i16["2"] i17["9"] - - classDef red fill:#d62728,color:#000; - - class i1 red -``` - -### Invalid order - Contains elements not in $N$ - -``` mermaid -block-beta - columns 36 - i1["1"] i2["2"] i3["3"] i4["2"] i5["4"] i6["2"] - i7["5"] i8["2"] i9["6"] i10["T"] i11["7"] i12["2"] - i13["1"] i14["-2"] i15["8"] i16["2"] i17["9"] - - classDef red fill:#d62728,color:#000; - - class i10,i14 red -``` - -### Invalid order - Violates `max + 1` contstraint - -``` mermaid -block-beta - columns 36 - i1["1"] i2["2"] i3["3"] i4["2"] i5["4"] i6["2"] - i7["5"] i8["2"] i9["6"] i10["2"] i11["7"] i12["2"] - i13["1"] i14["9"] i15["8"] i16["2"] i17["9"] - - classDef red fill:#d62728,color:#000; - - class i14 red -``` - -### Binary Sequence -A binary sequence `0110100110` - -represented as - -$O = <1, 2, 2, 1, 2, 1, 1, 2, 2, 1>$ - -### Musical Chorus Sequence -A musical chorus for `Jingle bell rock` - -``` -D Dmaj7 D6 -Jingle-bell, Jingle-bell, Jingle-bell Rock. - D D#dim -Jingle-bell swing and - Em A7 Em A7 Em A7 -Jingle-bell ring. Snowin' and blowin' up bushels of fun. -Em A9 A7 -Now the jingle-hop has begun. -``` - -$O = <1, 2, 3, 1, 4, 5, 6, 5, 6, 7, 5, 8, 6>$ - -### DNA Sequence -A DNA sequence `ATGCTAGCATGCTAGCATGCTAGC` - -$O = <1, 2, 3, 4, 2, 1, 3, 4, 1, 2, 3, 4, 2, 1, 3, 4, 1, 2, 3, 4, 2, 1, 3, 4>$ - -### English Text Sequence as word sequence -An English text sentence `the quick brown fox jumps over the lazy dog` - -$O = <1, 2, 3, 2, 4, 2, 5, 2, 6, 2, 7, 2, 1, 2, 8, 2, 9>$ diff --git a/docs/fundamentals/objects/intervals_chained/index.md b/docs/fundamentals/objects/intervals_chained/index.md deleted file mode 100644 index 59708b3f..00000000 --- a/docs/fundamentals/objects/intervals_chained/index.md +++ /dev/null @@ -1,148 +0,0 @@ -# Intervals Chained - -An _intervals chained is an n-tuple of natural numbers that represents the distance between equal elements in a sequence. - -## Mathematical Definition - -Let $X$ is [_Carrier set_](./carrier_set.md#Mathematical Definition) - -Let $S$ is [_Sequence_](./sequence.md#Mathematical Definition) length of $n$ described as function $S : \{1,...,n\} \longrightarrow X$ - -Define - -$$IntervalsChained = | \forall j \in \{1,...,n\} \exists io_j \in \{1,...,n\},$$ - -if exists - -$$Intervals : \big\{S\} \longrightarrow \big\{ IntervalsChained \big\},$$ - -$$Intervals^{-1} : \big\{ IntervalsChained \big\} \longrightarrow \big\{ \{1,...,n\} \longrightarrow \{1,...,m\} \big\},$$ - - -$$Intervals(S) = Intervals(Intervals^{-1}(Intervals(S)))$$ - -and exists - -$$Follow : B \times \big\{ IntervalsChained \big\} \longrightarrow \big\{ \{1,...,n\} \longrightarrow \{1,...,n\} \big\}$$ - - - - - - - - - - - - - -Where: - -- $n := |O|$ is called _length_ of the order, $n \in N$ -- $o_i$​ is called the $i$-th _element_ (or coordinate) of the order - -## Examples - -### Valid order - -``` mermaid -block-beta - columns 36 - i1["1"] i2["2"] i3["3"] i4["2"] i5["4"] i6["2"] - i7["5"] i8["2"] i9["6"] i10["2"] i11["7"] i12["2"] - i13["1"] i14["2"] i15["8"] i16["2"] i17["9"] - - classDef red fill:#d62728,color:#000; - -``` - -### Invalid order - Start different from `1` - - -``` mermaid -block-beta - columns 36 - i1["2"] i2["2"] i3["3"] i4["2"] i5["4"] i6["2"] - i7["5"] i8["2"] i9["6"] i10["2"] i11["7"] i12["2"] - i13["1"] i14["2"] i15["8"] i16["2"] i17["9"] - - classDef red fill:#d62728,color:#000; - - class i1 red -``` - -### Invalid order - Contains elements not in $N$ - -``` mermaid -block-beta - columns 36 - i1["1"] i2["2"] i3["3"] i4["2"] i5["4"] i6["2"] - i7["5"] i8["2"] i9["6"] i10["T"] i11["7"] i12["2"] - i13["1"] i14["-2"] i15["8"] i16["2"] i17["9"] - - classDef red fill:#d62728,color:#000; - - class i10,i14 red -``` - -### Invalid order - Violates `max + 1` contstraint - -``` mermaid -block-beta - columns 36 - i1["1"] i2["2"] i3["3"] i4["2"] i5["4"] i6["2"] - i7["5"] i8["2"] i9["6"] i10["2"] i11["7"] i12["2"] - i13["1"] i14["9"] i15["8"] i16["2"] i17["9"] - - classDef red fill:#d62728,color:#000; - - class i14 red -``` - -### Binary Sequence -A binary sequence `0110100110` - -represented as - -$O = <1, 2, 2, 1, 2, 1, 1, 2, 2, 1>$ - -### Musical Chorus Sequence -A musical chorus for `Jingle bell rock` - -``` -D Dmaj7 D6 -Jingle-bell, Jingle-bell, Jingle-bell Rock. - D D#dim -Jingle-bell swing and - Em A7 Em A7 Em A7 -Jingle-bell ring. Snowin' and blowin' up bushels of fun. -Em A9 A7 -Now the jingle-hop has begun. -``` - -$O = <1, 2, 3, 1, 4, 5, 6, 5, 6, 7, 5, 8, 6>$ - -### DNA Sequence -A DNA sequence `ATGCTAGCATGCTAGCATGCTAGC` - -$O = <1, 2, 3, 4, 2, 1, 3, 4, 1, 2, 3, 4, 2, 1, 3, 4, 1, 2, 3, 4, 2, 1, 3, 4>$ - -### English Text Sequence as word sequence -An English text sentence `the quick brown fox jumps over the lazy dog` - -$O = <1, 2, 3, 2, 4, 2, 5, 2, 6, 2, 7, 2, 1, 2, 8, 2, 9>$ diff --git a/mkdocs.yml b/mkdocs.yml index 0455d0c9..3283ce08 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -17,12 +17,13 @@ nav: - "Sequence": fundamentals/objects/sequence.md - "Alphabet": fundamentals/objects/alphabet.md - "Order": fundamentals/objects/order.md - - "Intervals Chained": - - fundamentals/objects/intervals_chained/index.md - - "Cycled": fundamentals/objects/intervals_chained/cycled.md - - "Boundary": fundamentals/objects/intervals_chained/boundary.md + - "Intervals Chain": + - fundamentals/objects/intervals_chain/index.md + - "Bounded": fundamentals/objects/intervals_chain/bounded.md + - "Cycled": fundamentals/objects/intervals_chain/cycled.md - "Intervals": fundamentals/objects/intervals.md - "Intervals Distribution": fundamentals/objects/intervals_distribution.md + - "Binding": fundamentals/objects/binding.md - "Congeneric decomposition": - fundamentals/congeneric_decomposition/index.md - "Congeneric sequences": fundamentals/congeneric_decomposition/congeneric_sequences.md From 110063b35b9a3d135ec9a7b9c2f234d333660463 Mon Sep 17 00:00:00 2001 From: Igor Rodionov Date: Sun, 6 Jul 2025 03:08:08 +0200 Subject: [PATCH 26/35] Cleanup old docs --- docs/fundamentals/objects/binding.md | 205 --------------- docs/fundamentals/objects/index_set.md | 17 -- docs/fundamentals/objects/interval.md | 23 -- docs/fundamentals/objects/mode.md | 296 ---------------------- docs/fundamentals/objects/mode/bounded.md | 269 -------------------- docs/fundamentals/objects/mode/cycle.md | 269 -------------------- docs/fundamentals/objects/mode/index.md | 269 -------------------- docs/fundamentals/objects/references.md | 126 --------- mkdocs.yml | 1 - 9 files changed, 1475 deletions(-) delete mode 100644 docs/fundamentals/objects/binding.md delete mode 100644 docs/fundamentals/objects/index_set.md delete mode 100644 docs/fundamentals/objects/interval.md delete mode 100644 docs/fundamentals/objects/mode.md delete mode 100644 docs/fundamentals/objects/mode/bounded.md delete mode 100644 docs/fundamentals/objects/mode/cycle.md delete mode 100644 docs/fundamentals/objects/mode/index.md delete mode 100644 docs/fundamentals/objects/references.md diff --git a/docs/fundamentals/objects/binding.md b/docs/fundamentals/objects/binding.md deleted file mode 100644 index d9145c53..00000000 --- a/docs/fundamentals/objects/binding.md +++ /dev/null @@ -1,205 +0,0 @@ -# Binding - -A __binding__ is a method of iterating over equivalent elements of the sequence. -Two binding ​are defined - $Start$ and $End$. -$Start$ binding seeks back the previous occurrence of the element, and the $End$ binding seeks the next occurrence. -In practice, there is no good reason to prefer one binding over the other. -The definition of all possible `binding` is made in the interests of a consistent and fully encompassing mathematical theory. - -## Mathematical Definition - -=== "Old" - Let $X$ is [_Carrier set_](./carrier_set.md#Mathematical Definition) - - Let $S$ is [_Sequence_](./sequence.md#Mathematical Definition) length of $n$ described as function $S : \{1,...,n\} \longrightarrow X$ - - Let $P$ is _n-tuple_ of `iterating positions` of equivalent elements $P : \{1,...,n\} \longrightarrow \{0,...,n+1\}$ - - Define - - $$Binding : \big\{S\big\} \longrightarrow \big\{P \big\},$$ - - $$if \ \exists \ Binding^{-1} : \big\{P \big\} \longrightarrow \big\{\{1,...,n\} \longrightarrow \{1,...,m\}\big\}\ that$$ - - $$\forall i \in \{1,...,n\} Binding(S)(i) = Binding(Binding^{-1}(Binding(S)))(i)$$ - - $$Start(S)(i) = \Bigg\{\begin{array}{l} max \big\{j \in \{1,..., i - 1\}\big|S(j) = S(i) \big\} & if \ exists \\ 0 & otherwise \end{array}$$ - - $$Start^{-1}(P)(i) = \Bigg\{\begin{array}{l} \big|\big| & if \ P(i)=0 \\ Start^{-1}(P, P(i)) & otherwise \end{array}$$ - - $$End(S)(i) = \Bigg\{\begin{array}{l} min \big\{j \in \{i+1,..., n\}\big|S(j) = S(i) \big\} & if \ exists \\ n+1 & \ otherwise \end{array}$$ - - $$End^{-1}(P)(i) = \Bigg\{\begin{array}{l} \big|\big| & if \ P(i)=n+1 \\ End^{-1}(P, P(i)) & otherwise \end{array}$$ - - Define $B = \{ Start, End \} \subset \{ Binding \}$ - - -=== "New" - Let $X$ is [_Carrier set_](./carrier_set.md#Mathematical Definition) - - Let $S$ is [_Sequence_](./sequence.md#Mathematical Definition) length of $n$ described as function $S : \{1,...,n\} \longrightarrow X$ - - Let - - $$S_{cycled} : \big\{ \{1,...,n\} \longrightarrow X \big\} \longrightarrow \big\{ Z \longrightarrow X \big\}$$ - - $$S_{cycled}(S)(i) = S\big( i - n \times \lfloor ( i - 1) \div n \rfloor \big)$$ - - $$R : \{1,...,n\} \longrightarrow \{-n,...,2n\} $$ - - $$Binding : \big\{S\big\} \longrightarrow \big\{ R \big\},$$ - - - $$if \ \exists \ Binding^{-1} : \big\{R \big\} \longrightarrow \big\{\{1,...,n\} \longrightarrow \{1,...,m\}\big\}\ that$$ - - $$\forall i \in \{1,...,n\} Binding(R)(i) = Binding(Binding^{-1}(Binding(R)) )(i)$$ - - - $$Start(S)(i) = max(\big\{j \in Z \big|S_{cycled}(j) = S(i) \land j \leq i-1 \big\})$$ - - $$Start^{-1}(R)(i) = \Bigg\{\begin{array}{l} \big|\big| & if \ R(i) \leq 0 \\ Start^{-1}(R, R(i)) & otherwise \end{array}$$ - - $$End(S)(i) = min(\big\{j \in Z \big|S_{cycled}(j) = S(i) \land j \geq i+1 \big\}$$ - - $$End^{-1}(R)(i) = \Bigg\{\begin{array}{l} \big|\big| & if \ R(i) \geq n+1 \\ End^{-1}(R, R(i)) & otherwise \end{array}$$ - - Lemma: - - $$\forall S : \{1,...,n\} \longrightarrow X, \ \forall i \in \{1,..n\} \Big| 1 \leq |\ Start(S)(i) - i\ | \leq n \land 1 \leq | End(S)(i) - i\ | \leq n$$ - - - Let $Mode$ is __Mode__ - - $$Mode : \big\{ \{1,...,n\} \longrightarrow \{-n,...,2n\} \big\} \longrightarrow \big\{ \{1,...,n\} \longrightarrow \{1,...,n\} \big\}$$ - - Define - - $$Cycle(R)(i) = \Bigg\{\begin{array}{l} R(i) - i & , R(j) > j \ | \ \forall j \in \{1,..,n\} \\ i - R(i) & , R(j) < j \ | \ \forall j \in \{1,..,n\}\end{array}$$ - - $$Cycle^{-1}(IO)(i) = \Bigg\{\begin{array}{l} i - IO(i) & , \exists j \in \{1,..,n\} | IO(j) > j \\ i + IO(i) & , \exists j \in \{1,..,n\} | IO(j) > n - j \end{array}$$ - - $$Boundary(R)(i) = \Bigg\{\begin{array}{l} i & , R(i) < 1 \\ Cycle(R)(i) & , 1 \leq R(i) \leq n \\ n - i + 1 & , R(i) > n \end{array}$$ - - $$Boundary^{-1}(IO)(i) = \Bigg\{\begin{array}{l} i - IO(i) & , \exists j \in \{1,..,n\} | IO(j) = j \\ i + IO(i) & , \exists j \in \{1,..,n\} | IO(j) = n - j +1\end{array}$$ - - - - $$Binding : M \times \big\{S\big\} \longrightarrow \big\{ \big\},$$ - - - $$if \ \exists \ Binding^{-1} : M \times \big\{R \big\} \longrightarrow \big\{\{1,...,n\} \longrightarrow \{1,...,m\}\big\}\ that$$ - - $$\forall i \in \{1,...,n\} Binding(mo, R)(i) = Binding(mo, R)( Binding^{-1}(mo, Binding(mo, R)) )(i)$$ - - $$Start(S)(i) = \Bigg\{\begin{array}{l} max \big\{j \in \{1,..., i - 1\}\big|S(j) = S(i) \big\} & if \ exists \\ m(S, i) & otherwise \end{array}$$ - - $$Start^{-1}(P)(i) = \Bigg\{\begin{array}{l} \big|\big| & if \ P(i)=0 \\ Start^{-1}(P, P(i)) & otherwise \end{array}$$ - - $$End(S)(i) = \Bigg\{\begin{array}{l} min \big\{j \in \{i+1,..., n\}\big|S(j) = S(i) \big\} & if \ exists \\ n+1 & \ otherwise \end{array}$$ - - $$End^{-1}(P)(i) = \Bigg\{\begin{array}{l} \big|\big| & if \ P(i)=n+1 \\ End^{-1}(P, P(i)) & otherwise \end{array}$$ - - Define $B = \{ Start, End \} \subset \{ Binding \}$ - - - - - - -## Examples - -=== "$Start$ binding" - - ``` mermaid - block-beta - columns 8 - p0["0"] p1["1"] space:3 p5["5"] p6["n"] p7["n + 1"] - inf["⊥"] s1["A"] s2["C"] s3["T"] s4["C"] s5["A"] s6["G"] sup["⊥"] - e0["0 = Start(1)"]:2 space:6 - space t1["1 = Start(5)"]:5 space:2 - - classDef imaginary fill:#526cfe09,color:#000,stroke-dasharray: 10 5; - classDef position fill:#fff,color:#000,stroke-width:0px; - class inf,sup imaginary - class p0,p1,p5,p6,p7 position - - classDef c1 fill:#ff7f0e,color:#fff; - classDef c2 fill:#ffbb78,color:#000; - classDef c2a fill:#ffbb788a,color:#000; - classDef c3 fill:#2ca02c,color:#fff; - classDef c4 fill:#98df8a,color:#000; - classDef c4a fill:#98df8a8a,color:#000; - classDef c5 fill:#d62728,color:#fff; - classDef c6 fill:#ff9896,color:#000; - classDef c6a fill:#ff98968a,color:#000; - classDef c7 fill:#9467bd,color:#fff; - classDef c8 fill:#c5b0d5,color:#000; - classDef c9 fill:#8c564b,color:#fff; - classDef c10 fill:#c49c94,color:#000; - classDef c11 fill:#e377c2,color:#fff; - classDef c12 fill:#f7b6d2,color:#000; - classDef c13 fill:#bcbd22,color:#fff; - classDef c14 fill:#dbdb8d,color:#000; - classDef c14a fill:#dbdb8d8a,color:#000; - classDef c15 fill:#17becf,color:#fff; - classDef c16 fill:#9edae5,color:#000; - - class s1,s5 c4 - class inf,t1,e0 c4a - class pomn,p00,p01,p06,p07,p02n position - class t1,t2,t5,e0,e1 position - - ``` - -=== "$End$ binding" - - ``` mermaid - block-beta - columns 8 - p0["0"] p1["1"] space:3 p5["5"] p6["n"] p7["n + 1"] - inf["⊥"] s1["A"] s2["C"] s3["T"] s4["C"] s5["A"] s6["G"] sup["⊥"] - space t1["End(1) = 5"]:5 space:2 - space:5 e0["End(5) = n+1"]:3 - - classDef imaginary fill:#526cfe09,color:#000,stroke-dasharray: 10 5; - classDef position fill:#fff,color:#000,stroke-width:0px; - class inf,sup imaginary - class p0,p1,p5,p6,p7 position - - classDef c1 fill:#ff7f0e,color:#fff; - classDef c2 fill:#ffbb78,color:#000; - classDef c2a fill:#ffbb788a,color:#000; - classDef c3 fill:#2ca02c,color:#fff; - classDef c4 fill:#98df8a,color:#000; - classDef c4a fill:#98df8a8a,color:#000; - classDef c5 fill:#d62728,color:#fff; - classDef c6 fill:#ff9896,color:#000; - classDef c6a fill:#ff98968a,color:#000; - classDef c7 fill:#9467bd,color:#fff; - classDef c8 fill:#c5b0d5,color:#000; - classDef c9 fill:#8c564b,color:#fff; - classDef c10 fill:#c49c94,color:#000; - classDef c11 fill:#e377c2,color:#fff; - classDef c12 fill:#f7b6d2,color:#000; - classDef c13 fill:#bcbd22,color:#fff; - classDef c14 fill:#dbdb8d,color:#000; - classDef c14a fill:#dbdb8d8a,color:#000; - classDef c15 fill:#17becf,color:#fff; - classDef c16 fill:#9edae5,color:#000; - - class s1,s5 c4 - class sup,t1,e0 c4a - class pomn,p00,p01,p06,p07,p02n position - class t1,t2,t5,e0,e1 position - - ``` diff --git a/docs/fundamentals/objects/index_set.md b/docs/fundamentals/objects/index_set.md deleted file mode 100644 index 2d9b9c7c..00000000 --- a/docs/fundamentals/objects/index_set.md +++ /dev/null @@ -1,17 +0,0 @@ -# Index set - -A _index set_ $J$ is a _set_ of natrual numbers from 1 to $n$ - -## Mathematical Definition - -$$\forall n \in N \exists J = \{1, ... n \} \subset N$$ - -## Examples - -### Binary Sequence - -$J = \{1, 2, 3, 4, 5, 6, 7, 8, 9, 10\}$ - -$J = \{1\}$ - -$J = \{1, 2, 3, 4\}$ diff --git a/docs/fundamentals/objects/interval.md b/docs/fundamentals/objects/interval.md deleted file mode 100644 index d36e976e..00000000 --- a/docs/fundamentals/objects/interval.md +++ /dev/null @@ -1,23 +0,0 @@ -# Interval - -An __interval__ is a natural number representing the count of different elements that occur between reseated elements in a sequence + 1. - -## Mathematical Definition - -Let _interval_ $i \in N \backslash \{0\}$ - - -## Examples - -The intervals for symbol `A` in the following sequence would be `2 + 1 = 3` -``` mermaid -block-beta - columns 6 - s1["A"] s2["C"] s3["T"] s4["A"] s5["C"] s6["G"] - i1["3"]:3 - - classDef c3 fill:#2ca02c,color:#fff; - classDef c4 fill:#98df8a,color:#000; - class s1,s4,s7,s8,s9,s11,s12 c3 - class i1,i2,i3,i4,i5,i6,i7 c4 -``` diff --git a/docs/fundamentals/objects/mode.md b/docs/fundamentals/objects/mode.md deleted file mode 100644 index 4211559f..00000000 --- a/docs/fundamentals/objects/mode.md +++ /dev/null @@ -1,296 +0,0 @@ -# Mode - -The _mode_ determines the method for computing intervals between occurrences of equivalent elements. - -## Boundary - -The $boundary$ mode extends the sequence with `imaginary` elements - `Infimum` ($Inf$) and `Supremum` ($Sup$ ), -which are equal to any element of the sequence. `Infimum` element placed on $0$ position and `Supremum` on $n+1$ position of the sequence. - -=== "$Start$ binding" - - ``` mermaid - block-beta - columns 8 - p0["0"] p1["1"] space:4 p6["n"] p7["n + 1"] - inf["⊥"] s1["A"] s2["C"] s3["T"] s4["C"] s5["A"] s6["G"] sup["⊥"] - infa["⊥"] ia1["1"]:1 space:6 - infc["⊥"] ic1["2"]:2 space:5 - inft["⊥"] it1["3"]:3 space:4 - infg["⊥"] ig1["6"]:6 space:1 - - classDef imaginary fill:#526cfe09,color:#000,stroke-dasharray: 10 5; - classDef position fill:#fff,color:#000,stroke-width:0px; - class inf,sup imaginary - class p0,p1,p6,p7 position - - classDef c1 fill:#ff7f0e,color:#fff; - classDef c2 fill:#ffbb78,color:#000; - classDef c2a fill:#ffbb788a,color:#000; - classDef c3 fill:#2ca02c,color:#fff; - classDef c4 fill:#98df8a,color:#000; - classDef c4a fill:#98df8a8a,color:#000; - classDef c5 fill:#d62728,color:#fff; - classDef c6 fill:#ff9896,color:#000; - classDef c6a fill:#ff98968a,color:#000; - classDef c7 fill:#9467bd,color:#fff; - classDef c8 fill:#c5b0d5,color:#000; - classDef c9 fill:#8c564b,color:#fff; - classDef c10 fill:#c49c94,color:#000; - classDef c11 fill:#e377c2,color:#fff; - classDef c12 fill:#f7b6d2,color:#000; - classDef c13 fill:#bcbd22,color:#fff; - classDef c14 fill:#dbdb8d,color:#000; - classDef c14a fill:#dbdb8d8a,color:#000; - classDef c15 fill:#17becf,color:#fff; - classDef c16 fill:#9edae5,color:#000; - - class s1,ia1 c2 - class infa c2a - class s2,ic1 c4 - class infc c4a - class s3,it1 c6 - class inft c6a - class s6,ig1 c14 - class infg c14a - class p1,p2,p3,p4,p5,p6,p7,p8,p9,f1,f2,f3,f4,f5,f6,f7,f8,f9 imaginary - class pomn,p00,p01,p06,p07,p02n position - - ``` - -=== "$End$ binding" - - ``` mermaid - block-beta - columns 8 - p0["0"] p1["1"] space:4 p6["n"] p7["n + 1"] - inf["Infimum"] s1["A"] s2["C"] s3["T"] s4["C"] s5["A"] s6["G"] sup["Supremum"] - space:5 ia1["2"]:2 supa["Supremum"] - space:4 ic1["3"]:3 supc["Supremum"] - space:3 it1["4"]:4 supt["Supremum"] - space:6 ig1["1"]:1 supg["Supremum"] - - classDef imaginary fill:#526cfe09,color:#000,stroke-dasharray: 10 5; - classDef position fill:#fff,color:#000,stroke-width:0px; - class inf,sup imaginary - class p0,p1,p6,p7 position - - classDef c1 fill:#ff7f0e,color:#fff; - classDef c2 fill:#ffbb78,color:#000; - classDef c2a fill:#ffbb788a,color:#000; - classDef c3 fill:#2ca02c,color:#fff; - classDef c4 fill:#98df8a,color:#000; - classDef c4a fill:#98df8a8a,color:#000; - classDef c5 fill:#d62728,color:#fff; - classDef c6 fill:#ff9896,color:#000; - classDef c6a fill:#ff98968a,color:#000; - classDef c7 fill:#9467bd,color:#fff; - classDef c8 fill:#c5b0d5,color:#000; - classDef c9 fill:#8c564b,color:#fff; - classDef c10 fill:#c49c94,color:#000; - classDef c11 fill:#e377c2,color:#fff; - classDef c12 fill:#f7b6d2,color:#000; - classDef c13 fill:#bcbd22,color:#fff; - classDef c14 fill:#dbdb8d,color:#000; - classDef c14a fill:#dbdb8d8a,color:#000; - classDef c15 fill:#17becf,color:#fff; - classDef c16 fill:#9edae5,color:#000; - - class s5,ia1 c2 - class supa c2a - class s4,ic1 c4 - class supc c4a - class s3,it1 c6 - class supt c6a - class s6,ig1 c14 - class supg c14a - class p1,p2,p3,p4,p5,p6,p7,p8,p9,f1,f2,f3,f4,f5,f6,f7,f8,f9 imaginary - class pomn,p00,p01,p06,p07,p02n position - ``` - - -## Cycle - -In the $cycle$ mode, the sequence is extended by copying itself as an `imaginary` prefix/suffix to mock a cycled sequence (also known as a periodic sequence or an orbit). The first/last interval counts to the previous/following element in `imaginary` prefix/suffix. - - -=== "$Start$ binding" - - ``` mermaid - block-beta - columns 18 - pomn["-n"] space:4 p00["0"] p01["1"] space:4 p06["n"] p07["n + 1"] space:4 p02n["n + n"] - p1["A"] p2["C"] p3["T"] p4["C"] p5["A"] p6["G"] s1["A"] s2["C"] s3["T"] s4["C"] s5["A"] s6["G"] f1["A"] f2["C"] f3["T"] f4["C"] f5["A"] f6["G"] - space:5 ia1["2"]:2 space:11 - space:4 ic1["4"]:4 space:10 - space:3 it1["6"]:6 space:9 - space:6 ig1["6"]:6 space:6 - - classDef imaginary fill:#526cfe09,color:#000,stroke-dasharray: 10 5; - classDef position fill:#fff,color:#000,stroke-width:0px; - - classDef c1 fill:#ff7f0e,color:#fff; - classDef c2 fill:#ffbb78,color:#000; - classDef c2a fill:#ffbb788a,color:#000; - classDef c3 fill:#2ca02c,color:#fff; - classDef c4 fill:#98df8a,color:#000; - classDef c4a fill:#98df8a8a,color:#000; - classDef c5 fill:#d62728,color:#fff; - classDef c6 fill:#ff9896,color:#000; - classDef c6a fill:#ff98968a,color:#000; - classDef c7 fill:#9467bd,color:#fff; - classDef c8 fill:#c5b0d5,color:#000; - classDef c9 fill:#8c564b,color:#fff; - classDef c10 fill:#c49c94,color:#000; - classDef c11 fill:#e377c2,color:#fff; - classDef c12 fill:#f7b6d2,color:#000; - classDef c13 fill:#bcbd22,color:#fff; - classDef c14 fill:#dbdb8d,color:#000; - classDef c14a fill:#dbdb8d8a,color:#000; - classDef c15 fill:#17becf,color:#fff; - classDef c16 fill:#9edae5,color:#000; - - class s1,ia1 c2 - class p5 c2a - class s2,ic1 c4 - class p4 c4a - class s3,it1 c6 - class p3 c6a - class s6,ig1 c14 - class p6 c14a - class p1,p2,p3,p4,p5,p6,p7,p8,p9,f1,f2,f3,f4,f5,f6,f7,f8,f9 imaginary - class pomn,p00,p01,p06,p07,p02n position - - ``` - -=== "$End$ binding" - - ``` mermaid - block-beta - columns 18 - pomn["-n"] space:4 p00["0"] p01["1"] space:4 p06["n"] p07["n + 1"] space:4 p02n["n + n"] - p1["A"] p2["C"] p3["T"] p4["C"] p5["A"] p6["G"] s1["A"] s2["C"] s3["T"] s4["C"] s5["A"] s6["G"] f1["A"] f2["C"] f3["T"] f4["C"] f5["A"] f6["G"] - space:10 ia1["2"]:2 space:6 - space:9 ic1["4"]:4 space:5 - space:8 it1["6"]:6 space:5 - space:10 ig1["6"]:6 space:1 - - classDef imaginary fill:#526cfe09,color:#000,stroke-dasharray: 10 5; - classDef position fill:#fff,color:#000,stroke-width:0px; - - classDef c1 fill:#ff7f0e,color:#fff; - classDef c2 fill:#ffbb78,color:#000; - classDef c2a fill:#ffbb788a,color:#000; - classDef c3 fill:#2ca02c,color:#fff; - classDef c4 fill:#98df8a,color:#000; - classDef c4a fill:#98df8a8a,color:#000; - classDef c5 fill:#d62728,color:#fff; - classDef c6 fill:#ff9896,color:#000; - classDef c6a fill:#ff98968a,color:#000; - classDef c7 fill:#9467bd,color:#fff; - classDef c8 fill:#c5b0d5,color:#000; - classDef c9 fill:#8c564b,color:#fff; - classDef c10 fill:#c49c94,color:#000; - classDef c11 fill:#e377c2,color:#fff; - classDef c12 fill:#f7b6d2,color:#000; - classDef c13 fill:#bcbd22,color:#fff; - classDef c14 fill:#dbdb8d,color:#000; - classDef c14a fill:#dbdb8d8a,color:#000; - classDef c15 fill:#17becf,color:#fff; - classDef c16 fill:#9edae5,color:#000; - - class s5,ia1 c2 - class f1 c2a - class s4,ic1 c4 - class f2 c4a - class s3,it1 c6 - class f3 c6a - class s6,ig1 c14 - class f6 c14a - class p1,p2,p3,p4,p5,p6,p7,p8,p9,f1,f2,f3,f4,f5,f6,f7,f8,f9 imaginary - class pomn,p00,p01,p06,p07,p02n position - - ``` - -The $cycle$ mode is inspired and aligned with the idea of representativeness heuristic, which is fundamental in probability and statistics, and the Necklace problems in combinatorics. - -At the same time, the $boundary$ mode looks like related to tree structures and graph theory. - -## Mathematical Definition - -=== "Current" - - Let $X$ is [_Carrier set_](./carrier_set.md#Mathematical Definition) - - Let $S$ is [_Sequence_](./sequence.md#Mathematical Definition) length of $n$ described as function $S : \{1,...,n\} \longrightarrow X$ - - Let $B = \{Start, End\}$ is [_Binding_](./binding.md#Mathematical Definition) - - - Define - - Let $IO$ is n-tuple described as function $IO : \{1,...,n\} \longrightarrow \{1,...,n\}$ - - $$Mode : B \times \big\{ S \big\} \longrightarrow \big\{ IO \big\}, $$ - - $$if \ \exists \ Mode^{-1} : B \times \big\{ IO \big\} \longrightarrow \big\{\{1,...,n\} \longrightarrow \{1,...,m\}\big\}\ that$$ - - $$\forall i \in \{1,...,n\} \ m=Mode(b),\ m^{-1}=Mode(b)^{-1}, m(S)(i) = m(m^{-1}(m(S)))(i)$$ - - - $$Boundary(b, S)(i) = \big| i - b(S)(i) \big|$$ - - $$Boundary^{-1}(b, IO)(i) = \Bigg\{\begin{array}{l} b^{-1}(IO(i) - i)(i) & if \ exists \\ 0 & otherwise \end{array}$$ - - $$S_{cycled} : \big\{ \{1,...,n\} \longrightarrow X \big\} \longrightarrow \big\{ \{1,...,3 \times n\} \longrightarrow X \big\}$$ - - $$S_{cycled}(S)(i) = S\big( i - n \times \lfloor ( i - 1) \div n \rfloor \big)$$ - - $$Cycle(b, S)(i) = Boundary(b,\ S_{cycled}(S))(i+n)$$ - - - - Define _mode_ $M = \{ Boundary, Cycle \} \subset \{ Mode \}$ - - - -=== "New" - - Let $P$ is [_Interator positions_](./binding.md#Mathematical Definition) length of $n$ described as function $P : \{1,...,n\} \longrightarrow \{0,...,n+1\}$ - - Define - - - - $$Mode : \big\{ \{1,...,n\} \longrightarrow \{0,...,n+1\} \big\} \longrightarrow \big\{ \{1,...,n\} \longrightarrow \{1,...,n\} \big\}, $$ - - $$if \ \exists \ Mode^{-1} : \big\{ \{1,...,n\} \longrightarrow \{1,...,n\} \big\} \longrightarrow \big\{\{1,...,n\} \longrightarrow \{0,...,n+1\}\big\}\ that$$ - - $$\forall i \in \{1,...,n\} \ Mode(P)(i) = Mode(Mode^{-1}(Mode(P)))(i)$$ - - - $$Boundary(P)(i) = \big| i - P(i) \big|$$ - - $$Boundary^{-1}(IO)(i) = \Bigg\{\begin{array}{l} i - IO(i) & \ \exists \ j \in \{1,...,n\} | IO(j) = j \\ i + IO(i) & \ \exists \ j \in \{1,...,n\} | IO(j) = n + 1 - j \end{array}$$ - - $$P_{cycled} : \big\{ \{1,...,n\} \longrightarrow \{0,...,n+1\} \big\} \longrightarrow \big\{ \{1,...,3 \times n\} \longrightarrow \{0,...,n+1\} \big\}$$ - - $$P_{cycled}(S)(i) = \Bigg\{\begin{array}{l} P(i) &, \lfloor ( i - 1) \div n \rfloor = 0 \\ ??? &, \lfloor ( i - 1) \div n \rfloor = 1 \end{array}$$ - - $$Cycle(b, S)(i) = Boundary(b,\ S_{cycled}(S))(i+n)$$ - - - - Define _mode_ $M = \{ Boundary, Cycle \} \subset \{ Mode \}$ diff --git a/docs/fundamentals/objects/mode/bounded.md b/docs/fundamentals/objects/mode/bounded.md deleted file mode 100644 index 7684e606..00000000 --- a/docs/fundamentals/objects/mode/bounded.md +++ /dev/null @@ -1,269 +0,0 @@ -# Mode - -The _mode_ determines the method for computing intervals for the first or last appearances of the element. -There is uncertainty about how to count the interval for the first appearance with $start$ binding and -for the last appearance with $end$ binding, as there is no previous or following element appearance in the corresponding cases. - -This interval can be skipped or counted to some `imaginary` appearance of the element. - -The skipping option leads to cons that make reverse operation impossible in the general case - -count of intervals less than the count of elements in the initial sequence, -and/or intervals n-tuple contains `empty` elements. That's why the _mode_ does not have any value -corresponding to any kind of skip first/last interval. - -You can use `lossy` function defined in [Interval Order to Interval Tuple](./intervals_distribution.md) section to exclude the first/last interval that would be equivalent to the skipping approach. - -The _mode_ defines values that assume different ways of `imaginary` elements - $boundary$ and $cycle$. -The `imaginary` elements can be used as `previous` or `following` reference for any element of the sequence, -but do not produce any interval for their own. However, you can use `redundant` function defined in - -[Interval Order to Interval Tuple](./intervals_distribution.md) section to count intervals produced for `imaginary` elements. - -## Boundary - -The $boundary$ mode extends the sequence with `imaginary` elements - `Infimum` ($Inf$) and `Supremum` ($Sup$ ), -which are equal to any element of the sequence. `Infimum` element placed on $0$ position and `Supremum` on $n+1$ position of the sequence. - -=== "$Start$ binding" - - ``` mermaid - block-beta - columns 8 - p0["0"] p1["1"] space:4 p6["n"] p7["n + 1"] - inf["⊥"] s1["A"] s2["C"] s3["T"] s4["C"] s5["A"] s6["G"] sup["⊥"] - infa["⊥"] ia1["1"]:1 space:6 - infc["⊥"] ic1["2"]:2 space:5 - inft["⊥"] it1["3"]:3 space:4 - infg["⊥"] ig1["6"]:6 space:1 - - classDef imaginary fill:#526cfe09,color:#000,stroke-dasharray: 10 5; - classDef position fill:#fff,color:#000,stroke-width:0px; - class inf,sup imaginary - class p0,p1,p6,p7 position - - classDef c1 fill:#ff7f0e,color:#fff; - classDef c2 fill:#ffbb78,color:#000; - classDef c2a fill:#ffbb788a,color:#000; - classDef c3 fill:#2ca02c,color:#fff; - classDef c4 fill:#98df8a,color:#000; - classDef c4a fill:#98df8a8a,color:#000; - classDef c5 fill:#d62728,color:#fff; - classDef c6 fill:#ff9896,color:#000; - classDef c6a fill:#ff98968a,color:#000; - classDef c7 fill:#9467bd,color:#fff; - classDef c8 fill:#c5b0d5,color:#000; - classDef c9 fill:#8c564b,color:#fff; - classDef c10 fill:#c49c94,color:#000; - classDef c11 fill:#e377c2,color:#fff; - classDef c12 fill:#f7b6d2,color:#000; - classDef c13 fill:#bcbd22,color:#fff; - classDef c14 fill:#dbdb8d,color:#000; - classDef c14a fill:#dbdb8d8a,color:#000; - classDef c15 fill:#17becf,color:#fff; - classDef c16 fill:#9edae5,color:#000; - - class s1,ia1 c2 - class infa c2a - class s2,ic1 c4 - class infc c4a - class s3,it1 c6 - class inft c6a - class s6,ig1 c14 - class infg c14a - class p1,p2,p3,p4,p5,p6,p7,p8,p9,f1,f2,f3,f4,f5,f6,f7,f8,f9 imaginary - class pomn,p00,p01,p06,p07,p02n position - - ``` - -=== "$End$ binding" - - ``` mermaid - block-beta - columns 8 - p0["0"] p1["1"] space:4 p6["n"] p7["n + 1"] - inf["Infimum"] s1["A"] s2["C"] s3["T"] s4["C"] s5["A"] s6["G"] sup["Supremum"] - space:5 ia1["2"]:2 supa["Supremum"] - space:4 ic1["3"]:3 supc["Supremum"] - space:3 it1["4"]:4 supt["Supremum"] - space:6 ig1["1"]:1 supg["Supremum"] - - classDef imaginary fill:#526cfe09,color:#000,stroke-dasharray: 10 5; - classDef position fill:#fff,color:#000,stroke-width:0px; - class inf,sup imaginary - class p0,p1,p6,p7 position - - classDef c1 fill:#ff7f0e,color:#fff; - classDef c2 fill:#ffbb78,color:#000; - classDef c2a fill:#ffbb788a,color:#000; - classDef c3 fill:#2ca02c,color:#fff; - classDef c4 fill:#98df8a,color:#000; - classDef c4a fill:#98df8a8a,color:#000; - classDef c5 fill:#d62728,color:#fff; - classDef c6 fill:#ff9896,color:#000; - classDef c6a fill:#ff98968a,color:#000; - classDef c7 fill:#9467bd,color:#fff; - classDef c8 fill:#c5b0d5,color:#000; - classDef c9 fill:#8c564b,color:#fff; - classDef c10 fill:#c49c94,color:#000; - classDef c11 fill:#e377c2,color:#fff; - classDef c12 fill:#f7b6d2,color:#000; - classDef c13 fill:#bcbd22,color:#fff; - classDef c14 fill:#dbdb8d,color:#000; - classDef c14a fill:#dbdb8d8a,color:#000; - classDef c15 fill:#17becf,color:#fff; - classDef c16 fill:#9edae5,color:#000; - - class s5,ia1 c2 - class supa c2a - class s4,ic1 c4 - class supc c4a - class s3,it1 c6 - class supt c6a - class s6,ig1 c14 - class supg c14a - class p1,p2,p3,p4,p5,p6,p7,p8,p9,f1,f2,f3,f4,f5,f6,f7,f8,f9 imaginary - class pomn,p00,p01,p06,p07,p02n position - ``` - - -## Cycle - -In the $cycle$ mode, the sequence is extended by copying itself as an `imaginary` prefix/suffix to mock a cycled sequence (also known as a periodic sequence or an orbit). The first/last interval counts to the previous/following element in `imaginary` prefix/suffix. - - -=== "$Start$ binding" - - ``` mermaid - block-beta - columns 18 - pomn["-n"] space:4 p00["0"] p01["1"] space:4 p06["n"] p07["n + 1"] space:4 p02n["n + n"] - p1["A"] p2["C"] p3["T"] p4["C"] p5["A"] p6["G"] s1["A"] s2["C"] s3["T"] s4["C"] s5["A"] s6["G"] f1["A"] f2["C"] f3["T"] f4["C"] f5["A"] f6["G"] - space:5 ia1["2"]:2 space:11 - space:4 ic1["4"]:4 space:10 - space:3 it1["6"]:6 space:9 - space:6 ig1["6"]:6 space:6 - - classDef imaginary fill:#526cfe09,color:#000,stroke-dasharray: 10 5; - classDef position fill:#fff,color:#000,stroke-width:0px; - - classDef c1 fill:#ff7f0e,color:#fff; - classDef c2 fill:#ffbb78,color:#000; - classDef c2a fill:#ffbb788a,color:#000; - classDef c3 fill:#2ca02c,color:#fff; - classDef c4 fill:#98df8a,color:#000; - classDef c4a fill:#98df8a8a,color:#000; - classDef c5 fill:#d62728,color:#fff; - classDef c6 fill:#ff9896,color:#000; - classDef c6a fill:#ff98968a,color:#000; - classDef c7 fill:#9467bd,color:#fff; - classDef c8 fill:#c5b0d5,color:#000; - classDef c9 fill:#8c564b,color:#fff; - classDef c10 fill:#c49c94,color:#000; - classDef c11 fill:#e377c2,color:#fff; - classDef c12 fill:#f7b6d2,color:#000; - classDef c13 fill:#bcbd22,color:#fff; - classDef c14 fill:#dbdb8d,color:#000; - classDef c14a fill:#dbdb8d8a,color:#000; - classDef c15 fill:#17becf,color:#fff; - classDef c16 fill:#9edae5,color:#000; - - class s1,ia1 c2 - class p5 c2a - class s2,ic1 c4 - class p4 c4a - class s3,it1 c6 - class p3 c6a - class s6,ig1 c14 - class p6 c14a - class p1,p2,p3,p4,p5,p6,p7,p8,p9,f1,f2,f3,f4,f5,f6,f7,f8,f9 imaginary - class pomn,p00,p01,p06,p07,p02n position - - ``` - -=== "$End$ binding" - - ``` mermaid - block-beta - columns 18 - pomn["-n"] space:4 p00["0"] p01["1"] space:4 p06["n"] p07["n + 1"] space:4 p02n["n + n"] - p1["A"] p2["C"] p3["T"] p4["C"] p5["A"] p6["G"] s1["A"] s2["C"] s3["T"] s4["C"] s5["A"] s6["G"] f1["A"] f2["C"] f3["T"] f4["C"] f5["A"] f6["G"] - space:10 ia1["2"]:2 space:6 - space:9 ic1["4"]:4 space:5 - space:8 it1["6"]:6 space:5 - space:10 ig1["6"]:6 space:1 - - classDef imaginary fill:#526cfe09,color:#000,stroke-dasharray: 10 5; - classDef position fill:#fff,color:#000,stroke-width:0px; - - classDef c1 fill:#ff7f0e,color:#fff; - classDef c2 fill:#ffbb78,color:#000; - classDef c2a fill:#ffbb788a,color:#000; - classDef c3 fill:#2ca02c,color:#fff; - classDef c4 fill:#98df8a,color:#000; - classDef c4a fill:#98df8a8a,color:#000; - classDef c5 fill:#d62728,color:#fff; - classDef c6 fill:#ff9896,color:#000; - classDef c6a fill:#ff98968a,color:#000; - classDef c7 fill:#9467bd,color:#fff; - classDef c8 fill:#c5b0d5,color:#000; - classDef c9 fill:#8c564b,color:#fff; - classDef c10 fill:#c49c94,color:#000; - classDef c11 fill:#e377c2,color:#fff; - classDef c12 fill:#f7b6d2,color:#000; - classDef c13 fill:#bcbd22,color:#fff; - classDef c14 fill:#dbdb8d,color:#000; - classDef c14a fill:#dbdb8d8a,color:#000; - classDef c15 fill:#17becf,color:#fff; - classDef c16 fill:#9edae5,color:#000; - - class s5,ia1 c2 - class f1 c2a - class s4,ic1 c4 - class f2 c4a - class s3,it1 c6 - class f3 c6a - class s6,ig1 c14 - class f6 c14a - class p1,p2,p3,p4,p5,p6,p7,p8,p9,f1,f2,f3,f4,f5,f6,f7,f8,f9 imaginary - class pomn,p00,p01,p06,p07,p02n position - - ``` - -The $cycle$ mode is inspired and aligned with the idea of representativeness heuristic, which is fundamental in probability and statistics, and the Necklace problems in combinatorics. - -At the same time, the $boundary$ mode looks like related to tree structures and graph theory. - -## Mathematical Definition - -Let $X$ is [_Carrier set_](./carrier_set.md#Mathematical Definition) - -Let $S$ is [_Sequence_](./sequence.md#Mathematical Definition) length of $n$ described as function $S : \{1,...,n\} \longrightarrow X$ - -Let $\bot \notin X$ is a special _sentinel_ value. - -Define $X_\bot = X \cup \{ \bot \}$ set - -$\forall S \ \exists \ S_{\bot} : J \longrightarrow X_{\bot} \Big| \{1,...,n\} \subset J$ - -Define $Mode : S \longrightarrow S_{\bot}$ - -$\forall S \exists S_{boundary} : \{0,...,n+1\} \longrightarrow X_\bot$ - -Define $boundary : S \longrightarrow S_{boundary}, boundary(s)(i) = \Biggl\{ \begin{array}{l} Inf, i=0 \\ s(i), 1 \le i \le n \\ Sup, i = n+1\end{array}$ - - -$\forall S \exists S_{cycle} : Z \longrightarrow X_\bot$ - - - - - -Define $cycle : S \longrightarrow S_{cycle}, cycle(s)(i) = s\big( i - n \times \lfloor ( i - 1) \div n \rfloor \big) \Big| n = |s|$ - -Define _mode_ $M = \{ boundary, cycle \}$ diff --git a/docs/fundamentals/objects/mode/cycle.md b/docs/fundamentals/objects/mode/cycle.md deleted file mode 100644 index 7684e606..00000000 --- a/docs/fundamentals/objects/mode/cycle.md +++ /dev/null @@ -1,269 +0,0 @@ -# Mode - -The _mode_ determines the method for computing intervals for the first or last appearances of the element. -There is uncertainty about how to count the interval for the first appearance with $start$ binding and -for the last appearance with $end$ binding, as there is no previous or following element appearance in the corresponding cases. - -This interval can be skipped or counted to some `imaginary` appearance of the element. - -The skipping option leads to cons that make reverse operation impossible in the general case - -count of intervals less than the count of elements in the initial sequence, -and/or intervals n-tuple contains `empty` elements. That's why the _mode_ does not have any value -corresponding to any kind of skip first/last interval. - -You can use `lossy` function defined in [Interval Order to Interval Tuple](./intervals_distribution.md) section to exclude the first/last interval that would be equivalent to the skipping approach. - -The _mode_ defines values that assume different ways of `imaginary` elements - $boundary$ and $cycle$. -The `imaginary` elements can be used as `previous` or `following` reference for any element of the sequence, -but do not produce any interval for their own. However, you can use `redundant` function defined in - -[Interval Order to Interval Tuple](./intervals_distribution.md) section to count intervals produced for `imaginary` elements. - -## Boundary - -The $boundary$ mode extends the sequence with `imaginary` elements - `Infimum` ($Inf$) and `Supremum` ($Sup$ ), -which are equal to any element of the sequence. `Infimum` element placed on $0$ position and `Supremum` on $n+1$ position of the sequence. - -=== "$Start$ binding" - - ``` mermaid - block-beta - columns 8 - p0["0"] p1["1"] space:4 p6["n"] p7["n + 1"] - inf["⊥"] s1["A"] s2["C"] s3["T"] s4["C"] s5["A"] s6["G"] sup["⊥"] - infa["⊥"] ia1["1"]:1 space:6 - infc["⊥"] ic1["2"]:2 space:5 - inft["⊥"] it1["3"]:3 space:4 - infg["⊥"] ig1["6"]:6 space:1 - - classDef imaginary fill:#526cfe09,color:#000,stroke-dasharray: 10 5; - classDef position fill:#fff,color:#000,stroke-width:0px; - class inf,sup imaginary - class p0,p1,p6,p7 position - - classDef c1 fill:#ff7f0e,color:#fff; - classDef c2 fill:#ffbb78,color:#000; - classDef c2a fill:#ffbb788a,color:#000; - classDef c3 fill:#2ca02c,color:#fff; - classDef c4 fill:#98df8a,color:#000; - classDef c4a fill:#98df8a8a,color:#000; - classDef c5 fill:#d62728,color:#fff; - classDef c6 fill:#ff9896,color:#000; - classDef c6a fill:#ff98968a,color:#000; - classDef c7 fill:#9467bd,color:#fff; - classDef c8 fill:#c5b0d5,color:#000; - classDef c9 fill:#8c564b,color:#fff; - classDef c10 fill:#c49c94,color:#000; - classDef c11 fill:#e377c2,color:#fff; - classDef c12 fill:#f7b6d2,color:#000; - classDef c13 fill:#bcbd22,color:#fff; - classDef c14 fill:#dbdb8d,color:#000; - classDef c14a fill:#dbdb8d8a,color:#000; - classDef c15 fill:#17becf,color:#fff; - classDef c16 fill:#9edae5,color:#000; - - class s1,ia1 c2 - class infa c2a - class s2,ic1 c4 - class infc c4a - class s3,it1 c6 - class inft c6a - class s6,ig1 c14 - class infg c14a - class p1,p2,p3,p4,p5,p6,p7,p8,p9,f1,f2,f3,f4,f5,f6,f7,f8,f9 imaginary - class pomn,p00,p01,p06,p07,p02n position - - ``` - -=== "$End$ binding" - - ``` mermaid - block-beta - columns 8 - p0["0"] p1["1"] space:4 p6["n"] p7["n + 1"] - inf["Infimum"] s1["A"] s2["C"] s3["T"] s4["C"] s5["A"] s6["G"] sup["Supremum"] - space:5 ia1["2"]:2 supa["Supremum"] - space:4 ic1["3"]:3 supc["Supremum"] - space:3 it1["4"]:4 supt["Supremum"] - space:6 ig1["1"]:1 supg["Supremum"] - - classDef imaginary fill:#526cfe09,color:#000,stroke-dasharray: 10 5; - classDef position fill:#fff,color:#000,stroke-width:0px; - class inf,sup imaginary - class p0,p1,p6,p7 position - - classDef c1 fill:#ff7f0e,color:#fff; - classDef c2 fill:#ffbb78,color:#000; - classDef c2a fill:#ffbb788a,color:#000; - classDef c3 fill:#2ca02c,color:#fff; - classDef c4 fill:#98df8a,color:#000; - classDef c4a fill:#98df8a8a,color:#000; - classDef c5 fill:#d62728,color:#fff; - classDef c6 fill:#ff9896,color:#000; - classDef c6a fill:#ff98968a,color:#000; - classDef c7 fill:#9467bd,color:#fff; - classDef c8 fill:#c5b0d5,color:#000; - classDef c9 fill:#8c564b,color:#fff; - classDef c10 fill:#c49c94,color:#000; - classDef c11 fill:#e377c2,color:#fff; - classDef c12 fill:#f7b6d2,color:#000; - classDef c13 fill:#bcbd22,color:#fff; - classDef c14 fill:#dbdb8d,color:#000; - classDef c14a fill:#dbdb8d8a,color:#000; - classDef c15 fill:#17becf,color:#fff; - classDef c16 fill:#9edae5,color:#000; - - class s5,ia1 c2 - class supa c2a - class s4,ic1 c4 - class supc c4a - class s3,it1 c6 - class supt c6a - class s6,ig1 c14 - class supg c14a - class p1,p2,p3,p4,p5,p6,p7,p8,p9,f1,f2,f3,f4,f5,f6,f7,f8,f9 imaginary - class pomn,p00,p01,p06,p07,p02n position - ``` - - -## Cycle - -In the $cycle$ mode, the sequence is extended by copying itself as an `imaginary` prefix/suffix to mock a cycled sequence (also known as a periodic sequence or an orbit). The first/last interval counts to the previous/following element in `imaginary` prefix/suffix. - - -=== "$Start$ binding" - - ``` mermaid - block-beta - columns 18 - pomn["-n"] space:4 p00["0"] p01["1"] space:4 p06["n"] p07["n + 1"] space:4 p02n["n + n"] - p1["A"] p2["C"] p3["T"] p4["C"] p5["A"] p6["G"] s1["A"] s2["C"] s3["T"] s4["C"] s5["A"] s6["G"] f1["A"] f2["C"] f3["T"] f4["C"] f5["A"] f6["G"] - space:5 ia1["2"]:2 space:11 - space:4 ic1["4"]:4 space:10 - space:3 it1["6"]:6 space:9 - space:6 ig1["6"]:6 space:6 - - classDef imaginary fill:#526cfe09,color:#000,stroke-dasharray: 10 5; - classDef position fill:#fff,color:#000,stroke-width:0px; - - classDef c1 fill:#ff7f0e,color:#fff; - classDef c2 fill:#ffbb78,color:#000; - classDef c2a fill:#ffbb788a,color:#000; - classDef c3 fill:#2ca02c,color:#fff; - classDef c4 fill:#98df8a,color:#000; - classDef c4a fill:#98df8a8a,color:#000; - classDef c5 fill:#d62728,color:#fff; - classDef c6 fill:#ff9896,color:#000; - classDef c6a fill:#ff98968a,color:#000; - classDef c7 fill:#9467bd,color:#fff; - classDef c8 fill:#c5b0d5,color:#000; - classDef c9 fill:#8c564b,color:#fff; - classDef c10 fill:#c49c94,color:#000; - classDef c11 fill:#e377c2,color:#fff; - classDef c12 fill:#f7b6d2,color:#000; - classDef c13 fill:#bcbd22,color:#fff; - classDef c14 fill:#dbdb8d,color:#000; - classDef c14a fill:#dbdb8d8a,color:#000; - classDef c15 fill:#17becf,color:#fff; - classDef c16 fill:#9edae5,color:#000; - - class s1,ia1 c2 - class p5 c2a - class s2,ic1 c4 - class p4 c4a - class s3,it1 c6 - class p3 c6a - class s6,ig1 c14 - class p6 c14a - class p1,p2,p3,p4,p5,p6,p7,p8,p9,f1,f2,f3,f4,f5,f6,f7,f8,f9 imaginary - class pomn,p00,p01,p06,p07,p02n position - - ``` - -=== "$End$ binding" - - ``` mermaid - block-beta - columns 18 - pomn["-n"] space:4 p00["0"] p01["1"] space:4 p06["n"] p07["n + 1"] space:4 p02n["n + n"] - p1["A"] p2["C"] p3["T"] p4["C"] p5["A"] p6["G"] s1["A"] s2["C"] s3["T"] s4["C"] s5["A"] s6["G"] f1["A"] f2["C"] f3["T"] f4["C"] f5["A"] f6["G"] - space:10 ia1["2"]:2 space:6 - space:9 ic1["4"]:4 space:5 - space:8 it1["6"]:6 space:5 - space:10 ig1["6"]:6 space:1 - - classDef imaginary fill:#526cfe09,color:#000,stroke-dasharray: 10 5; - classDef position fill:#fff,color:#000,stroke-width:0px; - - classDef c1 fill:#ff7f0e,color:#fff; - classDef c2 fill:#ffbb78,color:#000; - classDef c2a fill:#ffbb788a,color:#000; - classDef c3 fill:#2ca02c,color:#fff; - classDef c4 fill:#98df8a,color:#000; - classDef c4a fill:#98df8a8a,color:#000; - classDef c5 fill:#d62728,color:#fff; - classDef c6 fill:#ff9896,color:#000; - classDef c6a fill:#ff98968a,color:#000; - classDef c7 fill:#9467bd,color:#fff; - classDef c8 fill:#c5b0d5,color:#000; - classDef c9 fill:#8c564b,color:#fff; - classDef c10 fill:#c49c94,color:#000; - classDef c11 fill:#e377c2,color:#fff; - classDef c12 fill:#f7b6d2,color:#000; - classDef c13 fill:#bcbd22,color:#fff; - classDef c14 fill:#dbdb8d,color:#000; - classDef c14a fill:#dbdb8d8a,color:#000; - classDef c15 fill:#17becf,color:#fff; - classDef c16 fill:#9edae5,color:#000; - - class s5,ia1 c2 - class f1 c2a - class s4,ic1 c4 - class f2 c4a - class s3,it1 c6 - class f3 c6a - class s6,ig1 c14 - class f6 c14a - class p1,p2,p3,p4,p5,p6,p7,p8,p9,f1,f2,f3,f4,f5,f6,f7,f8,f9 imaginary - class pomn,p00,p01,p06,p07,p02n position - - ``` - -The $cycle$ mode is inspired and aligned with the idea of representativeness heuristic, which is fundamental in probability and statistics, and the Necklace problems in combinatorics. - -At the same time, the $boundary$ mode looks like related to tree structures and graph theory. - -## Mathematical Definition - -Let $X$ is [_Carrier set_](./carrier_set.md#Mathematical Definition) - -Let $S$ is [_Sequence_](./sequence.md#Mathematical Definition) length of $n$ described as function $S : \{1,...,n\} \longrightarrow X$ - -Let $\bot \notin X$ is a special _sentinel_ value. - -Define $X_\bot = X \cup \{ \bot \}$ set - -$\forall S \ \exists \ S_{\bot} : J \longrightarrow X_{\bot} \Big| \{1,...,n\} \subset J$ - -Define $Mode : S \longrightarrow S_{\bot}$ - -$\forall S \exists S_{boundary} : \{0,...,n+1\} \longrightarrow X_\bot$ - -Define $boundary : S \longrightarrow S_{boundary}, boundary(s)(i) = \Biggl\{ \begin{array}{l} Inf, i=0 \\ s(i), 1 \le i \le n \\ Sup, i = n+1\end{array}$ - - -$\forall S \exists S_{cycle} : Z \longrightarrow X_\bot$ - - - - - -Define $cycle : S \longrightarrow S_{cycle}, cycle(s)(i) = s\big( i - n \times \lfloor ( i - 1) \div n \rfloor \big) \Big| n = |s|$ - -Define _mode_ $M = \{ boundary, cycle \}$ diff --git a/docs/fundamentals/objects/mode/index.md b/docs/fundamentals/objects/mode/index.md deleted file mode 100644 index 7684e606..00000000 --- a/docs/fundamentals/objects/mode/index.md +++ /dev/null @@ -1,269 +0,0 @@ -# Mode - -The _mode_ determines the method for computing intervals for the first or last appearances of the element. -There is uncertainty about how to count the interval for the first appearance with $start$ binding and -for the last appearance with $end$ binding, as there is no previous or following element appearance in the corresponding cases. - -This interval can be skipped or counted to some `imaginary` appearance of the element. - -The skipping option leads to cons that make reverse operation impossible in the general case - -count of intervals less than the count of elements in the initial sequence, -and/or intervals n-tuple contains `empty` elements. That's why the _mode_ does not have any value -corresponding to any kind of skip first/last interval. - -You can use `lossy` function defined in [Interval Order to Interval Tuple](./intervals_distribution.md) section to exclude the first/last interval that would be equivalent to the skipping approach. - -The _mode_ defines values that assume different ways of `imaginary` elements - $boundary$ and $cycle$. -The `imaginary` elements can be used as `previous` or `following` reference for any element of the sequence, -but do not produce any interval for their own. However, you can use `redundant` function defined in - -[Interval Order to Interval Tuple](./intervals_distribution.md) section to count intervals produced for `imaginary` elements. - -## Boundary - -The $boundary$ mode extends the sequence with `imaginary` elements - `Infimum` ($Inf$) and `Supremum` ($Sup$ ), -which are equal to any element of the sequence. `Infimum` element placed on $0$ position and `Supremum` on $n+1$ position of the sequence. - -=== "$Start$ binding" - - ``` mermaid - block-beta - columns 8 - p0["0"] p1["1"] space:4 p6["n"] p7["n + 1"] - inf["⊥"] s1["A"] s2["C"] s3["T"] s4["C"] s5["A"] s6["G"] sup["⊥"] - infa["⊥"] ia1["1"]:1 space:6 - infc["⊥"] ic1["2"]:2 space:5 - inft["⊥"] it1["3"]:3 space:4 - infg["⊥"] ig1["6"]:6 space:1 - - classDef imaginary fill:#526cfe09,color:#000,stroke-dasharray: 10 5; - classDef position fill:#fff,color:#000,stroke-width:0px; - class inf,sup imaginary - class p0,p1,p6,p7 position - - classDef c1 fill:#ff7f0e,color:#fff; - classDef c2 fill:#ffbb78,color:#000; - classDef c2a fill:#ffbb788a,color:#000; - classDef c3 fill:#2ca02c,color:#fff; - classDef c4 fill:#98df8a,color:#000; - classDef c4a fill:#98df8a8a,color:#000; - classDef c5 fill:#d62728,color:#fff; - classDef c6 fill:#ff9896,color:#000; - classDef c6a fill:#ff98968a,color:#000; - classDef c7 fill:#9467bd,color:#fff; - classDef c8 fill:#c5b0d5,color:#000; - classDef c9 fill:#8c564b,color:#fff; - classDef c10 fill:#c49c94,color:#000; - classDef c11 fill:#e377c2,color:#fff; - classDef c12 fill:#f7b6d2,color:#000; - classDef c13 fill:#bcbd22,color:#fff; - classDef c14 fill:#dbdb8d,color:#000; - classDef c14a fill:#dbdb8d8a,color:#000; - classDef c15 fill:#17becf,color:#fff; - classDef c16 fill:#9edae5,color:#000; - - class s1,ia1 c2 - class infa c2a - class s2,ic1 c4 - class infc c4a - class s3,it1 c6 - class inft c6a - class s6,ig1 c14 - class infg c14a - class p1,p2,p3,p4,p5,p6,p7,p8,p9,f1,f2,f3,f4,f5,f6,f7,f8,f9 imaginary - class pomn,p00,p01,p06,p07,p02n position - - ``` - -=== "$End$ binding" - - ``` mermaid - block-beta - columns 8 - p0["0"] p1["1"] space:4 p6["n"] p7["n + 1"] - inf["Infimum"] s1["A"] s2["C"] s3["T"] s4["C"] s5["A"] s6["G"] sup["Supremum"] - space:5 ia1["2"]:2 supa["Supremum"] - space:4 ic1["3"]:3 supc["Supremum"] - space:3 it1["4"]:4 supt["Supremum"] - space:6 ig1["1"]:1 supg["Supremum"] - - classDef imaginary fill:#526cfe09,color:#000,stroke-dasharray: 10 5; - classDef position fill:#fff,color:#000,stroke-width:0px; - class inf,sup imaginary - class p0,p1,p6,p7 position - - classDef c1 fill:#ff7f0e,color:#fff; - classDef c2 fill:#ffbb78,color:#000; - classDef c2a fill:#ffbb788a,color:#000; - classDef c3 fill:#2ca02c,color:#fff; - classDef c4 fill:#98df8a,color:#000; - classDef c4a fill:#98df8a8a,color:#000; - classDef c5 fill:#d62728,color:#fff; - classDef c6 fill:#ff9896,color:#000; - classDef c6a fill:#ff98968a,color:#000; - classDef c7 fill:#9467bd,color:#fff; - classDef c8 fill:#c5b0d5,color:#000; - classDef c9 fill:#8c564b,color:#fff; - classDef c10 fill:#c49c94,color:#000; - classDef c11 fill:#e377c2,color:#fff; - classDef c12 fill:#f7b6d2,color:#000; - classDef c13 fill:#bcbd22,color:#fff; - classDef c14 fill:#dbdb8d,color:#000; - classDef c14a fill:#dbdb8d8a,color:#000; - classDef c15 fill:#17becf,color:#fff; - classDef c16 fill:#9edae5,color:#000; - - class s5,ia1 c2 - class supa c2a - class s4,ic1 c4 - class supc c4a - class s3,it1 c6 - class supt c6a - class s6,ig1 c14 - class supg c14a - class p1,p2,p3,p4,p5,p6,p7,p8,p9,f1,f2,f3,f4,f5,f6,f7,f8,f9 imaginary - class pomn,p00,p01,p06,p07,p02n position - ``` - - -## Cycle - -In the $cycle$ mode, the sequence is extended by copying itself as an `imaginary` prefix/suffix to mock a cycled sequence (also known as a periodic sequence or an orbit). The first/last interval counts to the previous/following element in `imaginary` prefix/suffix. - - -=== "$Start$ binding" - - ``` mermaid - block-beta - columns 18 - pomn["-n"] space:4 p00["0"] p01["1"] space:4 p06["n"] p07["n + 1"] space:4 p02n["n + n"] - p1["A"] p2["C"] p3["T"] p4["C"] p5["A"] p6["G"] s1["A"] s2["C"] s3["T"] s4["C"] s5["A"] s6["G"] f1["A"] f2["C"] f3["T"] f4["C"] f5["A"] f6["G"] - space:5 ia1["2"]:2 space:11 - space:4 ic1["4"]:4 space:10 - space:3 it1["6"]:6 space:9 - space:6 ig1["6"]:6 space:6 - - classDef imaginary fill:#526cfe09,color:#000,stroke-dasharray: 10 5; - classDef position fill:#fff,color:#000,stroke-width:0px; - - classDef c1 fill:#ff7f0e,color:#fff; - classDef c2 fill:#ffbb78,color:#000; - classDef c2a fill:#ffbb788a,color:#000; - classDef c3 fill:#2ca02c,color:#fff; - classDef c4 fill:#98df8a,color:#000; - classDef c4a fill:#98df8a8a,color:#000; - classDef c5 fill:#d62728,color:#fff; - classDef c6 fill:#ff9896,color:#000; - classDef c6a fill:#ff98968a,color:#000; - classDef c7 fill:#9467bd,color:#fff; - classDef c8 fill:#c5b0d5,color:#000; - classDef c9 fill:#8c564b,color:#fff; - classDef c10 fill:#c49c94,color:#000; - classDef c11 fill:#e377c2,color:#fff; - classDef c12 fill:#f7b6d2,color:#000; - classDef c13 fill:#bcbd22,color:#fff; - classDef c14 fill:#dbdb8d,color:#000; - classDef c14a fill:#dbdb8d8a,color:#000; - classDef c15 fill:#17becf,color:#fff; - classDef c16 fill:#9edae5,color:#000; - - class s1,ia1 c2 - class p5 c2a - class s2,ic1 c4 - class p4 c4a - class s3,it1 c6 - class p3 c6a - class s6,ig1 c14 - class p6 c14a - class p1,p2,p3,p4,p5,p6,p7,p8,p9,f1,f2,f3,f4,f5,f6,f7,f8,f9 imaginary - class pomn,p00,p01,p06,p07,p02n position - - ``` - -=== "$End$ binding" - - ``` mermaid - block-beta - columns 18 - pomn["-n"] space:4 p00["0"] p01["1"] space:4 p06["n"] p07["n + 1"] space:4 p02n["n + n"] - p1["A"] p2["C"] p3["T"] p4["C"] p5["A"] p6["G"] s1["A"] s2["C"] s3["T"] s4["C"] s5["A"] s6["G"] f1["A"] f2["C"] f3["T"] f4["C"] f5["A"] f6["G"] - space:10 ia1["2"]:2 space:6 - space:9 ic1["4"]:4 space:5 - space:8 it1["6"]:6 space:5 - space:10 ig1["6"]:6 space:1 - - classDef imaginary fill:#526cfe09,color:#000,stroke-dasharray: 10 5; - classDef position fill:#fff,color:#000,stroke-width:0px; - - classDef c1 fill:#ff7f0e,color:#fff; - classDef c2 fill:#ffbb78,color:#000; - classDef c2a fill:#ffbb788a,color:#000; - classDef c3 fill:#2ca02c,color:#fff; - classDef c4 fill:#98df8a,color:#000; - classDef c4a fill:#98df8a8a,color:#000; - classDef c5 fill:#d62728,color:#fff; - classDef c6 fill:#ff9896,color:#000; - classDef c6a fill:#ff98968a,color:#000; - classDef c7 fill:#9467bd,color:#fff; - classDef c8 fill:#c5b0d5,color:#000; - classDef c9 fill:#8c564b,color:#fff; - classDef c10 fill:#c49c94,color:#000; - classDef c11 fill:#e377c2,color:#fff; - classDef c12 fill:#f7b6d2,color:#000; - classDef c13 fill:#bcbd22,color:#fff; - classDef c14 fill:#dbdb8d,color:#000; - classDef c14a fill:#dbdb8d8a,color:#000; - classDef c15 fill:#17becf,color:#fff; - classDef c16 fill:#9edae5,color:#000; - - class s5,ia1 c2 - class f1 c2a - class s4,ic1 c4 - class f2 c4a - class s3,it1 c6 - class f3 c6a - class s6,ig1 c14 - class f6 c14a - class p1,p2,p3,p4,p5,p6,p7,p8,p9,f1,f2,f3,f4,f5,f6,f7,f8,f9 imaginary - class pomn,p00,p01,p06,p07,p02n position - - ``` - -The $cycle$ mode is inspired and aligned with the idea of representativeness heuristic, which is fundamental in probability and statistics, and the Necklace problems in combinatorics. - -At the same time, the $boundary$ mode looks like related to tree structures and graph theory. - -## Mathematical Definition - -Let $X$ is [_Carrier set_](./carrier_set.md#Mathematical Definition) - -Let $S$ is [_Sequence_](./sequence.md#Mathematical Definition) length of $n$ described as function $S : \{1,...,n\} \longrightarrow X$ - -Let $\bot \notin X$ is a special _sentinel_ value. - -Define $X_\bot = X \cup \{ \bot \}$ set - -$\forall S \ \exists \ S_{\bot} : J \longrightarrow X_{\bot} \Big| \{1,...,n\} \subset J$ - -Define $Mode : S \longrightarrow S_{\bot}$ - -$\forall S \exists S_{boundary} : \{0,...,n+1\} \longrightarrow X_\bot$ - -Define $boundary : S \longrightarrow S_{boundary}, boundary(s)(i) = \Biggl\{ \begin{array}{l} Inf, i=0 \\ s(i), 1 \le i \le n \\ Sup, i = n+1\end{array}$ - - -$\forall S \exists S_{cycle} : Z \longrightarrow X_\bot$ - - - - - -Define $cycle : S \longrightarrow S_{cycle}, cycle(s)(i) = s\big( i - n \times \lfloor ( i - 1) \div n \rfloor \big) \Big| n = |s|$ - -Define _mode_ $M = \{ boundary, cycle \}$ diff --git a/docs/fundamentals/objects/references.md b/docs/fundamentals/objects/references.md deleted file mode 100644 index e91513be..00000000 --- a/docs/fundamentals/objects/references.md +++ /dev/null @@ -1,126 +0,0 @@ -# References - -## Mathematical Definition - - -Let $X$ is [_Carrier set_](./carrier_set.md#Mathematical Definition) - -Let $S$ is [_Sequence_](./sequence.md#Mathematical Definition) length of $n$ described as function $S : \{1,...,n\} \longrightarrow X$ - -Let - -$$S_{cycled} : \big\{ \{1,...,n\} \longrightarrow X \big\} \longrightarrow \big\{ Z \longrightarrow X \big\}$$ - -$$S_{cycled}(S)(i) = S\big( i - n \times \lfloor ( i - 1) \div n \rfloor \big)$$ - -$$R : \{1,...,n\} \longrightarrow \{-n,...,2n\} $$ - -$$Binding : \big\{S\big\} \longrightarrow \big\{ R \big\},$$ - - -$$if \ \exists \ Binding^{-1} : \big\{R \big\} \longrightarrow \big\{\{1,...,n\} \longrightarrow \{1,...,m\}\big\}\ that$$ - -$$\forall i \in \{1,...,n\} Binding(R)(i) = Binding(Binding^{-1}(Binding(R)) )(i)$$ - - -$$Start(S)(i) = max(\big\{j \in Z \big|S_{cycled}(j) = S(i) \land j \leq i-1 \big\})$$ - -$$Start^{-1}(R)(i) = \Bigg\{\begin{array}{l} \big|\big| & if \ R(i) \leq 0 \\ Start^{-1}(R, R(i)) & otherwise \end{array}$$ - -$$End(S)(i) = min(\big\{j \in Z \big|S_{cycled}(j) = S(i) \land j \geq i+1 \big\}$$ - -$$End^{-1}(R)(i) = \Bigg\{\begin{array}{l} \big|\big| & if \ R(i) \geq n+1 \\ End^{-1}(R, R(i)) & otherwise \end{array}$$ - -Lemma: - -$$\forall S : \{1,...,n\} \longrightarrow X, \ \forall i \in \{1,..n\} \Big| 1 \leq |\ Start(S)(i) - i\ | \leq n \land 1 \leq | End(S)(i) - i\ | \leq n$$ - -Define $B = \{ Start, End \} \subset \{ Binding \}$ - -## Examples - -=== "$Start$ binding" - - ``` mermaid - block-beta - columns 8 - p0["0"] p1["1"] space:3 p5["5"] p6["n"] p7["n + 1"] - inf["⊥"] s1["A"] s2["C"] s3["T"] s4["C"] s5["A"] s6["G"] sup["⊥"] - e0["0 = Start(1)"]:2 space:6 - space t1["1 = Start(5)"]:5 space:2 - - classDef imaginary fill:#526cfe09,color:#000,stroke-dasharray: 10 5; - classDef position fill:#fff,color:#000,stroke-width:0px; - class inf,sup imaginary - class p0,p1,p5,p6,p7 position - - classDef c1 fill:#ff7f0e,color:#fff; - classDef c2 fill:#ffbb78,color:#000; - classDef c2a fill:#ffbb788a,color:#000; - classDef c3 fill:#2ca02c,color:#fff; - classDef c4 fill:#98df8a,color:#000; - classDef c4a fill:#98df8a8a,color:#000; - classDef c5 fill:#d62728,color:#fff; - classDef c6 fill:#ff9896,color:#000; - classDef c6a fill:#ff98968a,color:#000; - classDef c7 fill:#9467bd,color:#fff; - classDef c8 fill:#c5b0d5,color:#000; - classDef c9 fill:#8c564b,color:#fff; - classDef c10 fill:#c49c94,color:#000; - classDef c11 fill:#e377c2,color:#fff; - classDef c12 fill:#f7b6d2,color:#000; - classDef c13 fill:#bcbd22,color:#fff; - classDef c14 fill:#dbdb8d,color:#000; - classDef c14a fill:#dbdb8d8a,color:#000; - classDef c15 fill:#17becf,color:#fff; - classDef c16 fill:#9edae5,color:#000; - - class s1,s5 c4 - class inf,t1,e0 c4a - class pomn,p00,p01,p06,p07,p02n position - class t1,t2,t5,e0,e1 position - - ``` - -=== "$End$ binding" - - ``` mermaid - block-beta - columns 8 - p0["0"] p1["1"] space:3 p5["5"] p6["n"] p7["n + 1"] - inf["⊥"] s1["A"] s2["C"] s3["T"] s4["C"] s5["A"] s6["G"] sup["⊥"] - space t1["End(1) = 5"]:5 space:2 - space:5 e0["End(5) = n+1"]:3 - - classDef imaginary fill:#526cfe09,color:#000,stroke-dasharray: 10 5; - classDef position fill:#fff,color:#000,stroke-width:0px; - class inf,sup imaginary - class p0,p1,p5,p6,p7 position - - classDef c1 fill:#ff7f0e,color:#fff; - classDef c2 fill:#ffbb78,color:#000; - classDef c2a fill:#ffbb788a,color:#000; - classDef c3 fill:#2ca02c,color:#fff; - classDef c4 fill:#98df8a,color:#000; - classDef c4a fill:#98df8a8a,color:#000; - classDef c5 fill:#d62728,color:#fff; - classDef c6 fill:#ff9896,color:#000; - classDef c6a fill:#ff98968a,color:#000; - classDef c7 fill:#9467bd,color:#fff; - classDef c8 fill:#c5b0d5,color:#000; - classDef c9 fill:#8c564b,color:#fff; - classDef c10 fill:#c49c94,color:#000; - classDef c11 fill:#e377c2,color:#fff; - classDef c12 fill:#f7b6d2,color:#000; - classDef c13 fill:#bcbd22,color:#fff; - classDef c14 fill:#dbdb8d,color:#000; - classDef c14a fill:#dbdb8d8a,color:#000; - classDef c15 fill:#17becf,color:#fff; - classDef c16 fill:#9edae5,color:#000; - - class s1,s5 c4 - class sup,t1,e0 c4a - class pomn,p00,p01,p06,p07,p02n position - class t1,t2,t5,e0,e1 position - - ``` diff --git a/mkdocs.yml b/mkdocs.yml index 3283ce08..1ca377d6 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -23,7 +23,6 @@ nav: - "Cycled": fundamentals/objects/intervals_chain/cycled.md - "Intervals": fundamentals/objects/intervals.md - "Intervals Distribution": fundamentals/objects/intervals_distribution.md - - "Binding": fundamentals/objects/binding.md - "Congeneric decomposition": - fundamentals/congeneric_decomposition/index.md - "Congeneric sequences": fundamentals/congeneric_decomposition/congeneric_sequences.md From 668dcbe311e1798f858361307031bb7681ebdf29 Mon Sep 17 00:00:00 2001 From: Igor Rodionov Date: Mon, 7 Jul 2025 01:33:59 +0200 Subject: [PATCH 27/35] Added documntation for distribution --- docs/fundamentals/objects/index.md | 44 +++---- docs/fundamentals/objects/intervals.md | 3 - .../objects/intervals_distribution.md | 3 - .../objects/intervals_distribution/index.md | 119 ++++++++++++++++++ .../objects/intervals_distribution/lossy.md | 0 .../intervals_distribution/redundant.md | 0 mkdocs.yml | 6 +- 7 files changed, 139 insertions(+), 36 deletions(-) delete mode 100644 docs/fundamentals/objects/intervals.md delete mode 100644 docs/fundamentals/objects/intervals_distribution.md create mode 100644 docs/fundamentals/objects/intervals_distribution/index.md create mode 100644 docs/fundamentals/objects/intervals_distribution/lossy.md create mode 100644 docs/fundamentals/objects/intervals_distribution/redundant.md diff --git a/docs/fundamentals/objects/index.md b/docs/fundamentals/objects/index.md index 1f9d2ec2..62e67d76 100644 --- a/docs/fundamentals/objects/index.md +++ b/docs/fundamentals/objects/index.md @@ -5,36 +5,24 @@ flowchart TB Start@{ shape: sm-circ, label: "" }-- Sequence -->alphabet alphabet-- Alphabet -->OA@{ shape: cross-circ, label: "order + alphabet" } Start-- Sequence -->O@{label: "order"} - O@{label: "order"}-- Order -->OA@{ shape: cross-circ, label: "order + alphabet" } - OA@{ label: "order + alphabet" }-- Sequence -->intervals - intervals-- Intervals Chained -->decompose - decompose-- Intervals -->aggregate - aggregate-- Intervals Distribution --> da@{ label: "Δa" } - aggregate-- Intervals Distribution --> dg@{ label: "Δg" } - aggregate-- Intervals Distribution --> g@{ label: "g" } - aggregate-- Intervals Distribution --> G@{ label: "G" } - aggregate-- Intervals Distribution --> t@{ label: "t" } - + O@{label: "order"}-- Order -->OA@{ shape: sm-circ, label: "order + alphabet" } + OA@{ label: "order + alphabet" }-- Sequence -->End@{ shape: sm-circ, label: "end" } ``` - ```mermaid flowchart TB - Sequence-- alphabet -->Alphabet - Sequence-- order -->Order - Order-->OA@{ shape: diamond, label: "+" } - Alphabet-->OA@{ shape: diamond, label: "+" } - OA@{ shape: diamond, label: "\\+" }-->Sequencetwo@{ label: "Sequence" } - Sequencetwo@{ label: "Sequence" }-->fork@{ shape: fork, label: "" } - fork@{ shape: fork, label: "" }-- intervals(cycled) --> ICC@{ label: "Intervals Chained" } - fork@{ shape: fork, label: "" }-- intervals(bondary) --> ICB@{ label: "Intervals Chained" } - ICC@{ label: "Intervals Chained" }-- decompose -->IT@{ label: "Intervals" } - ICB@{ label: "Intervals Chained" }-- decompose -->IT@{ label: "Intervals" } - IT@{ label: "Intervals" }-- aggregate -->ID@{ label: "Intervals Distribution" } - ID@{ label: "Intervals Distribution" }-- arithmetic interval -->da@{ label: "Δa" } - ID@{ label: "Intervals Distribution" }-- geometric interval -->dg@{ label: "Δg" } - ID@{ label: "Intervals Distribution" }-- average remotness -->g@{ label: "g" } - ID@{ label: "Intervals Distribution" }-- depth -->G@{ label: "G" } - ID@{ label: "Intervals Distribution" }-- volume -->V@{ label: "V" } - ID@{ label: "Intervals Distribution" }-- t -->t@{ label: "t" } + Start@{ shape: sm-circ, label: "" }-- Sequence -->fork1@{ shape: sm-circ, label: "" } + fork1@{ shape: sm-circ, label: "" }-- Sequence -->alphabet + alphabet-- Alphabet -->OA@{ shape: cross-circ, label: "order + alphabet" } + O@{label: "order"}-- Order -->OA@{ shape: sm-circ, label: "order + alphabet" } + OA@{ label: "order + alphabet" }-- Sequence -->End@{ shape: sm-circ, label: "end" } + + fork1@{ shape: sm-circ, label: "" }-- Sequence -->intervals + intervals-- Intervals Chained -->fork@{ shape: sm-circ, label: "" } + fork@{ shape: sm-circ, label: "" }-- Intervals Chained -->inverseIntervals@{ label: "intervals⁻¹" } + fork@{ shape: sm-circ, label: "" }-- Intervals Chained -->aggregate + inverseIntervals@{ label: "intervals⁻¹" }-- Reconstructed Sequence --> O@{label: "order"} + aggregate-- Intervals Distribution --> measures@{ label: "charcteristics" } + measures@{ label: "charcteristics" } -- float --> EndMeaure@{ shape: sm-circ, label: "end" } + ``` diff --git a/docs/fundamentals/objects/intervals.md b/docs/fundamentals/objects/intervals.md deleted file mode 100644 index 7a219029..00000000 --- a/docs/fundamentals/objects/intervals.md +++ /dev/null @@ -1,3 +0,0 @@ -# Intervals Tuple - -Coming soon diff --git a/docs/fundamentals/objects/intervals_distribution.md b/docs/fundamentals/objects/intervals_distribution.md deleted file mode 100644 index d2dd8178..00000000 --- a/docs/fundamentals/objects/intervals_distribution.md +++ /dev/null @@ -1,3 +0,0 @@ -# Intervals Distribution - -Coming soon diff --git a/docs/fundamentals/objects/intervals_distribution/index.md b/docs/fundamentals/objects/intervals_distribution/index.md new file mode 100644 index 00000000..224b1d4c --- /dev/null +++ b/docs/fundamentals/objects/intervals_distribution/index.md @@ -0,0 +1,119 @@ +# Intervals Distribution + +An _intervals distribution_ is an n-tuple of natural numbers where the index represents the interval length and the value is a count of its appearances in the _interval chain_. + + +=== "From an interval chain" + + ``` mermaid + block-beta + columns 7 + space p1["1"] p2["2"] p3["3"] p4["4"] p5["5"] p6["6"] + space s1["1"] s2["2"] s3["3"] s4["2"] s5["4"] s6["6"] + + classDef imaginary fill:#526cfe09,color:#000,stroke-dasharray: 10 5; + classDef position fill:#fff,color:#000,stroke-width:0px; + class inf,sup imaginary + class p0,p1,p2,p3,p4,p5,p6,p7 position + + classDef c1 fill:#ff7f0e,color:#fff; + classDef c2 fill:#ffbb78,color:#000; + classDef c2a fill:#ffbb788a,color:#000; + classDef c3 fill:#2ca02c,color:#fff; + classDef c4 fill:#98df8a,color:#000; + classDef c4a fill:#98df8a8a,color:#000; + classDef c5 fill:#d62728,color:#fff; + classDef c6 fill:#ff9896,color:#000; + classDef c6a fill:#ff98968a,color:#000; + classDef c7 fill:#9467bd,color:#fff; + classDef c8 fill:#c5b0d5,color:#000; + classDef c9 fill:#8c564b,color:#fff; + classDef c10 fill:#c49c94,color:#000; + classDef c11 fill:#e377c2,color:#fff; + classDef c12 fill:#f7b6d2,color:#000; + classDef c13 fill:#bcbd22,color:#fff; + classDef c14 fill:#dbdb8d,color:#000; + classDef c14a fill:#dbdb8d8a,color:#000; + classDef c15 fill:#17becf,color:#fff; + classDef c16 fill:#9edae5,color:#000; + + class pomn,p00,p01,p06,p07,p02n position + class t1,t2,t5,e0,e1 position + + ``` + + Let there be an _interval chain_. + +=== "calculate intervals distribution" + + ``` mermaid + block-beta + columns 7 + space p1["1"] p2["2"] p3["3"] p4["4"] p5["5"] p6["6"] + space s1["1"] s2["2"] s3["3"] s4["2"] s5["4"] s6["6"] + space:7 + space i1["1"] i2["2"] i3["1"] i4["1"] i5["0"] i6["1"] + + classDef imaginary fill:#526cfe09,color:#000,stroke-dasharray: 10 5; + classDef position fill:#fff,color:#000,stroke-width:0px; + class inf,sup imaginary + class p0,p1,p2,p3,p4,p5,p6,p7 position + + classDef c1 fill:#ff7f0e,color:#fff; + classDef c2 fill:#ffbb78,color:#000; + classDef c2a fill:#ffbb788a,color:#000; + classDef c3 fill:#2ca02c,color:#fff; + classDef c4 fill:#98df8a,color:#000; + classDef c4a fill:#98df8a8a,color:#000; + classDef c5 fill:#d62728,color:#fff; + classDef c6 fill:#ff9896,color:#000; + classDef c6a fill:#ff98968a,color:#000; + classDef c7 fill:#9467bd,color:#fff; + classDef c8 fill:#c5b0d5,color:#000; + classDef c9 fill:#8c564b,color:#fff; + classDef c10 fill:#c49c94,color:#000; + classDef c11 fill:#e377c2,color:#fff; + classDef c12 fill:#f7b6d2,color:#000; + classDef c13 fill:#bcbd22,color:#fff; + classDef c14 fill:#dbdb8d,color:#000; + classDef c14a fill:#dbdb8d8a,color:#000; + classDef c15 fill:#17becf,color:#fff; + classDef c16 fill:#9edae5,color:#000; + + class pomn,p00,p01,p06,p07,p02n position + class t1,t2,t5,e0,e1 position + + s1 --> i1 + s2 --> i2 + s3 --> i3 + s4 --> i2 + s5 --> i4 + s6 --> i6 + + + ``` + +--- + +_Intervals distribution_ used as an input data in calculating [characteristics](../../characteristics/index.md). +While characteristics could be calculated based on the _itervals chain_ _intervals distribution_ highlights that intervals themselves are enough to measure the [order](../order.md) of a sequence +and intervals connectivity in _intervals chain_ does not affect measure values. +Whether it is possible in general to reconstruct distinctly an _interval chain_ by the given _interval distribution_ is an open question. + + + +_Interval distribution_ is useful in comparing intervals produced from the same sequence with different [_Binding_](../intervals_chain/index.md#define-bindings). +In the interest of studying how _intervals_ depend on _Binding direction_ for [_Bounded Binding_](../intervals_chain/bounded.md) FOA introduce two operations on distributions: + +- [Lossy](./lossy.md) - takes two _intervals distribution_ and produce new one only with _intervals_ exists in both distributions. +- [Redundant](./redundant.md) - extends _intervals distribution_ `A` with _intervals_ that appears only in _intervals distrubution_ `B`. + +## Mathematical Definition + +Let $IC$ is [_Interval Chain_](../intervals_chain/index.md#define-intervals-chain) length of $n$ described as function $IC : \{1,...,n\} \longrightarrow \{1,...,n\}$ + +Define + +$$ID : \big\{ IC \big\} \longrightarrow \big\{ \{1,...,n\} \longrightarrow N_0 \big\},$$ + +$$ID(IC)(i) = \Big| \big\{ j \in \{1,...,n\} | IC(j) = i \big\} \Big|$$ diff --git a/docs/fundamentals/objects/intervals_distribution/lossy.md b/docs/fundamentals/objects/intervals_distribution/lossy.md new file mode 100644 index 00000000..e69de29b diff --git a/docs/fundamentals/objects/intervals_distribution/redundant.md b/docs/fundamentals/objects/intervals_distribution/redundant.md new file mode 100644 index 00000000..e69de29b diff --git a/mkdocs.yml b/mkdocs.yml index 1ca377d6..e724d88e 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -21,8 +21,10 @@ nav: - fundamentals/objects/intervals_chain/index.md - "Bounded": fundamentals/objects/intervals_chain/bounded.md - "Cycled": fundamentals/objects/intervals_chain/cycled.md - - "Intervals": fundamentals/objects/intervals.md - - "Intervals Distribution": fundamentals/objects/intervals_distribution.md + - "Intervals Distribution": + - fundamentals/objects/intervals_distribution/index.md + - "Lossy": fundamentals/objects/intervals_distribution/lossy.md + - "Redundant": fundamentals/objects/intervals_distribution/redundant.md - "Congeneric decomposition": - fundamentals/congeneric_decomposition/index.md - "Congeneric sequences": fundamentals/congeneric_decomposition/congeneric_sequences.md From 624da5a5a9e331fe7413b825b7a00af1622a002a Mon Sep 17 00:00:00 2001 From: Igor Rodionov Date: Mon, 7 Jul 2025 13:43:58 +0200 Subject: [PATCH 28/35] Move characteristics to right place --- .../characteristics/arithmetic_mean.md | 0 .../characteristics/average_remoteness.md | 0 .../characteristics/depth.md | 0 .../descriptive_information.md | 0 .../characteristics/geometric_mean.md | 0 .../identifying_information.md | 0 .../characteristics/index.md | 0 .../characteristics/periodicity.md | 0 .../characteristics/uniformity.md | 0 .../characteristics/volume.md | 0 docs/fundamentals/objects/index.md | 28 --- .../intervals_distribution/redundant.md | 0 .../{objects => order}/alphabet.md | 2 +- .../{objects => order}/carrier_set.md | 0 .../order}/characteristics/arithmetic_mean.md | 0 .../characteristics/average_remoteness.md | 0 .../order}/characteristics/depth.md | 0 .../order}/characteristics/geometric_mean.md | 0 .../characteristics/index.md} | 0 .../order}/characteristics/volume.md | 0 docs/fundamentals/order/index.md | 237 ++++++++++++++++++ .../intervals_chain/bounded.md | 4 +- .../intervals_chain/cycled.md | 4 +- .../intervals_chain/index.md | 4 +- .../intervals_distribution/index.md | 0 .../order/intervals_distribution/lossy.md | 64 +++++ .../order/intervals_distribution/redundant.md | 62 +++++ docs/fundamentals/{objects => order}/order.md | 0 .../{objects => order}/sequence.md | 2 +- mkdocs.yml | 53 ++-- 30 files changed, 401 insertions(+), 59 deletions(-) rename docs/fundamentals/{ => congeneric_decomposition}/characteristics/arithmetic_mean.md (100%) rename docs/fundamentals/{ => congeneric_decomposition}/characteristics/average_remoteness.md (100%) rename docs/fundamentals/{ => congeneric_decomposition}/characteristics/depth.md (100%) rename docs/fundamentals/{ => congeneric_decomposition}/characteristics/descriptive_information.md (100%) rename docs/fundamentals/{ => congeneric_decomposition}/characteristics/geometric_mean.md (100%) rename docs/fundamentals/{ => congeneric_decomposition}/characteristics/identifying_information.md (100%) rename docs/fundamentals/{ => congeneric_decomposition}/characteristics/index.md (100%) rename docs/fundamentals/{ => congeneric_decomposition}/characteristics/periodicity.md (100%) rename docs/fundamentals/{ => congeneric_decomposition}/characteristics/uniformity.md (100%) rename docs/fundamentals/{ => congeneric_decomposition}/characteristics/volume.md (100%) delete mode 100644 docs/fundamentals/objects/index.md delete mode 100644 docs/fundamentals/objects/intervals_distribution/redundant.md rename docs/fundamentals/{objects => order}/alphabet.md (96%) rename docs/fundamentals/{objects => order}/carrier_set.md (100%) rename docs/{references => fundamentals/order}/characteristics/arithmetic_mean.md (100%) rename docs/{references => fundamentals/order}/characteristics/average_remoteness.md (100%) rename docs/{references => fundamentals/order}/characteristics/depth.md (100%) rename docs/{references => fundamentals/order}/characteristics/geometric_mean.md (100%) rename docs/fundamentals/{objects/intervals_distribution/lossy.md => order/characteristics/index.md} (100%) rename docs/{references => fundamentals/order}/characteristics/volume.md (100%) create mode 100644 docs/fundamentals/order/index.md rename docs/fundamentals/{objects => order}/intervals_chain/bounded.md (98%) rename docs/fundamentals/{objects => order}/intervals_chain/cycled.md (98%) rename docs/fundamentals/{objects => order}/intervals_chain/index.md (99%) rename docs/fundamentals/{objects => order}/intervals_distribution/index.md (100%) create mode 100644 docs/fundamentals/order/intervals_distribution/lossy.md create mode 100644 docs/fundamentals/order/intervals_distribution/redundant.md rename docs/fundamentals/{objects => order}/order.md (100%) rename docs/fundamentals/{objects => order}/sequence.md (96%) diff --git a/docs/fundamentals/characteristics/arithmetic_mean.md b/docs/fundamentals/congeneric_decomposition/characteristics/arithmetic_mean.md similarity index 100% rename from docs/fundamentals/characteristics/arithmetic_mean.md rename to docs/fundamentals/congeneric_decomposition/characteristics/arithmetic_mean.md diff --git a/docs/fundamentals/characteristics/average_remoteness.md b/docs/fundamentals/congeneric_decomposition/characteristics/average_remoteness.md similarity index 100% rename from docs/fundamentals/characteristics/average_remoteness.md rename to docs/fundamentals/congeneric_decomposition/characteristics/average_remoteness.md diff --git a/docs/fundamentals/characteristics/depth.md b/docs/fundamentals/congeneric_decomposition/characteristics/depth.md similarity index 100% rename from docs/fundamentals/characteristics/depth.md rename to docs/fundamentals/congeneric_decomposition/characteristics/depth.md diff --git a/docs/fundamentals/characteristics/descriptive_information.md b/docs/fundamentals/congeneric_decomposition/characteristics/descriptive_information.md similarity index 100% rename from docs/fundamentals/characteristics/descriptive_information.md rename to docs/fundamentals/congeneric_decomposition/characteristics/descriptive_information.md diff --git a/docs/fundamentals/characteristics/geometric_mean.md b/docs/fundamentals/congeneric_decomposition/characteristics/geometric_mean.md similarity index 100% rename from docs/fundamentals/characteristics/geometric_mean.md rename to docs/fundamentals/congeneric_decomposition/characteristics/geometric_mean.md diff --git a/docs/fundamentals/characteristics/identifying_information.md b/docs/fundamentals/congeneric_decomposition/characteristics/identifying_information.md similarity index 100% rename from docs/fundamentals/characteristics/identifying_information.md rename to docs/fundamentals/congeneric_decomposition/characteristics/identifying_information.md diff --git a/docs/fundamentals/characteristics/index.md b/docs/fundamentals/congeneric_decomposition/characteristics/index.md similarity index 100% rename from docs/fundamentals/characteristics/index.md rename to docs/fundamentals/congeneric_decomposition/characteristics/index.md diff --git a/docs/fundamentals/characteristics/periodicity.md b/docs/fundamentals/congeneric_decomposition/characteristics/periodicity.md similarity index 100% rename from docs/fundamentals/characteristics/periodicity.md rename to docs/fundamentals/congeneric_decomposition/characteristics/periodicity.md diff --git a/docs/fundamentals/characteristics/uniformity.md b/docs/fundamentals/congeneric_decomposition/characteristics/uniformity.md similarity index 100% rename from docs/fundamentals/characteristics/uniformity.md rename to docs/fundamentals/congeneric_decomposition/characteristics/uniformity.md diff --git a/docs/fundamentals/characteristics/volume.md b/docs/fundamentals/congeneric_decomposition/characteristics/volume.md similarity index 100% rename from docs/fundamentals/characteristics/volume.md rename to docs/fundamentals/congeneric_decomposition/characteristics/volume.md diff --git a/docs/fundamentals/objects/index.md b/docs/fundamentals/objects/index.md deleted file mode 100644 index 62e67d76..00000000 --- a/docs/fundamentals/objects/index.md +++ /dev/null @@ -1,28 +0,0 @@ -# Objects - -```mermaid -flowchart TB - Start@{ shape: sm-circ, label: "" }-- Sequence -->alphabet - alphabet-- Alphabet -->OA@{ shape: cross-circ, label: "order + alphabet" } - Start-- Sequence -->O@{label: "order"} - O@{label: "order"}-- Order -->OA@{ shape: sm-circ, label: "order + alphabet" } - OA@{ label: "order + alphabet" }-- Sequence -->End@{ shape: sm-circ, label: "end" } -``` - -```mermaid -flowchart TB - Start@{ shape: sm-circ, label: "" }-- Sequence -->fork1@{ shape: sm-circ, label: "" } - fork1@{ shape: sm-circ, label: "" }-- Sequence -->alphabet - alphabet-- Alphabet -->OA@{ shape: cross-circ, label: "order + alphabet" } - O@{label: "order"}-- Order -->OA@{ shape: sm-circ, label: "order + alphabet" } - OA@{ label: "order + alphabet" }-- Sequence -->End@{ shape: sm-circ, label: "end" } - - fork1@{ shape: sm-circ, label: "" }-- Sequence -->intervals - intervals-- Intervals Chained -->fork@{ shape: sm-circ, label: "" } - fork@{ shape: sm-circ, label: "" }-- Intervals Chained -->inverseIntervals@{ label: "intervals⁻¹" } - fork@{ shape: sm-circ, label: "" }-- Intervals Chained -->aggregate - inverseIntervals@{ label: "intervals⁻¹" }-- Reconstructed Sequence --> O@{label: "order"} - aggregate-- Intervals Distribution --> measures@{ label: "charcteristics" } - measures@{ label: "charcteristics" } -- float --> EndMeaure@{ shape: sm-circ, label: "end" } - -``` diff --git a/docs/fundamentals/objects/intervals_distribution/redundant.md b/docs/fundamentals/objects/intervals_distribution/redundant.md deleted file mode 100644 index e69de29b..00000000 diff --git a/docs/fundamentals/objects/alphabet.md b/docs/fundamentals/order/alphabet.md similarity index 96% rename from docs/fundamentals/objects/alphabet.md rename to docs/fundamentals/order/alphabet.md index d21cc4b5..b1ec8e37 100644 --- a/docs/fundamentals/objects/alphabet.md +++ b/docs/fundamentals/order/alphabet.md @@ -4,7 +4,7 @@ An alphabet is a m-tuple of unique elements. ## Mathematical Definition -Let $X$ is [_Carrier set_](./carrier_set.md#Mathematical Definition) +Let $X$ is [_Carrier set_](./carrier_set.md#mathematical-definition) The _alphabet_ $A$ is a m-tuple with a uniqueness constraint, can be defined: diff --git a/docs/fundamentals/objects/carrier_set.md b/docs/fundamentals/order/carrier_set.md similarity index 100% rename from docs/fundamentals/objects/carrier_set.md rename to docs/fundamentals/order/carrier_set.md diff --git a/docs/references/characteristics/arithmetic_mean.md b/docs/fundamentals/order/characteristics/arithmetic_mean.md similarity index 100% rename from docs/references/characteristics/arithmetic_mean.md rename to docs/fundamentals/order/characteristics/arithmetic_mean.md diff --git a/docs/references/characteristics/average_remoteness.md b/docs/fundamentals/order/characteristics/average_remoteness.md similarity index 100% rename from docs/references/characteristics/average_remoteness.md rename to docs/fundamentals/order/characteristics/average_remoteness.md diff --git a/docs/references/characteristics/depth.md b/docs/fundamentals/order/characteristics/depth.md similarity index 100% rename from docs/references/characteristics/depth.md rename to docs/fundamentals/order/characteristics/depth.md diff --git a/docs/references/characteristics/geometric_mean.md b/docs/fundamentals/order/characteristics/geometric_mean.md similarity index 100% rename from docs/references/characteristics/geometric_mean.md rename to docs/fundamentals/order/characteristics/geometric_mean.md diff --git a/docs/fundamentals/objects/intervals_distribution/lossy.md b/docs/fundamentals/order/characteristics/index.md similarity index 100% rename from docs/fundamentals/objects/intervals_distribution/lossy.md rename to docs/fundamentals/order/characteristics/index.md diff --git a/docs/references/characteristics/volume.md b/docs/fundamentals/order/characteristics/volume.md similarity index 100% rename from docs/references/characteristics/volume.md rename to docs/fundamentals/order/characteristics/volume.md diff --git a/docs/fundamentals/order/index.md b/docs/fundamentals/order/index.md new file mode 100644 index 00000000..5b23eb61 --- /dev/null +++ b/docs/fundamentals/order/index.md @@ -0,0 +1,237 @@ +# Order and its measures + +Formal Order Analysis identifies [Order](./order.md) as a sequence's property that could be extracted by replacing elements with their indexes in an [Alphabet](./alphabet.md). + +A pair of Alphabet and Order determines a [Sequence](./sequence.md). + +=== "Alphabet" + + ``` mermaid + block-beta + columns 36 + s1["I"] s2["N"] s3["T"] s4["E"] s5["L"] s6["L"] s7["I"] s8["G"] s9["E"] s10["N"] + s11["C"] s12["E"] s13[" "] s14["I"] s15["S"] s16[" "] s17["T"] s18["H"] s19["E"] s20[" "] + s21["A"] s22["B"] s23["I"] s24["L"] s25["I"] s26["T"] s27["Y"] s28[" "] s29["T"] s30["O"] + s31[" "] s32["A"] s33["D"] s34["A"] s35["P"] s36["T"] + + space:36 + + i1_1["1"] i2_1["2"] i3_1["3"] i4_1["4"] i5_1["5"] space:2 i6_1["6"] space:2 i7_1["7"] space + i8_1["8"] space i9_1["9"] space:2 i10_1["10"] space:2 + i11_1["11"] i12_1["12"] space:4 i13_1["13"] + space:2 i14_1["14"] space:2 + i15_1["15"] space i16_1["16"] + + classDef c1 fill:#ff7f0e,color:#fff; + classDef c2 fill:#ffbb78,color:#000; + classDef c3 fill:#2ca02c,color:#fff; + classDef c4 fill:#98df8a,color:#000; + classDef c5 fill:#d62728,color:#fff; + classDef c6 fill:#ff9896,color:#000; + classDef c7 fill:#9467bd,color:#fff; + classDef c8 fill:#c5b0d5,color:#000; + classDef c9 fill:#8c564b,color:#fff; + classDef c10 fill:#c49c94,color:#000; + classDef c11 fill:#e377c2,color:#fff; + classDef c12 fill:#f7b6d2,color:#000; + classDef c13 fill:#bcbd22,color:#fff; + classDef c14 fill:#dbdb8d,color:#000; + classDef c15 fill:#17becf,color:#fff; + classDef c16 fill:#9edae5,color:#000; + + class s1,i1_1 c1 + class s2,i2_1 c2 + class s3,i3_1 c3 + class s4,i4_1 c4 + class s5,i5_1 c5 + class s8,i6_1 c6 + class s11,i7_1 c7 + class s13,i8_1 c8 + class s15,i9_1 c9 + class s18,i10_1 c10 + class s21,i11_1 c11 + class s22,i12_1 c12 + class s27,i13_1 c13 + class s30,i14_1 c14 + class s33,i15_1 c15 + class s35,i16_1 c16 + + s1 --> i1_1 + s2 --> i2_1 + s3 --> i3_1 + s4 --> i4_1 + s5 --> i5_1 + s8 --> i6_1 + s11 --> i7_1 + s13 --> i8_1 + s15 --> i9_1 + s18 --> i10_1 + s21 --> i11_1 + s22 --> i12_1 + s27 --> i13_1 + s30 --> i14_1 + s33 --> i15_1 + s35 --> i16_1 + + i1_1 --> s1 + i2_1 --> s2 + i3_1 --> s3 + i4_1 --> s4 + i5_1 --> s5 + i6_1 --> s8 + i7_1 --> s11 + i8_1 --> s13 + i9_1 --> s15 + i10_1 --> s18 + i11_1 --> s21 + i12_1 --> s22 + i13_1 --> s27 + i14_1 --> s30 + i15_1 --> s33 + i16_1 --> s35 + + ``` + +=== "Order" + ``` mermaid + block-beta + columns 36 + s1["I"] s2["N"] s3["T"] s4["E"] s5["L"] s6["L"] s7["I"] s8["G"] s9["E"] s10["N"] + s11["C"] s12["E"] s13[" "] s14["I"] s15["S"] s16[" "] s17["T"] s18["H"] s19["E"] s20[" "] + s21["A"] s22["B"] s23["I"] s24["L"] s25["I"] s26["T"] s27["Y"] s28[" "] s29["T"] s30["O"] + s31[" "] s32["A"] s33["D"] s34["A"] s35["P"] s36["T"] + + space:36 + + i1_1["1"] i2_1["2"] i3_1["3"] i4_1["4"] i5_1["5"] i5_2["5"] i1_2["1"] i6_1["6"] i4_2["4"] i2_2["2"] i7_1["7"] i4_3["4"] + i8_1["8"] i1_3["1"] i9_1["9"] i8_2["8"] i3_2["3"] i10_1["10"] i4_4["4"] i8_3["8"] + i11_1["11"] i12_1["12"] i1_4["1"] i5_3["5"] i1_5["1"] i3_3["3"] i13_1["13"] + i8_4["8"] i3_4["3"] i14_1["14"] i8_5["8"] i11_2["11"] + i15_1["15"] i11_3["11"] i16_1["16"] i3_5["3"] + + classDef c1 fill:#ff7f0e,color:#fff; + classDef c2 fill:#ffbb78,color:#000; + classDef c3 fill:#2ca02c,color:#fff; + classDef c4 fill:#98df8a,color:#000; + classDef c5 fill:#d62728,color:#fff; + classDef c6 fill:#ff9896,color:#000; + classDef c7 fill:#9467bd,color:#fff; + classDef c8 fill:#c5b0d5,color:#000; + classDef c9 fill:#8c564b,color:#fff; + classDef c10 fill:#c49c94,color:#000; + classDef c11 fill:#e377c2,color:#fff; + classDef c12 fill:#f7b6d2,color:#000; + classDef c13 fill:#bcbd22,color:#fff; + classDef c14 fill:#dbdb8d,color:#000; + classDef c15 fill:#17becf,color:#fff; + classDef c16 fill:#9edae5,color:#000; + + class s1,s7,s14,s23,s25,i1_1,i1_2,i1_3,i1_4,i1_5 c1 + class s2,s10,i2_1,i2_2 c2 + class s3,s17,s26,s29,s36,i3_1,i3_2,i3_3,i3_4,i3_5 c3 + class s4,s9,s12,s19,i4_1,i4_2,i4_3,i4_4 c4 + class s5,s6,s24,i5_1,i5_2,i5_3 c5 + class s8,i6_1 c6 + class s11,i7_1 c7 + class s13,s16,s20,s28,s31,i8_1,i8_2,i8_3,i8_4,i8_5 c8 + class s15,i9_1 c9 + class s18,i10_1 c10 + class s21,s32,s34,i11_1,i11_2,i11_3 c11 + class s22,i12_1 c12 + class s27,i13_1 c13 + class s30,i14_1 c14 + class s33,i15_1 c15 + class s35,i16_1 c16 + + + s1 --> i1_1 + s7 --> i1_2 + s14 --> i1_3 + s23 --> i1_4 + s25 --> i1_5 + + s2 --> i2_1 + s10 --> i2_2 + + s3 --> i3_1 + s17 --> i3_2 + s26 --> i3_3 + s29 --> i3_4 + s36 --> i3_5 + + s4 --> i4_1 + s9 --> i4_2 + s12 --> i4_3 + s19--> i4_4 + + s5 --> i5_1 + s6 --> i5_2 + s24 --> i5_3 + + s8 --> i6_1 + + s11 --> i7_1 + + s13 --> i8_1 + s16 --> i8_2 + s20 --> i8_3 + s28 --> i8_4 + s31 --> i8_5 + + s15 --> i9_1 + s18 --> i10_1 + + s21 --> i11_1 + s32 --> i11_2 + s34 --> i11_3 + + s22 --> i12_1 + s27 --> i13_1 + s30 --> i14_1 + s33 --> i15_1 + s35 --> i16_1 + ``` + +--- + +Studying the Order FOA developed methods of measuring the Order that are very sensitive to the composition of the elements in a sequence. + +The following diagrams give a hand in understanding how the Objects and Methods defined in FOA relates to each other. + +=== "Order as a property" + ```mermaid + flowchart TB + Start@{ shape: sm-circ, label: "" }-- Sequence -->fork1@{ shape: sm-circ, label: "" } + fork1-- Sequence -->alphabet + alphabet-- Alphabet -->OA@{ shape: cross-circ } + fork1-- Sequence -->O@{label: "order"} + O-- Order -->OA@{ shape: sm-circ, label: "order + alphabet" } + OA-- Sequence -->End@{ shape: sm-circ } + ``` + +=== "Interval-based characteristics" + ```mermaid + flowchart TB + Start@{ shape: sm-circ, label: "" }-- Sequence -->fork1@{ shape: sm-circ, label: "" } + fork1-- Sequence -->alphabet + alphabet-- Alphabet -->OA@{ shape: cross-circ } + O@{label: "order"}-- Order -->OA@{ shape: sm-circ } + OA-- Sequence -->End@{ shape: sm-circ } + + fork1@{ shape: sm-circ, label: "" }-- Sequence -->intervals + intervals-- Intervals Chain -->fork@{ shape: sm-circ, label: "" } + fork@{ shape: sm-circ, label: "" }-- Intervals Chain -->inverseIntervals@{ label: "intervals⁻¹" } + fork@{ shape: sm-circ, label: "" }-- Intervals Chain -->distribution + inverseIntervals@{ label: "intervals⁻¹" }-- Reconstructed Sequence --> O@{label: "order"} + distribution-- Intervals Distribution --> M@{ shape: sm-circ, label: "order + alphabet" } + M --> dg@{ label: "Δg" } + M --> da@{ label: "Δa" } + M --> g@{ label: "g" } + M --> G@{ label: "G" } + M --> V@{ label: "V" } + dg -- float --> EndMeasuredg@{ shape: sm-circ } + da -- float --> EndMeasureda@{ shape: sm-circ } + g -- float --> EndMeasureg@{ shape: sm-circ } + G -- float --> EndMeasureG@{ shape: sm-circ } + V -- int --> EndMeasureV@{ shape: sm-circ } + ``` diff --git a/docs/fundamentals/objects/intervals_chain/bounded.md b/docs/fundamentals/order/intervals_chain/bounded.md similarity index 98% rename from docs/fundamentals/objects/intervals_chain/bounded.md rename to docs/fundamentals/order/intervals_chain/bounded.md index 1ae8e731..a94c83d4 100644 --- a/docs/fundamentals/objects/intervals_chain/bounded.md +++ b/docs/fundamentals/order/intervals_chain/bounded.md @@ -98,9 +98,9 @@ _Bounded Binding_ identifies _Start_ and _End_ directions. ## Mathematical Definition -Let $X$ is [_Carrier set_](../carrier_set.md#Mathematical Definition) +Let $X$ is [_Carrier set_](../carrier_set.md#mathematical-definition) -Let $S$ is [_Sequence_](../sequence.md#Mathematical Definition) length of $n$ described as function $S : \{1,...,n\} \longrightarrow X$ +Let $S$ is [_Sequence_](../sequence.md#mathematical-definition) length of $n$ described as function $S : \{1,...,n\} \longrightarrow X$ Let $Binding$ is [Binding](./index.md#define-bindings) diff --git a/docs/fundamentals/objects/intervals_chain/cycled.md b/docs/fundamentals/order/intervals_chain/cycled.md similarity index 98% rename from docs/fundamentals/objects/intervals_chain/cycled.md rename to docs/fundamentals/order/intervals_chain/cycled.md index add2f31b..15b1292e 100644 --- a/docs/fundamentals/objects/intervals_chain/cycled.md +++ b/docs/fundamentals/order/intervals_chain/cycled.md @@ -114,9 +114,9 @@ use the prefix and suffix to find the corresponding position for the element in ## Mathematical Definition -Let $X$ is [_Carrier set_](../carrier_set.md#Mathematical Definition) +Let $X$ is [_Carrier set_](../carrier_set.md#mathematical-definition) -Let $S$ is [_Sequence_](../sequence.md#Mathematical Definition) length of $n$ described as function $S : \{1,...,n\} \longrightarrow X$ +Let $S$ is [_Sequence_](../sequence.md#mathematical-definition) length of $n$ described as function $S : \{1,...,n\} \longrightarrow X$ Let $Binding$ is [Binding](./index.md#define-bindings) diff --git a/docs/fundamentals/objects/intervals_chain/index.md b/docs/fundamentals/order/intervals_chain/index.md similarity index 99% rename from docs/fundamentals/objects/intervals_chain/index.md rename to docs/fundamentals/order/intervals_chain/index.md index 65eec2cb..f1652ec0 100644 --- a/docs/fundamentals/objects/intervals_chain/index.md +++ b/docs/fundamentals/order/intervals_chain/index.md @@ -429,9 +429,9 @@ Formal order analysis identifies two groups of _Bindings_: ## Mathematical Definition -Let $X$ is [_Carrier set_](../carrier_set.md#Mathematical Definition) +Let $X$ is [_Carrier set_](../carrier_set.md#mathematical-definition) -Let $S$ is [_Sequence_](../sequence.md#Mathematical Definition) length of $n$ described as function $S : \{1,...,n\} \longrightarrow X$ +Let $S$ is [_Sequence_](../sequence.md#mathematical-definition) length of $n$ described as function $S : \{1,...,n\} \longrightarrow X$ ### Define Bindings diff --git a/docs/fundamentals/objects/intervals_distribution/index.md b/docs/fundamentals/order/intervals_distribution/index.md similarity index 100% rename from docs/fundamentals/objects/intervals_distribution/index.md rename to docs/fundamentals/order/intervals_distribution/index.md diff --git a/docs/fundamentals/order/intervals_distribution/lossy.md b/docs/fundamentals/order/intervals_distribution/lossy.md new file mode 100644 index 00000000..caa6c6f7 --- /dev/null +++ b/docs/fundamentals/order/intervals_distribution/lossy.md @@ -0,0 +1,64 @@ +# Lossy Intervals Distribution + +A _lossy intervals distribution_ is an aggregation of two _interval distributions_ having only intervals existing in both. + +_Lossy Interval Distribution_ is an intersection of two distributions. + +Mostly, this distribution is used to solve measure dependence on _Binding direction_ with [_Bounded binding_](../intervals_chain/bounded.md). +In that case, this would be equivalent to excluding the first/last intervals from the distribution. + +For example, there are 2 distributions for _Bounded Binding_ - one uses _Start binding direction_ and the other _End binding direction_. + +``` mermaid +block-beta + columns 8 + p0["0"] p1["1"] space:3 p5["5"] p6["6"] p7["7"] + inf["⊥"] s1["A"] s2["C"] s3["T"] s4["C"] s5["A"] s6["G"] sup["⊥"] + space es0["Start(1) = 1"]:1 ts1["Start(5)=4"]:5 space + space te1["End(1) = 4"]:4 ee0["End(5) = 2"]:2 space + + classDef imaginary fill:#526cfe09,color:#000,stroke-dasharray: 10 5; + classDef position fill:#fff,color:#000,stroke-width:0px; + class inf,sup imaginary + class p0,p1,p5,p6,p7 position + + classDef c1 fill:#ff7f0e,color:#fff; + classDef c2 fill:#ffbb78,color:#000; + classDef c2a fill:#ffbb788a,color:#000; + classDef c3 fill:#2ca02c,color:#fff; + classDef c4 fill:#98df8a,color:#000; + classDef c4a fill:#98df8a8a,color:#000; + classDef c5 fill:#d62728,color:#fff; + classDef c6 fill:#ff9896,color:#000; + classDef c6a fill:#ff98968a,color:#000; + classDef c7 fill:#9467bd,color:#fff; + classDef c8 fill:#c5b0d5,color:#000; + classDef c9 fill:#8c564b,color:#fff; + classDef c10 fill:#c49c94,color:#000; + classDef c11 fill:#e377c2,color:#fff; + classDef c12 fill:#f7b6d2,color:#000; + classDef c13 fill:#bcbd22,color:#fff; + classDef c14 fill:#dbdb8d,color:#000; + classDef c14a fill:#dbdb8d8a,color:#000; + classDef c15 fill:#17becf,color:#fff; + classDef c16 fill:#9edae5,color:#000; + + class s1,s5 c4 + class inf,sup,te1,ee0,ts1,es0 c4a + class pomn,p00,p01,p06,p07,p02n position +``` + +_Lossy Interval Distribution_ will contain only interval `4` as it exists in both distributions. + + + + +## Mathematical Definition + +Let $ID$ is [_Intervals distribution_](../intervals_distribution/index.md#mathematical-definition) + +Define _Lossy Interval Distribution_ + +$$LID: \{ID\} \times \{ID\} \longrightarrow \{ID\}$$ + +$$LID(ID_1, ID_2)(i) = min \{ID_1(i), ID_2(i) \}$$ diff --git a/docs/fundamentals/order/intervals_distribution/redundant.md b/docs/fundamentals/order/intervals_distribution/redundant.md new file mode 100644 index 00000000..3f45a07c --- /dev/null +++ b/docs/fundamentals/order/intervals_distribution/redundant.md @@ -0,0 +1,62 @@ +# Redundant Intervals Distribution + +A _redundant intervals distribution_ is an aggregation of two _interval distributions_ having all intervals from the first one and intervals existing only the second. + +_Redundant Interval Distribution_ is a union of two distributions. + + +Mostly, this distribution is used to solve measure dependence on _Binding direction_ with [_Bounded binding_](../intervals_chain/bounded.md). +In that case, this would be equivalent to counting both intervals - first for _Start binding direction_ and _End binding direction_. + +For example, there are 2 distributions for _Bounded Binding_ - one uses _Start binding direction_ and the other _End binding direction_. + +``` mermaid +block-beta + columns 8 + p0["0"] p1["1"] space:3 p5["5"] p6["6"] p7["7"] + inf["⊥"] s1["A"] s2["C"] s3["T"] s4["C"] s5["A"] s6["G"] sup["⊥"] + space es0["Start(1) = 1"]:1 ts1["Start(5)=4"]:5 space + space te1["End(1) = 4"]:4 ee0["End(5) = 2"]:2 space + + classDef imaginary fill:#526cfe09,color:#000,stroke-dasharray: 10 5; + classDef position fill:#fff,color:#000,stroke-width:0px; + class inf,sup imaginary + class p0,p1,p5,p6,p7 position + + classDef c1 fill:#ff7f0e,color:#fff; + classDef c2 fill:#ffbb78,color:#000; + classDef c2a fill:#ffbb788a,color:#000; + classDef c3 fill:#2ca02c,color:#fff; + classDef c4 fill:#98df8a,color:#000; + classDef c4a fill:#98df8a8a,color:#000; + classDef c5 fill:#d62728,color:#fff; + classDef c6 fill:#ff9896,color:#000; + classDef c6a fill:#ff98968a,color:#000; + classDef c7 fill:#9467bd,color:#fff; + classDef c8 fill:#c5b0d5,color:#000; + classDef c9 fill:#8c564b,color:#fff; + classDef c10 fill:#c49c94,color:#000; + classDef c11 fill:#e377c2,color:#fff; + classDef c12 fill:#f7b6d2,color:#000; + classDef c13 fill:#bcbd22,color:#fff; + classDef c14 fill:#dbdb8d,color:#000; + classDef c14a fill:#dbdb8d8a,color:#000; + classDef c15 fill:#17becf,color:#fff; + classDef c16 fill:#9edae5,color:#000; + + class s1,s5 c4 + class inf,sup,te1,ee0,ts1,es0 c4a + class pomn,p00,p01,p06,p07,p02n position +``` + +_Redundant Interval Distribution_ will include all intervals `[1, 4, 2]`. + +## Mathematical Definition + +Let $ID$ is [_Intervals distribution_](../intervals_distribution/index.md#mathematical-definition) + +Define _Redundunt Interval Distribution_ + +$$RID: \{ID\} \times \{ID\} \longrightarrow \{ID\}$$ + +$$RID(ID_1, ID_2)(i) = max \{ID_1(i), ID_2(i) \}$$ diff --git a/docs/fundamentals/objects/order.md b/docs/fundamentals/order/order.md similarity index 100% rename from docs/fundamentals/objects/order.md rename to docs/fundamentals/order/order.md diff --git a/docs/fundamentals/objects/sequence.md b/docs/fundamentals/order/sequence.md similarity index 96% rename from docs/fundamentals/objects/sequence.md rename to docs/fundamentals/order/sequence.md index 1451d50d..7203ee78 100644 --- a/docs/fundamentals/objects/sequence.md +++ b/docs/fundamentals/order/sequence.md @@ -5,7 +5,7 @@ This is the basic object for analyzing patterns, relationships, and structural p ## Mathematical Definition -Let $X$ is [_Carrier set_](./carrier_set.md#Mathematical Definition) +Let $X$ is [_Carrier set_](./carrier_set.md#mathematical-definition) A _sequence_ $S$ is a n-tuple defined as diff --git a/mkdocs.yml b/mkdocs.yml index e724d88e..c8aba365 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -11,20 +11,27 @@ nav: - "Congeneric decomposition": fundamentals/ideas/congeneric_decomposition.md - "Interval as a basic information unit": fundamentals/ideas/interval_as_a_basic_information_unit.md - "Geomteric mean as alternative to probability": fundamentals/ideas/geometric_mean_based_characteristics.md - - "Objects": - - fundamentals/objects/index.md - - "Carrier set": fundamentals/objects/carrier_set.md - - "Sequence": fundamentals/objects/sequence.md - - "Alphabet": fundamentals/objects/alphabet.md - - "Order": fundamentals/objects/order.md + - "Order and its measures": + - fundamentals/order/index.md + - "Carrier set": fundamentals/order/carrier_set.md + - "Sequence": fundamentals/order/sequence.md + - "Alphabet": fundamentals/order/alphabet.md + - "Order": fundamentals/order/order.md - "Intervals Chain": - - fundamentals/objects/intervals_chain/index.md - - "Bounded": fundamentals/objects/intervals_chain/bounded.md - - "Cycled": fundamentals/objects/intervals_chain/cycled.md + - fundamentals/order/intervals_chain/index.md + - "Bounded": fundamentals/order/intervals_chain/bounded.md + - "Cycled": fundamentals/order/intervals_chain/cycled.md - "Intervals Distribution": - - fundamentals/objects/intervals_distribution/index.md - - "Lossy": fundamentals/objects/intervals_distribution/lossy.md - - "Redundant": fundamentals/objects/intervals_distribution/redundant.md + - fundamentals/order/intervals_distribution/index.md + - "Lossy": fundamentals/order/intervals_distribution/lossy.md + - "Redundant": fundamentals/order/intervals_distribution/redundant.md + - "Characteristics": + - fundamentals/order/characteristics/index.md + - "Arithmetic mean": fundamentals/order/characteristics/arithmetic_mean.md + - "Geometric mean": fundamentals/characteristics/geometric_mean.md + - "Average remoteness": fundamentals/order/characteristics/average_remoteness.md + - "Depth": fundamentals/order/characteristics/depth.md + - "Volume": fundamentals/order/characteristics/volume.md - "Congeneric decomposition": - fundamentals/congeneric_decomposition/index.md - "Congeneric sequences": fundamentals/congeneric_decomposition/congeneric_sequences.md @@ -32,17 +39,17 @@ nav: - "Congeneric intervals order": fundamentals/congeneric_decomposition/congeneric_intervals_order.md - "Congeneric intervals tuple": fundamentals/congeneric_decomposition/congeneric_intervals_tuple.md - "Congeneric intervals distribution": fundamentals/congeneric_decomposition/congeneric_intervals_distribution.md - - "Characteristics": - - fundamentals/characteristics/index.md - - "Arithmetic mean": fundamentals/characteristics/arithmetic_mean.md - - "Average remoteness": fundamentals/characteristics/average_remoteness.md - - "Depth": fundamentals/characteristics/depth.md - - "Descriptive information": fundamentals/characteristics/descriptive_information.md - - "Geometric mean": fundamentals/characteristics/geometric_mean.md - - "Identifying information": fundamentals/characteristics/identifying_information.md - - "Periodicity": fundamentals/characteristics/periodicity.md - - "Uniformity": fundamentals/characteristics/uniformity.md - - "Volume": fundamentals/characteristics/volume.md + - "Characteristics": + - fundamentals/congeneric_decomposition/characteristics/index.md + - "Arithmetic means": fundamentals/congeneric_decomposition/characteristics/arithmetic_mean.md + - "Average remotenesses": fundamentals/congeneric_decomposition/characteristics/average_remoteness.md + - "Depths": fundamentals/congeneric_decomposition/characteristics/depth.md + - "Descriptive informations": fundamentals/congeneric_decomposition/characteristics/descriptive_information.md + - "Geometric means": fundamentals/congeneric_decomposition/characteristics/geometric_mean.md + - "Identifying information": fundamentals/congeneric_decomposition/characteristics/identifying_information.md + - "Periodicity": fundamentals/congeneric_decomposition/characteristics/periodicity.md + - "Uniformity": fundamentals/congeneric_decomposition/characteristics/uniformity.md + - "Volume": fundamentals/congeneric_decomposition/characteristics/volume.md - "Connections to other mathfields": - fundamentals/connections_to_other_mathfields/index.md - "Information theory": fundamentals/connections_to_other_mathfields/information_theory.md From e3922c7f7db0768ea4ff49ae44ca0b5d8b16abae Mon Sep 17 00:00:00 2001 From: Igor Rodionov Date: Mon, 7 Jul 2025 20:13:24 +0200 Subject: [PATCH 29/35] Restore characteristics --- docs/references/characteristics/arithmetic_mean.md | 2 ++ docs/references/characteristics/average_remoteness.md | 2 ++ docs/references/characteristics/depth.md | 2 ++ docs/references/characteristics/geometric_mean.md | 2 ++ docs/references/characteristics/volume.md | 2 ++ 5 files changed, 10 insertions(+) create mode 100644 docs/references/characteristics/arithmetic_mean.md create mode 100644 docs/references/characteristics/average_remoteness.md create mode 100644 docs/references/characteristics/depth.md create mode 100644 docs/references/characteristics/geometric_mean.md create mode 100644 docs/references/characteristics/volume.md diff --git a/docs/references/characteristics/arithmetic_mean.md b/docs/references/characteristics/arithmetic_mean.md new file mode 100644 index 00000000..4424a599 --- /dev/null +++ b/docs/references/characteristics/arithmetic_mean.md @@ -0,0 +1,2 @@ +# foapy.characteristics.arithmetic_mean +::: foapy.characteristics.arithmetic_mean diff --git a/docs/references/characteristics/average_remoteness.md b/docs/references/characteristics/average_remoteness.md new file mode 100644 index 00000000..5db08eb3 --- /dev/null +++ b/docs/references/characteristics/average_remoteness.md @@ -0,0 +1,2 @@ +# foapy.characteristics.average_remoteness +::: foapy.characteristics.average_remoteness diff --git a/docs/references/characteristics/depth.md b/docs/references/characteristics/depth.md new file mode 100644 index 00000000..e27c9bbf --- /dev/null +++ b/docs/references/characteristics/depth.md @@ -0,0 +1,2 @@ +# foapy.characteristics.depth +::: foapy.characteristics.depth diff --git a/docs/references/characteristics/geometric_mean.md b/docs/references/characteristics/geometric_mean.md new file mode 100644 index 00000000..479616a6 --- /dev/null +++ b/docs/references/characteristics/geometric_mean.md @@ -0,0 +1,2 @@ +# foapy.characteristics.geometric_mean +::: foapy.characteristics.geometric_mean diff --git a/docs/references/characteristics/volume.md b/docs/references/characteristics/volume.md new file mode 100644 index 00000000..c09a1dd7 --- /dev/null +++ b/docs/references/characteristics/volume.md @@ -0,0 +1,2 @@ +# foapy.characteristics.volume +::: foapy.characteristics.volume From 315727c8dbfe09b8177b5668195d67cbc51f7fd1 Mon Sep 17 00:00:00 2001 From: Igor Rodionov Date: Mon, 7 Jul 2025 20:43:52 +0200 Subject: [PATCH 30/35] Fix docs warnings --- .../order/characteristics/index.md | 7 +++++ .../order/intervals_chain/bounded.md | 2 +- .../order/intervals_chain/cycled.md | 2 +- .../order/intervals_chain/index.md | 2 +- .../order/intervals_distribution/index.md | 2 +- docs/references/characteristics/index.md | 16 +++++----- docs/references/characteristics/ma/index.md | 12 ++++---- docs/references/exceptions/index.md | 4 +-- docs/references/ma/index.md | 2 +- mkdocs.yml | 2 +- src/foapy/characteristics/_regularity.py | 6 ++-- src/foapy/characteristics/_uniformity.py | 6 ++-- src/foapy/ma/_intervals.py | 29 ++++++++++++------- 13 files changed, 53 insertions(+), 39 deletions(-) diff --git a/docs/fundamentals/order/characteristics/index.md b/docs/fundamentals/order/characteristics/index.md index e69de29b..830da48e 100644 --- a/docs/fundamentals/order/characteristics/index.md +++ b/docs/fundamentals/order/characteristics/index.md @@ -0,0 +1,7 @@ +# Characteristics + +| Linear scale | || Logarifmic scale | | +|------------- |-||-|-----------------| +| [Arithmetic Mean](arithmetic_mean.md) | $\Delta_a = \frac{1}{n} * \sum_{i=1}^{n} \Delta_{i}$ || | | +| [Geometric Mean](geometric_mean.md) | $\Delta_g=\sqrt[n]{\prod_{i=1}^{n} \Delta_{i}}$ || $g = \frac{1}{n} * \sum_{i=1}^{n} \log_2 \Delta_{i}$ | [Average Remoteness](average_remoteness.md) | +| [Volume](volume.md) | $V=\prod_{i=1}^{n} \Delta_{i}$ || $G=\sum_{i=1}^{n} \log_2 \Delta_{i}$ | [Depth](depth.md) | diff --git a/docs/fundamentals/order/intervals_chain/bounded.md b/docs/fundamentals/order/intervals_chain/bounded.md index a94c83d4..80f69062 100644 --- a/docs/fundamentals/order/intervals_chain/bounded.md +++ b/docs/fundamentals/order/intervals_chain/bounded.md @@ -244,4 +244,4 @@ _Intervals chain_ $IC$ have been calculated with _Bounded binding_ have a specia --- -Let $B = \{Start, End\} \subset \{Binding\}$ is set of [_Bounded Binding_](./binding.md#Mathematical Definition) +Let $B = \{Start, End\} \subset \{Binding\}$ is set of _Bounded Binding_ diff --git a/docs/fundamentals/order/intervals_chain/cycled.md b/docs/fundamentals/order/intervals_chain/cycled.md index 15b1292e..04dc4dcf 100644 --- a/docs/fundamentals/order/intervals_chain/cycled.md +++ b/docs/fundamentals/order/intervals_chain/cycled.md @@ -261,4 +261,4 @@ _Intervals chain_ $IC$ have been calculated with _Bounded binding_ have a specia --- -Let $B = \{Start, End\} \subset \{Binding\}$ is set of [_Cycled Binding_](./binding.md#Mathematical Definition) +Let $B = \{Start, End\} \subset \{Binding\}$ is set of _Cycled Binding_ diff --git a/docs/fundamentals/order/intervals_chain/index.md b/docs/fundamentals/order/intervals_chain/index.md index f1652ec0..75c1b6f3 100644 --- a/docs/fundamentals/order/intervals_chain/index.md +++ b/docs/fundamentals/order/intervals_chain/index.md @@ -424,7 +424,7 @@ There should exists an inverse function that restores by _interval chain_ a sequ Formal order analysis identifies two groups of _Bindings_: -- [Bounded](./bounded.md.md) - consider a sequence to be finite and bounded. Operates with the minimum data required to determine _intervals chains_ and _sequence_. +- [Bounded](./bounded.md) - consider a sequence to be finite and bounded. Operates with the minimum data required to determine _intervals chains_ and _sequence_. - [Cycled](./cycled.md) - treats a sequence as a subsequence representing an infinite sequence. Connects FOA with the fundamental ideas underlying statistics and probability theory. ## Mathematical Definition diff --git a/docs/fundamentals/order/intervals_distribution/index.md b/docs/fundamentals/order/intervals_distribution/index.md index 224b1d4c..105a978a 100644 --- a/docs/fundamentals/order/intervals_distribution/index.md +++ b/docs/fundamentals/order/intervals_distribution/index.md @@ -95,7 +95,7 @@ An _intervals distribution_ is an n-tuple of natural numbers where the index rep --- -_Intervals distribution_ used as an input data in calculating [characteristics](../../characteristics/index.md). +_Intervals distribution_ used as an input data in calculating [characteristics](../characteristics/index.md). While characteristics could be calculated based on the _itervals chain_ _intervals distribution_ highlights that intervals themselves are enough to measure the [order](../order.md) of a sequence and intervals connectivity in _intervals chain_ does not affect measure values. Whether it is possible in general to reconstruct distinctly an _interval chain_ by the given _interval distribution_ is an open question. diff --git a/docs/references/characteristics/index.md b/docs/references/characteristics/index.md index 347e0abd..0946a1fd 100644 --- a/docs/references/characteristics/index.md +++ b/docs/references/characteristics/index.md @@ -11,19 +11,19 @@ The table below summarizes the available characteristics that depend only on int | Linear scale | || Logarifmic scale | | |------------- |-||-|-----------------| -| [Arithmetic Mean](/references/characteristics/arithmetic_mean/) | $\Delta_a = \frac{1}{n} * \sum_{i=1}^{n} \Delta_{i}$ || | | -| [Geometric Mean](/references/characteristics/geometric_mean/) | $\Delta_g=\sqrt[n]{\prod_{i=1}^{n} \Delta_{i}}$ || $g = \frac{1}{n} * \sum_{i=1}^{n} \log_2 \Delta_{i}$ | [Average Remoteness](/references/characteristics/average_remoteness/) | -| [Volume](/references/characteristics/volume/) | $V=\prod_{i=1}^{n} \Delta_{i}$ || $G=\sum_{i=1}^{n} \log_2 \Delta_{i}$ | [Depth](/references/characteristics/depth/) | +| [Arithmetic Mean](arithmetic_mean.md) | $\Delta_a = \frac{1}{n} * \sum_{i=1}^{n} \Delta_{i}$ || | | +| [Geometric Mean](geometric_mean.md) | $\Delta_g=\sqrt[n]{\prod_{i=1}^{n} \Delta_{i}}$ || $g = \frac{1}{n} * \sum_{i=1}^{n} \log_2 \Delta_{i}$ | [Average Remoteness](average_remoteness.md) | +| [Volume](volume.md) | $V=\prod_{i=1}^{n} \Delta_{i}$ || $G=\sum_{i=1}^{n} \log_2 \Delta_{i}$ | [Depth](depth.md) | The table below summarizes the available characteristics that depend on cogeneric intervals ( grouped by element of the alphabet): | Characteristics | | |-------------------------------|---------------------------------------------------------------------------------------------------------| -| [Descriptive Information](/references/characteristics/descriptive_information/) | $D=\prod_{j=1}^{m}{\left(\sum_{i=1}^{n_j}{\frac{\Delta_{ij}}{n_j}}\right)^{\frac{n_j}{n}}}$ | -| [Identifying Information](/references/characteristics/identifying_information/) | $H=\frac {1} {n} * \sum_{j=1}^{m}{(n_j * \log_2 \sum_{i=1}^{n_j} \frac{\Delta_{ij}}{n_j})}$ | -| [Regularity](/references/characteristics/regularity/) | $r= \sqrt[n]{\prod_{j=1}^{m} \frac{\prod_{j=1}^{n_j} \Delta_{ij}}{{\left(\frac{1}{n_j}\sum_{i=1}^{n_j}{\Delta_{ij}}\right)^{n_j}}}}$ | -| [Uniformity](/references/characteristics/uniformity/) | $u = \frac {1} {n} * \sum_{j=1}^{m}{\log_2 \frac{ (\sum_{i=1}^{n_j} \frac{\Delta_{ij}}{n_j})^{n_j} } { \prod_{i=1}^{n_j} \Delta_{ij}}}$ | +| [Descriptive Information](descriptive_information.md) | $D=\prod_{j=1}^{m}{\left(\sum_{i=1}^{n_j}{\frac{\Delta_{ij}}{n_j}}\right)^{\frac{n_j}{n}}}$ | +| [Identifying Information](identifying_information.md) | $H=\frac {1} {n} * \sum_{j=1}^{m}{(n_j * \log_2 \sum_{i=1}^{n_j} \frac{\Delta_{ij}}{n_j})}$ | +| [Regularity](regularity.md) | $r= \sqrt[n]{\prod_{j=1}^{m} \frac{\prod_{j=1}^{n_j} \Delta_{ij}}{{\left(\frac{1}{n_j}\sum_{i=1}^{n_j}{\Delta_{ij}}\right)^{n_j}}}}$ | +| [Uniformity](uniformity.md) | $u = \frac {1} {n} * \sum_{j=1}^{m}{\log_2 \frac{ (\sum_{i=1}^{n_j} \frac{\Delta_{ij}}{n_j})^{n_j} } { \prod_{i=1}^{n_j} \Delta_{ij}}}$ | -[ma](/references/characteristics/ma/) subpackage provides characteristics for cogeneric intervals ( grouped by element). +[ma](ma/index.md) subpackage provides characteristics for cogeneric intervals ( grouped by element). diff --git a/docs/references/characteristics/ma/index.md b/docs/references/characteristics/ma/index.md index 8d84d7e4..a90bb316 100644 --- a/docs/references/characteristics/ma/index.md +++ b/docs/references/characteristics/ma/index.md @@ -10,15 +10,15 @@ The table below summarizes vector representation of the characteristics that dep | Linear scale | |Logarifmic scale | | |------------- |-||-----------------| -| [Arithmetic Mean](/references/characteristics/ma/arithmetic_mean/) | $\left[ \Delta_{a_j} \right]_{1 \le j \le m} = \left[ \frac{1}{n_j} * \sum_{i=1}^{n_j} \Delta_{ij} \right]_{1 \le j \le m}$ || | -| [Geometric Mean](/references/characteristics/ma/geometric_mean/) | $\left[ \Delta_{g_j} \right]_{1 \le j \le m} = \left[ \left( \prod_{i=1}^{n_j} \Delta_{ij} \right)^{1/n_j} \right]_{1 \le j \le m}$ | $\left[ g_j \right]_{1 \le j \le m} = \left[ \frac{1}{n_j} * \sum_{i=1}^{n_j} \log_2 \Delta_{ij} \right]_{1 \le j \le m}$ | [Average Remoteness](/references/characteristics/ma/average_remoteness/) | -| [Volume](/references/characteristics/ma/volume/) | $\left[ V_j \right]_{1 \le j \le m} = \left[ \prod_{i=1}^{n_j} \Delta_{ij} \right]_{1 \le j \le m}$ |$\left[ G_j \right]_{1 \le j \le m} = \left[ \sum_{i=1}^{n_j} \log_2 \Delta_{ij} \right]_{1 \le j \le m}$| [Depth](/references/characteristics/ma/depth/) | +| [Arithmetic Mean](arithmetic_mean.md) | $\left[ \Delta_{a_j} \right]_{1 \le j \le m} = \left[ \frac{1}{n_j} * \sum_{i=1}^{n_j} \Delta_{ij} \right]_{1 \le j \le m}$ || | +| [Geometric Mean](geometric_mean.md) | $\left[ \Delta_{g_j} \right]_{1 \le j \le m} = \left[ \left( \prod_{i=1}^{n_j} \Delta_{ij} \right)^{1/n_j} \right]_{1 \le j \le m}$ | $\left[ g_j \right]_{1 \le j \le m} = \left[ \frac{1}{n_j} * \sum_{i=1}^{n_j} \log_2 \Delta_{ij} \right]_{1 \le j \le m}$ | [Average Remoteness](average_remoteness.md) | +| [Volume](volume.md) | $\left[ V_j \right]_{1 \le j \le m} = \left[ \prod_{i=1}^{n_j} \Delta_{ij} \right]_{1 \le j \le m}$ |$\left[ G_j \right]_{1 \le j \le m} = \left[ \sum_{i=1}^{n_j} \log_2 \Delta_{ij} \right]_{1 \le j \le m}$| [Depth](depth.md) | The table below summarizes the advanced characteristics of cogeneric intervals: | Characteristics | | |-------------------------------|---------------------------------------------------------------------------------------------------------| -| [Identifying Information](/references/characteristics/ma/identifying_information/) | $\left[ H_j \right]_{1 \le j \le m} = \left[ \log_2 { \left(\frac{1}{n_j} * \sum_{i=1}^{n_j} \Delta_{ij} \right) } \right]_{1 \le j \le m}$ | -| [Periodicity](/references/characteristics/ma/periodicity/) | $\left[ \tau_j \right]_{1 \le j \le m} = \left[ \left( \prod_{i=1}^{n_j} \Delta_{ij} \right)^{1/n_j} * \frac{ n_j }{ \sum_{i=1}^{n_j} \Delta_{ij} } \right]_{1 \le j \le m}$ | -| [Uniformity](/references/characteristics/ma/uniformity/) | $\left[ u_j \right]_{1 \le j \le m} = \left[ \log_2 { \left(\frac{1}{n_j} * \sum_{i=1}^{n_j} \Delta_{ij} \right) } - \frac{1}{n_j} * \sum_{i=1}^{n_j} \log_2 \Delta_{ij} \right]_{1 \le j \le m}$ | +| [Identifying Information](identifying_information.md) | $\left[ H_j \right]_{1 \le j \le m} = \left[ \log_2 { \left(\frac{1}{n_j} * \sum_{i=1}^{n_j} \Delta_{ij} \right) } \right]_{1 \le j \le m}$ | +| [Periodicity](periodicity.md) | $\left[ \tau_j \right]_{1 \le j \le m} = \left[ \left( \prod_{i=1}^{n_j} \Delta_{ij} \right)^{1/n_j} * \frac{ n_j }{ \sum_{i=1}^{n_j} \Delta_{ij} } \right]_{1 \le j \le m}$ | +| [Uniformity](uniformity.md) | $\left[ u_j \right]_{1 \le j \le m} = \left[ \log_2 { \left(\frac{1}{n_j} * \sum_{i=1}^{n_j} \Delta_{ij} \right) } - \frac{1}{n_j} * \sum_{i=1}^{n_j} \log_2 \Delta_{ij} \right]_{1 \le j \le m}$ | diff --git a/docs/references/exceptions/index.md b/docs/references/exceptions/index.md index 7007095f..f527da66 100644 --- a/docs/references/exceptions/index.md +++ b/docs/references/exceptions/index.md @@ -10,5 +10,5 @@ The table below summarizes the available exceptions: | Exception | Description | |-----------|-------------| -| [Not1DArrayException](/references/exceptions/not_1d_array/) | Raised when function receives not 1D array as input. | -| [InconsistentOrderException](/references/exceptions/inconsistent_order/) | Raised when function receives inconsistent order. | +| [Not1DArrayException](not_1d_array.md) | Raised when function receives not 1D array as input. | +| [InconsistentOrderException](inconsistent_order.md) | Raised when function receives inconsistent order. | diff --git a/docs/references/ma/index.md b/docs/references/ma/index.md index 82f88ea7..4eef273a 100644 --- a/docs/references/ma/index.md +++ b/docs/references/ma/index.md @@ -6,4 +6,4 @@ hide: The package provides a comprehensive set of functions that decompose sequence into cogeneric order and congeneric intervals. -The functions required by [vector representation of characteristics](/references/characteristics/ma) and [characteristics of order that depends on congeneric intervals distribution](/references/characteristics) are: +The functions required by vector representation of characteristics and [characteristics of order that depends on congeneric intervals distribution](../characteristics/index.md) are: diff --git a/mkdocs.yml b/mkdocs.yml index c8aba365..dfbba042 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -28,7 +28,7 @@ nav: - "Characteristics": - fundamentals/order/characteristics/index.md - "Arithmetic mean": fundamentals/order/characteristics/arithmetic_mean.md - - "Geometric mean": fundamentals/characteristics/geometric_mean.md + - "Geometric mean": fundamentals/order/characteristics/geometric_mean.md - "Average remoteness": fundamentals/order/characteristics/average_remoteness.md - "Depth": fundamentals/order/characteristics/depth.md - "Volume": fundamentals/order/characteristics/volume.md diff --git a/src/foapy/characteristics/_regularity.py b/src/foapy/characteristics/_regularity.py index 17768cc3..b41a8ce0 100644 --- a/src/foapy/characteristics/_regularity.py +++ b/src/foapy/characteristics/_regularity.py @@ -1,7 +1,7 @@ import numpy as np -def regularity(intervals, dtype=None): +def regularity(intervals_grouped, dtype=None): """ Calculates regularity of intervals grouped by element of the alphabet. @@ -75,7 +75,7 @@ def regularity(intervals, dtype=None): """ # noqa: E501 from foapy.characteristics import descriptive_information, geometric_mean - total_elements = np.concatenate(intervals) + total_elements = np.concatenate(intervals_grouped) g = geometric_mean(total_elements, dtype=dtype) - D = descriptive_information(intervals, dtype=dtype) + D = descriptive_information(intervals_grouped, dtype=dtype) return g / D diff --git a/src/foapy/characteristics/_uniformity.py b/src/foapy/characteristics/_uniformity.py index a9078ae3..31e6eb8e 100644 --- a/src/foapy/characteristics/_uniformity.py +++ b/src/foapy/characteristics/_uniformity.py @@ -1,7 +1,7 @@ import numpy as np -def uniformity(intervals, dtype=None): +def uniformity(intervals_grouped, dtype=None): """ Calculates uniformity of intervals grouped by element of the alphabet. @@ -71,9 +71,9 @@ def uniformity(intervals, dtype=None): """ # noqa: E501 from foapy.characteristics import average_remoteness, identifying_information - total_elements = np.concatenate(intervals) + total_elements = np.concatenate(intervals_grouped) - H = identifying_information(intervals, dtype=dtype) + H = identifying_information(intervals_grouped, dtype=dtype) g = average_remoteness(total_elements, dtype=dtype) return H - g diff --git a/src/foapy/ma/_intervals.py b/src/foapy/ma/_intervals.py index 8c001ef0..26b652c8 100644 --- a/src/foapy/ma/_intervals.py +++ b/src/foapy/ma/_intervals.py @@ -1,11 +1,12 @@ import numpy as np from numpy import ma -from foapy import binding, mode +from foapy import binding as binding_enum +from foapy import mode as mode_enum from foapy.exceptions import InconsistentOrderException, Not1DArrayException -def intervals(X, bind, mod): +def intervals(X, binding, mode): """ Finding array of array of intervals of the uniform sequences in the given input sequence @@ -157,13 +158,19 @@ def intervals(X, bind, mod): """ # Validate binding - if bind not in {binding.start, binding.end}: + if binding not in {binding_enum.start, binding_enum.end}: raise ValueError( {"message": "Invalid binding value. Use binding.start or binding.end."} ) # Validate mode - if mod not in {mode.lossy, mode.normal, mode.cycle, mode.redundant}: + valid_modes = { + mode_enum.lossy, + mode_enum.normal, + mode_enum.cycle, + mode_enum.redundant, + } + if mode not in valid_modes: raise ValueError( {"message": "Invalid mode value. Use mode.lossy,normal,cycle or redundant."} ) @@ -199,7 +206,7 @@ def intervals(X, bind, mod): ) extended_mask = np.empty((power, length + 1), dtype=bool) - if bind == binding.end: + if binding == binding_enum.end: extended_mask[:, :-1] = ~mask[::-1, ::-1] else: extended_mask[:, :-1] = ~mask @@ -217,33 +224,33 @@ def intervals(X, bind, mod): indecies = np.zeros(positions.shape[1], dtype=int) indecies[1:] = positions[1, 1:] - positions[1, :-1] - delta = indecies[last_indexes] if mod == mode.cycle else 1 + delta = indecies[last_indexes] if mode == mode_enum.cycle else 1 indecies[first_indexes] = positions[1][first_indexes] + delta split_boarders = np.zeros(power * 2, dtype=int) - if mod == mode.lossy: + if mode == mode_enum.lossy: split_boarders[positions[0][last_indexes[:1]] * 2] = first_indexes[:1] + 1 split_boarders[positions[0][last_indexes[1:]] * 2] = ( np.fmax(last_indexes[:-1], first_indexes[1:]) + 1 ) split_boarders[positions[0][last_indexes] * 2 + 1] = last_indexes - elif mod == mode.normal: + elif mode == mode_enum.normal: split_boarders[positions[0][last_indexes[:1]] * 2] = 0 split_boarders[positions[0][last_indexes[1:]] * 2] = last_indexes[:-1] + 1 split_boarders[positions[0][last_indexes] * 2 + 1] = last_indexes - elif mod == mode.cycle: + elif mode == mode_enum.cycle: split_boarders[positions[0][last_indexes[:1]] * 2] = 0 split_boarders[positions[0][last_indexes[1:]] * 2] = last_indexes[:-1] + 1 split_boarders[positions[0][last_indexes] * 2 + 1] = last_indexes - elif mod == mode.redundant: + elif mode == mode_enum.redundant: split_boarders[positions[0][last_indexes[:1]] * 2] = 0 split_boarders[positions[0][last_indexes[1:]] * 2] = 0 split_boarders[positions[0][last_indexes] * 2 + 1] = last_indexes + 1 preserve_previous = np.frompyfunc(lambda x, y: x if y == 0 else y, 2, 1) split_boarders = preserve_previous.accumulate(split_boarders) - if bind == binding.end: + if binding == binding_enum.end: split_boarders[:-1] = np.diff(split_boarders) split_boarders[-1:] = len(indecies) - split_boarders[-1] split_boarders = np.cumsum(split_boarders[::-1]) From 0f2ae3fb22e3a6c7685a1f3e8655999a8329a615 Mon Sep 17 00:00:00 2001 From: Igor Rodionov Date: Tue, 8 Jul 2025 12:27:47 +0200 Subject: [PATCH 31/35] Added docs for characteristics --- .../order/characteristics/arithmetic_mean.md | 47 ++++++++++++++++++- .../characteristics/average_remoteness.md | 32 ++++++++++++- .../order/characteristics/depth.md | 35 +++++++++++++- .../order/characteristics/geometric_mean.md | 32 ++++++++++++- .../order/characteristics/index.md | 22 ++++++++- .../order/characteristics/volume.md | 34 +++++++++++++- docs/fundamentals/order/index.md | 34 ++++++++++---- .../order/intervals_chain/bounded.md | 8 ++-- .../order/intervals_chain/cycled.md | 8 ++-- .../order/intervals_chain/index.md | 4 +- docs/references/characteristics/index.md | 2 +- docs/references/characteristics/ma/index.md | 2 +- mkdocs.yml | 3 +- 13 files changed, 229 insertions(+), 34 deletions(-) diff --git a/docs/fundamentals/order/characteristics/arithmetic_mean.md b/docs/fundamentals/order/characteristics/arithmetic_mean.md index 4424a599..b5fd3ec9 100644 --- a/docs/fundamentals/order/characteristics/arithmetic_mean.md +++ b/docs/fundamentals/order/characteristics/arithmetic_mean.md @@ -1,2 +1,45 @@ -# foapy.characteristics.arithmetic_mean -::: foapy.characteristics.arithmetic_mean +# Arithmetic mean interval + +Arithmetic mean interval is an additive measure indifferent to interval ratios. +The arithmetic mean could be used as a reference for comparing with the geometric mean. +The geometric mean and the arithmetic mean are equal when all intervals are equal, +which is true only for the periodic appearance of the elements in the sequence. + +## Mathematical Definition + +The arithmetic mean interval can be calculated + +### from Intervals Chain + +Let $IC$ is [_Intervals Chain_](../intervals_chain/index.md#mathematical-definition) described as n-tuple + +$$IC = <\Delta_1, \Delta_2, ..., \Delta_n> | \forall j \in \{1,...,n\} \exists \Delta_j \in \{1,...,n\}$$ + +$$\Delta_a = \frac{1}{n} \times \sum_{i=1}^{n} \Delta_{i}$$ + +### from Intervals Distribution + +Let $ID$ is [_Intervals Distribution_](../intervals_distribution/index.md#mathematical-definition) described as function + +$$ID : \{1,...,n\} \longrightarrow \{1,...,n\}$$ + +$$\Delta_a(ID) = \frac{\sum_{i=1}^{n} \big(i \times ID(i)\big)}{\sum_{i=1}^{n} ID(i)}$$ + +### Properties + +__With Cycle Bindings, the arithmetic mean interval equals the cardinality of an alphabet__ + +=== "Intervals chain based" + $IC$ produced by [_Cycled Binding_](../intervals_chain/cycled.md#mathematical-definition) + + $\Delta_a = |alphabet(Intervals^{-1}(IC))|$ + +=== "Sequence based" + + Let [Sequence](../sequence.md#mathematical-definition) $S$ + + $A=alphabet(S)$ is [Alpabet](../alphabet.md#mathematical-definition) + + $IC = Intervals(S)$ produced by [_Cycled Binding_](../intervals_chain/cycled.md#mathematical-definition) + + then $\Delta_a = |A|$ diff --git a/docs/fundamentals/order/characteristics/average_remoteness.md b/docs/fundamentals/order/characteristics/average_remoteness.md index 5db08eb3..e7dcb9a8 100644 --- a/docs/fundamentals/order/characteristics/average_remoteness.md +++ b/docs/fundamentals/order/characteristics/average_remoteness.md @@ -1,2 +1,30 @@ -# foapy.characteristics.average_remoteness -::: foapy.characteristics.average_remoteness +# Average Remoteness + +The Average Remoteness is equivalent of the [geometric mean interval](./geometric_mean.md) on a logarithmic scale. +It is sensitive to interval ratios and is preferable from [computational point of view](https://en.wikipedia.org/wiki/Log_probability). + +## Mathematical Definition + +The Average Remoteness interval can be calculated + +### from Intervals Chain + +Let $IC$ is [_Intervals Chain_](../intervals_chain/index.md#mathematical-definition) described as n-tuple + +$$IC = <\Delta_1, \Delta_2, ..., \Delta_n> | \forall j \in \{1,...,n\} \exists \Delta_j \in \{1,...,n\}$$ + +$$g = \frac{1}{n} * \sum_{i=1}^{n} \log_2 \Delta_{i}$$ + +### from Intervals Distribution + +Let $ID$ is [_Intervals Distribution_](../intervals_distribution/index.md#mathematical-definition) described as function + +$$ID : \{1,...,n\} \longrightarrow \{1,...,n\}$$ + +$$g(ID) = \frac{\sum_{i=1}^{n} \big(i \times \log_2 ID(i)\big)}{\sum_{i=1}^{n} ID(i)}$$ + +### Properties + +__Geometric mean equals 2 power average remotness__ + +$$\Delta_g = 2^{g}$$ diff --git a/docs/fundamentals/order/characteristics/depth.md b/docs/fundamentals/order/characteristics/depth.md index e27c9bbf..564f50a4 100644 --- a/docs/fundamentals/order/characteristics/depth.md +++ b/docs/fundamentals/order/characteristics/depth.md @@ -1,2 +1,33 @@ -# foapy.characteristics.depth -::: foapy.characteristics.depth +# Depth + +The Depth is equivalent of [Volume](./volume.md) on on a logarithmic scale. +It is sensitive to interval ratios and their count (length of the sequence). +The Depth is better then Volume from [computational point of view](https://en.wikipedia.org/wiki/Log_probability) + +## Mathematical Definition + +The depth can be calculated + +### from Intervals Chain + +Let $IC$ is [_Intervals Chain_](../intervals_chain/index.md#mathematical-definition) described as n-tuple + +$$IC = <\Delta_1, \Delta_2, ..., \Delta_n> | \forall j \in \{1,...,n\} \exists \Delta_j \in \{1,...,n\}$$ + +$$G=\sum_{i=1}^{n} \log_2 \Delta_{i}$$ + +### from Intervals Distribution + +Let $ID$ is [_Intervals Distribution_](../intervals_distribution/index.md#mathematical-definition) described as function + +$$ID : \{1,...,n\} \longrightarrow \{1,...,n\}$$ + +$$V(ID)=\prod_{i=1}^{n} i^{ID(i)}$$ + +$$G(ID)=\sum_{i=1}^{n} \big(i \times \log_2 ID(i)\big)$$ + +### Properties + +__Volume equals 2 power depth__ + +$$V = 2^{G}$$ diff --git a/docs/fundamentals/order/characteristics/geometric_mean.md b/docs/fundamentals/order/characteristics/geometric_mean.md index 479616a6..df89d5b5 100644 --- a/docs/fundamentals/order/characteristics/geometric_mean.md +++ b/docs/fundamentals/order/characteristics/geometric_mean.md @@ -1,2 +1,30 @@ -# foapy.characteristics.geometric_mean -::: foapy.characteristics.geometric_mean +# Geometric mean interval + +The geometric mean interval is a multiplicative measure that is sensitive to interval ratios. +This property makes it a cornerstone in measuring [Order](../order.md). + +## Mathematical Definition + +The geometric mean interval can be calculated + +### from Intervals Chain + +Let $IC$ is [_Intervals Chain_](../intervals_chain/index.md#mathematical-definition) described as n-tuple + +$$IC = <\Delta_1, \Delta_2, ..., \Delta_n> | \forall j \in \{1,...,n\} \exists \Delta_j \in \{1,...,n\}$$ + +$$\Delta_g=\sqrt[n]{\prod_{i=1}^{n} \Delta_{i}}$$ + +### from Intervals Distribution + +Let $ID$ is [_Intervals Distribution_](../intervals_distribution/index.md#mathematical-definition) described as function + +$$ID : \{1,...,n\} \longrightarrow \{1,...,n\}$$ + +$$\Delta_g(ID)=\sqrt[l]{\prod_{i=1}^{n} i^{ID(i)}}, l = \sum_{i=1}^{n} ID(i)$$ + +### Properties + +__Geometric mean is less or equals arithmetic mean__ + +$$\Delta_g \le \Delta_a$$ diff --git a/docs/fundamentals/order/characteristics/index.md b/docs/fundamentals/order/characteristics/index.md index 830da48e..0408d37d 100644 --- a/docs/fundamentals/order/characteristics/index.md +++ b/docs/fundamentals/order/characteristics/index.md @@ -1,6 +1,26 @@ +--- +hide: + - toc +--- # Characteristics -| Linear scale | || Logarifmic scale | | +Formal Order Analysis defines several interval-based measures sensitive to the composition of elements in the original sequence. +All those characteristics are based on two main ideas. +The first one is - the geometric mean of two numbers depends on the ratio of them. +The arithmetic mean takes the same value `3` for `1, 5` and `2, 4` pairs, while the geometric mean will be different. + +The second is that the intervals we extract from the sequence depend on each other, +replacing two different neighboring elements in the original sequence will affect two intervals and affect the measure results. +We need to highlight that intervals, by definition, are measured between the same event appearances +implicitly encapsulate `information` about the event frequencies and the number of different event types. + +In practice, multiplication quickly leads to a stack overflow error. That makes using _linear-scaled_ measures really hard. +To address that problem, FOA uses _logarithmic-scaled_ measure that replaces multiplication of the intervals with the sum of their logarithms. + +All characteristics could be calculated based on [_Intervals Chain_](../intervals_chain/index.md) or [_Intervals Distribution_](../intervals_distribution/index.md). +The following table provides _Intervals Chain_ based formulas. + +| Linear scale | || Logarithmic scale | | |------------- |-||-|-----------------| | [Arithmetic Mean](arithmetic_mean.md) | $\Delta_a = \frac{1}{n} * \sum_{i=1}^{n} \Delta_{i}$ || | | | [Geometric Mean](geometric_mean.md) | $\Delta_g=\sqrt[n]{\prod_{i=1}^{n} \Delta_{i}}$ || $g = \frac{1}{n} * \sum_{i=1}^{n} \log_2 \Delta_{i}$ | [Average Remoteness](average_remoteness.md) | diff --git a/docs/fundamentals/order/characteristics/volume.md b/docs/fundamentals/order/characteristics/volume.md index c09a1dd7..63243261 100644 --- a/docs/fundamentals/order/characteristics/volume.md +++ b/docs/fundamentals/order/characteristics/volume.md @@ -1,2 +1,32 @@ -# foapy.characteristics.volume -::: foapy.characteristics.volume +# Volume + +The Volume is a product of all intervals, which is sensitive to interval ratios and their count. +The volume value has exponential grow by increasing the interval count (length of the sequence). +This fact makes it useless in computational models due to overflow error. +Use [_Depth_](./depth.md) as an equivalent measure on a logarithmic scale. + +## Mathematical Definition + +The volume can be calculated + +### from Intervals Chain + +Let $IC$ is [_Intervals Chain_](../intervals_chain/index.md#mathematical-definition) described as n-tuple + +$$IC = <\Delta_1, \Delta_2, ..., \Delta_n> | \forall j \in \{1,...,n\} \exists \Delta_j \in \{1,...,n\}$$ + +$$V=\prod_{i=1}^{n} \Delta_{i}$$ + +### from Intervals Distribution + +Let $ID$ is [_Intervals Distribution_](../intervals_distribution/index.md#mathematical-definition) described as function + +$$ID : \{1,...,n\} \longrightarrow \{1,...,n\}$$ + +$$V(ID)=\prod_{i=1}^{n} i^{ID(i)}$$ + +### Properties + +__Volume can be calculated base of geometric mean__ + +$$V = (\Delta_{g})^{n}$$ diff --git a/docs/fundamentals/order/index.md b/docs/fundamentals/order/index.md index 5b23eb61..812e28bc 100644 --- a/docs/fundamentals/order/index.md +++ b/docs/fundamentals/order/index.md @@ -203,10 +203,13 @@ The following diagrams give a hand in understanding how the Objects and Methods flowchart TB Start@{ shape: sm-circ, label: "" }-- Sequence -->fork1@{ shape: sm-circ, label: "" } fork1-- Sequence -->alphabet - alphabet-- Alphabet -->OA@{ shape: cross-circ } - fork1-- Sequence -->O@{label: "order"} - O-- Order -->OA@{ shape: sm-circ, label: "order + alphabet" } + alphabet-- Alphabet -->OA@{ shape: sm-circ } + fork1-- Sequence -->order + order-- Order -->OA OA-- Sequence -->End@{ shape: sm-circ } + + click alphabet "./alphabet" "Alphabet" + click order "./order" "Order" ``` === "Interval-based characteristics" @@ -215,23 +218,36 @@ The following diagrams give a hand in understanding how the Objects and Methods Start@{ shape: sm-circ, label: "" }-- Sequence -->fork1@{ shape: sm-circ, label: "" } fork1-- Sequence -->alphabet alphabet-- Alphabet -->OA@{ shape: cross-circ } - O@{label: "order"}-- Order -->OA@{ shape: sm-circ } + order-- Order -->OA@{ shape: sm-circ } OA-- Sequence -->End@{ shape: sm-circ } fork1@{ shape: sm-circ, label: "" }-- Sequence -->intervals intervals-- Intervals Chain -->fork@{ shape: sm-circ, label: "" } fork@{ shape: sm-circ, label: "" }-- Intervals Chain -->inverseIntervals@{ label: "intervals⁻¹" } fork@{ shape: sm-circ, label: "" }-- Intervals Chain -->distribution - inverseIntervals@{ label: "intervals⁻¹" }-- Reconstructed Sequence --> O@{label: "order"} + inverseIntervals@{ label: "intervals⁻¹" }-- Reconstructed Sequence --> order distribution-- Intervals Distribution --> M@{ shape: sm-circ, label: "order + alphabet" } - M --> dg@{ label: "Δg" } M --> da@{ label: "Δa" } + M --> dg@{ label: "Δg" } M --> g@{ label: "g" } - M --> G@{ label: "G" } M --> V@{ label: "V" } - dg -- float --> EndMeasuredg@{ shape: sm-circ } + M --> G@{ label: "G" } da -- float --> EndMeasureda@{ shape: sm-circ } + dg -- float --> EndMeasuredg@{ shape: sm-circ } g -- float --> EndMeasureg@{ shape: sm-circ } - G -- float --> EndMeasureG@{ shape: sm-circ } V -- int --> EndMeasureV@{ shape: sm-circ } + G -- float --> EndMeasureG@{ shape: sm-circ } + + + click alphabet "./alphabet" "Alphabet" + click order "./order" "Order" + click intervals "./intervals_chain/#define-intervals-chain" "Intervals" + click inverseIntervals "./intervals_chain/#define-intervals-chain" "Intervals⁻" + click distribution "./intervals_distribution" "Distribution" + click distribution "./intervals_distribution" "Distribution" + click dg "./characteristics/geometric_mean" "Geomteric mean" + click da "./characteristics/arithmetic_mean" "Arithmetic mean" + click g "./characteristics/average_remoteness" "Average remoteness" + click G "./characteristics/depth" "Depth" + click V "./characteristics/volume" "Volume" ``` diff --git a/docs/fundamentals/order/intervals_chain/bounded.md b/docs/fundamentals/order/intervals_chain/bounded.md index 80f69062..60ea4cb8 100644 --- a/docs/fundamentals/order/intervals_chain/bounded.md +++ b/docs/fundamentals/order/intervals_chain/bounded.md @@ -157,7 +157,7 @@ Let $Binding$ is [Binding](./index.md#define-bindings) Define - $$IC = | \forall j \in \{1,...,n\} \exists ic_j \in \{1,...,n\},$$ + $$IC = <\Delta_1, \Delta_2, ..., \Delta_n> | \forall j \in \{1,...,n\} \exists \Delta_j \in \{1,...,n\},$$ $$\exists \ Intervals : \big\{S\} \longrightarrow \big\{ IC \big\},$$ @@ -181,14 +181,14 @@ Let $Binding$ is [Binding](./index.md#define-bindings) Where: - $n := |IC|$ is called _length_ of the _intervals chained_, $n \in N$ - - $ic_i$​ is called the $i$-th _element_ (or interval) of the _intervals chained_ + - $\Delta_i$​ is called the $i$-th _element_ (or interval) of the _intervals chained_ === "$End$ binding" Define - $$IC = | \forall j \in \{1,...,n\} \exists ic_j \in \{1,...,n\},$$ + $$IC = <\Delta_1, \Delta_2, ..., \Delta_n> | \forall j \in \{1,...,n\} \exists \Delta_j \in \{1,...,n\},$$ $$\exists \ Intervals : \big\{S\} \longrightarrow \big\{ IC \big\},$$ @@ -212,7 +212,7 @@ Let $Binding$ is [Binding](./index.md#define-bindings) Where: - $n := |IC|$ is called _length_ of the _intervals chained_, $n \in N$ - - $ic_i$​ is called the $i$-th _element_ (or interval) of the _intervals chained_ + - $\Delta_i$​ is called the $i$-th _element_ (or interval) of the _intervals chained_ --- diff --git a/docs/fundamentals/order/intervals_chain/cycled.md b/docs/fundamentals/order/intervals_chain/cycled.md index 04dc4dcf..64b56c74 100644 --- a/docs/fundamentals/order/intervals_chain/cycled.md +++ b/docs/fundamentals/order/intervals_chain/cycled.md @@ -178,7 +178,7 @@ $$S_{cycled}(S)(i) = S\big( i - n \times \lfloor ( i - 1) \div n \rfloor \big)$$ Define - $$IC = | \forall j \in \{1,...,n\} \exists ic_j \in \{1,...,n\},$$ + $$IC = <\Delta_1, \Delta_2, ..., \Delta_n> | \forall j \in \{1,...,n\} \exists \Delta_j \in \{1,...,n\},$$ $$\exists \ Intervals : \big\{S\} \longrightarrow \big\{ IC \big\},$$ @@ -202,14 +202,14 @@ $$S_{cycled}(S)(i) = S\big( i - n \times \lfloor ( i - 1) \div n \rfloor \big)$$ Where: - $n := |IC|$ is called _length_ of the _intervals chained_, $n \in N$ - - $ic_i$​ is called the $i$-th _element_ (or interval) of the _intervals chained_ + - $\Delta_i$​ is called the $i$-th _element_ (or interval) of the _intervals chained_ === "$End$ binding" Define - $$IC = | \forall j \in \{1,...,n\} \exists ic_j \in \{1,...,n\},$$ + $$IC = <\Delta_1, \Delta_2, ..., \Delta_n> | \forall j \in \{1,...,n\} \exists \Delta_j \in \{1,...,n\},$$ $$\exists \ Intervals : \big\{S\} \longrightarrow \big\{ IC \big\},$$ @@ -233,7 +233,7 @@ $$S_{cycled}(S)(i) = S\big( i - n \times \lfloor ( i - 1) \div n \rfloor \big)$$ Where: - $n := |IC|$ is called _length_ of the _intervals chained_, $n \in N$ - - $ic_i$​ is called the $i$-th _element_ (or interval) of the _intervals chained_ + - $\Delta_i$​ is called the $i$-th _element_ (or interval) of the _intervals chained_ --- diff --git a/docs/fundamentals/order/intervals_chain/index.md b/docs/fundamentals/order/intervals_chain/index.md index 75c1b6f3..32ec0ee4 100644 --- a/docs/fundamentals/order/intervals_chain/index.md +++ b/docs/fundamentals/order/intervals_chain/index.md @@ -455,7 +455,7 @@ $$Iterator(S) = Iterator(Iterator^{-1}(Iterator(S)))$$ as n-tuple of natural numbers -$$IC = | \forall j \in \{1,...,n\} \exists ic_j \in \{1,...,n\},$$ +$$IC = <\Delta_1, \Delta_2, ..., \Delta_n> | \forall j \in \{1,...,n\} \exists \Delta_j \in \{1,...,n\},$$ if and only if @@ -480,4 +480,4 @@ $$Trace(IC)(i) \in \bot | \forall i \in \{1,...,n\}$$ Where: - $n := |IC|$ is called _length_ of the _intervals chained_, $n \in N$ -- $ic_i$​ is called the $i$-th _element_ (or interval) of the _intervals chained_ +- $\Delta_i$​ is called the $i$-th _element_ (or interval) of the _intervals chained_ diff --git a/docs/references/characteristics/index.md b/docs/references/characteristics/index.md index 0946a1fd..a5afdbeb 100644 --- a/docs/references/characteristics/index.md +++ b/docs/references/characteristics/index.md @@ -9,7 +9,7 @@ The package provides a comprehensive set of characteristics for measuring the pr The table below summarizes the available characteristics that depend only on intervals: -| Linear scale | || Logarifmic scale | | +| Linear scale | || Logarithmic scale | | |------------- |-||-|-----------------| | [Arithmetic Mean](arithmetic_mean.md) | $\Delta_a = \frac{1}{n} * \sum_{i=1}^{n} \Delta_{i}$ || | | | [Geometric Mean](geometric_mean.md) | $\Delta_g=\sqrt[n]{\prod_{i=1}^{n} \Delta_{i}}$ || $g = \frac{1}{n} * \sum_{i=1}^{n} \log_2 \Delta_{i}$ | [Average Remoteness](average_remoteness.md) | diff --git a/docs/references/characteristics/ma/index.md b/docs/references/characteristics/ma/index.md index a90bb316..4f168a67 100644 --- a/docs/references/characteristics/ma/index.md +++ b/docs/references/characteristics/ma/index.md @@ -8,7 +8,7 @@ The package provides a comprehensive set of vector characteristics for measuring The table below summarizes vector representation of the characteristics that depend only on intervals: -| Linear scale | |Logarifmic scale | | +| Linear scale | |Logarithmic scale | | |------------- |-||-----------------| | [Arithmetic Mean](arithmetic_mean.md) | $\left[ \Delta_{a_j} \right]_{1 \le j \le m} = \left[ \frac{1}{n_j} * \sum_{i=1}^{n_j} \Delta_{ij} \right]_{1 \le j \le m}$ || | | [Geometric Mean](geometric_mean.md) | $\left[ \Delta_{g_j} \right]_{1 \le j \le m} = \left[ \left( \prod_{i=1}^{n_j} \Delta_{ij} \right)^{1/n_j} \right]_{1 \le j \le m}$ | $\left[ g_j \right]_{1 \le j \le m} = \left[ \frac{1}{n_j} * \sum_{i=1}^{n_j} \log_2 \Delta_{ij} \right]_{1 \le j \le m}$ | [Average Remoteness](average_remoteness.md) | diff --git a/mkdocs.yml b/mkdocs.yml index dfbba042..db37f756 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -29,15 +29,14 @@ nav: - fundamentals/order/characteristics/index.md - "Arithmetic mean": fundamentals/order/characteristics/arithmetic_mean.md - "Geometric mean": fundamentals/order/characteristics/geometric_mean.md + - "Volume": fundamentals/order/characteristics/volume.md - "Average remoteness": fundamentals/order/characteristics/average_remoteness.md - "Depth": fundamentals/order/characteristics/depth.md - - "Volume": fundamentals/order/characteristics/volume.md - "Congeneric decomposition": - fundamentals/congeneric_decomposition/index.md - "Congeneric sequences": fundamentals/congeneric_decomposition/congeneric_sequences.md - "Congeneric orders": fundamentals/congeneric_decomposition/congeneric_orders.md - "Congeneric intervals order": fundamentals/congeneric_decomposition/congeneric_intervals_order.md - - "Congeneric intervals tuple": fundamentals/congeneric_decomposition/congeneric_intervals_tuple.md - "Congeneric intervals distribution": fundamentals/congeneric_decomposition/congeneric_intervals_distribution.md - "Characteristics": - fundamentals/congeneric_decomposition/characteristics/index.md From a30e5091c2a8cd22ebda791532571da89428ce86 Mon Sep 17 00:00:00 2001 From: Igor Rodionov Date: Sun, 27 Jul 2025 23:49:00 +0200 Subject: [PATCH 32/35] Added Partials and congenerics --- .../congeneric_intervals_tuple.md | 3 - docs/fundamentals/order/alphabet.md | 15 + docs/fundamentals/order/order.md | 39 ++ .../alphabet/congeneric.md | 17 + .../alphabet/index.md | 22 + .../partials_and_congenerics/carrier_set.md | 13 + .../characteristics.md | 10 + .../partials_and_congenerics/index.md | 105 ++++ .../intervals_chain/congeneric.md | 63 ++ .../intervals_chain/index.md | 575 ++++++++++++++++++ .../intervals_distribution.md | 110 ++++ .../order/congeneric.md | 60 ++ .../partials_and_congenerics/order/index.md | 111 ++++ .../sequence/congeneric.md | 60 ++ .../sequence/index.md | 171 ++++++ mkdocs.yml | 17 + 16 files changed, 1388 insertions(+), 3 deletions(-) delete mode 100644 docs/fundamentals/congeneric_decomposition/congeneric_intervals_tuple.md create mode 100644 docs/fundamentals/partials_and_congenerics/alphabet/congeneric.md create mode 100644 docs/fundamentals/partials_and_congenerics/alphabet/index.md create mode 100644 docs/fundamentals/partials_and_congenerics/carrier_set.md create mode 100644 docs/fundamentals/partials_and_congenerics/characteristics.md create mode 100644 docs/fundamentals/partials_and_congenerics/index.md create mode 100644 docs/fundamentals/partials_and_congenerics/intervals_chain/congeneric.md create mode 100644 docs/fundamentals/partials_and_congenerics/intervals_chain/index.md create mode 100644 docs/fundamentals/partials_and_congenerics/intervals_distribution.md create mode 100644 docs/fundamentals/partials_and_congenerics/order/congeneric.md create mode 100644 docs/fundamentals/partials_and_congenerics/order/index.md create mode 100644 docs/fundamentals/partials_and_congenerics/sequence/congeneric.md create mode 100644 docs/fundamentals/partials_and_congenerics/sequence/index.md diff --git a/docs/fundamentals/congeneric_decomposition/congeneric_intervals_tuple.md b/docs/fundamentals/congeneric_decomposition/congeneric_intervals_tuple.md deleted file mode 100644 index 2423c53a..00000000 --- a/docs/fundamentals/congeneric_decomposition/congeneric_intervals_tuple.md +++ /dev/null @@ -1,3 +0,0 @@ -# Congeneric Intervals Tuple - -Coming soon diff --git a/docs/fundamentals/order/alphabet.md b/docs/fundamentals/order/alphabet.md index b1ec8e37..bdbeee67 100644 --- a/docs/fundamentals/order/alphabet.md +++ b/docs/fundamentals/order/alphabet.md @@ -19,6 +19,21 @@ Where: - $m := |A|$ is called _power_ of the alphabet, $m \in N$ - $a_i$​ is called the $i$-th _element_ (or coordinate) of the alphabet. +### Alphabet of Sequence + +Let $X$ is [_Carrier set_](./carrier_set.md#mathematical-definition) + +Let $S$ is [_Sequence_](./sequence.md#mathematical-definition) described as function $S : \{1,...,n\} \longrightarrow X$ + +$$alphabet(S) : \big\{\{1,...,n\} \longrightarrow X \big\} \longrightarrow \big\{\{1,...,m\} \longrightarrow X \big\}$$ + +$$alphabet(S) = \big$$ + + +Where: + +- $m \leq n$ - power of the alphabet is not greater than length of the sequence + ## Examples ### Binary Sequence diff --git a/docs/fundamentals/order/order.md b/docs/fundamentals/order/order.md index f37056c7..dbd558a6 100644 --- a/docs/fundamentals/order/order.md +++ b/docs/fundamentals/order/order.md @@ -19,6 +19,45 @@ Where: - $n := |O|$ is called _length_ of the order, $n \in N$ - $o_i$​ is called the $i$-th _element_ (or coordinate) of the order +### Order of Sequence + +Let $X$ is [_Carrier set_](./carrier_set.md#mathematical-definition) + +Let $S$ is [_Sequence_](./sequence.md#mathematical-definition) described as function $S : \{1,...,n\} \longrightarrow X$ + +Let $alphabet$ is [_Alphabet function_](./alphabet.md#alphabet-of-sequence) + +$$alphabet : \big\{\{1,...,n\} \longrightarrow X \big\} \longrightarrow \big\{\{1,...,m\} \longrightarrow X \big\}$$ + +Define + +$$ordert(S) : \big\{\{1,...,n\} \longrightarrow X \big\} \longrightarrow \big\{\{1,...,n\} \longrightarrow \{1,...,n\} \big\}$$ + +$$A = alphabet(S)$$ + +$$order(S)(i) = j \big| j \in \{1,...,n\}, S(i)=A(j)$$ + +### Order product Alphabet + +Let $X$ is a [_Carrier set_](./carrier_set.md) + +Let $A$ is a [_Aphabet_](./alphabet.md) $A : \{1, ..., m\} \longrightarrow X,$ + +Let $S$ is a [_Sequenece_](./sequence.md) $S : \{1, ..., n\} \longrightarrow X,$ + +the following equations are true + +$$O = order(S),$$ + +$$A = alphabet(S),$$ + +$$S = ( O \odot A),$$ + +$$S(i) = A(O(i))$$ + + + + ## Examples ### Valid order diff --git a/docs/fundamentals/partials_and_congenerics/alphabet/congeneric.md b/docs/fundamentals/partials_and_congenerics/alphabet/congeneric.md new file mode 100644 index 00000000..2b87cbd6 --- /dev/null +++ b/docs/fundamentals/partials_and_congenerics/alphabet/congeneric.md @@ -0,0 +1,17 @@ +# Alphabet of Congeneric Sequence + +[_Congenric sequence_](../sequence/congeneric.md#mathematical-definition) is defined on _Partial carrier set_ having only one _non-empty_ element. +That means that _Alphabet of Congeneric sequence_ is a tuple of one element. The alphabet power is 1. + +## Mathematical Definition + + +Let $S_{c|e}$ is [_Congeneric Sequence of e element_](../sequence/congeneric.md#mathematical-definition) + +Let $alphabet_p$ is [_Alphabet of Partial sequence_](../alphabet/index.md#mathematical-definition) + +Then [_Alphabet_](../../order/alphabet.md#mathematical-definition) + +$$A=alphabet_p(S_{c|e}) = ,$$ + +$$|A| = 1$$ diff --git a/docs/fundamentals/partials_and_congenerics/alphabet/index.md b/docs/fundamentals/partials_and_congenerics/alphabet/index.md new file mode 100644 index 00000000..3d03add1 --- /dev/null +++ b/docs/fundamentals/partials_and_congenerics/alphabet/index.md @@ -0,0 +1,22 @@ +# Alphabet of Partial Sequence + +_Alphabet_ of [_Partial sequence_](../sequence/index.md#mathematical-definition) is just an [_Alphabet_](../../order/alphabet.md#mathematical-definition). +The `-` _empty element_ is not counted as a unique element and is not included in the alphabet. + +## Mathematical Definition + +Let $X$ is [_Carrier Set_](../../order/carrier_set.md#mathematical-definition) + +Let $X_{-}$ is [_Partial Carrier Set_](../carrier_set.md#mathematical-definition) + +$$X \subset X_{-}$$ + +Let $-$ is [_Empty element_](../carrier_set.md#mathematical-definition) of _Partial Carrier Set_ + +Let $S_p$ is [_Partial Sequence_](../sequence/index.md#mathematical-definition) described as function $S : \{1,...,l\} \longrightarrow X_{-}$ + +Define _Alphabet of partial sequence_ function + +$$alphabet_p : \big\{\{1,...,l\} \longrightarrow X_{-} \big\} \longrightarrow \big\{\{1,...,m\} \longrightarrow X \big\}$$ + +$$alphabet_p(S_p) = \big$$ diff --git a/docs/fundamentals/partials_and_congenerics/carrier_set.md b/docs/fundamentals/partials_and_congenerics/carrier_set.md new file mode 100644 index 00000000..7c6856ee --- /dev/null +++ b/docs/fundamentals/partials_and_congenerics/carrier_set.md @@ -0,0 +1,13 @@ +# Partial carrier set + +A _Partial carrier set_ $X_{-}$ is a [_carrier set_](../order/carrier_set.md) extended with special `-` empty element. + +## Mathematical Definition + +Let $X$ is [_Carrier set_](../order/carrier_set.md#mathematical-definition) + +Let $- \notin X$ + +Define _Partial carrier set_ + +$$X_{-} = X \cup \{-\}$$ diff --git a/docs/fundamentals/partials_and_congenerics/characteristics.md b/docs/fundamentals/partials_and_congenerics/characteristics.md new file mode 100644 index 00000000..6189d4d7 --- /dev/null +++ b/docs/fundamentals/partials_and_congenerics/characteristics.md @@ -0,0 +1,10 @@ +--- +hide: + - toc +--- +# Characteristics for Partials + +All [interval-based characteristics](../order/characteristics/index.md) are valid of _partials_ and _congenerics_. +The measures could be calculated based on [_Partial Intervals Chain_](./intervals_chain/index.md) or [_Partial Intervals Distribution_](./intervals_distribution.md) using the +relevant formulas for the characteristic. In case of using _Partial Intervals Chain_ pay attention that for partial $n$ is the number of _non-empty_ elements and differs from +tuple length $l$, while for _full_ sequences and their derivatives $n$ and $l$ are the same. diff --git a/docs/fundamentals/partials_and_congenerics/index.md b/docs/fundamentals/partials_and_congenerics/index.md new file mode 100644 index 00000000..5d983516 --- /dev/null +++ b/docs/fundamentals/partials_and_congenerics/index.md @@ -0,0 +1,105 @@ +# Partials and congenerics + +_Partial sequence_ is a sequence with skips (empty positions, spaces). FOA uses the special symbol `-` as _empty_ element. +_Partial sequence_ where all _non-empty_ elements are equals _Congeneric sequence_. + +=== "Sequence" + + ``` mermaid + block-beta + columns 36 + s1["I"] s2["N"] s3["T"] s4["E"] s5["L"] s6["L"] s7["I"] s8["G"] s9["E"] s10["N"] + s11["C"] s12["E"] s13[" "] s14["I"] s15["S"] s16[" "] s17["T"] s18["H"] s19["E"] s20[" "] + s21["A"] s22["B"] s23["I"] s24["L"] s25["I"] s26["T"] s27["Y"] s28[" "] s29["T"] s30["O"] + s31[" "] s32["A"] s33["D"] s34["A"] s35["P"] s36["T"] + + classDef c1 fill:#ff7f0e,color:#fff; + classDef c2 fill:#ffbb78,color:#000; + classDef c3 fill:#2ca02c,color:#fff; + classDef c4 fill:#98df8a,color:#000; + classDef c5 fill:#d62728,color:#fff; + classDef c6 fill:#ff9896,color:#000; + classDef c7 fill:#9467bd,color:#fff; + classDef c8 fill:#c5b0d5,color:#000; + classDef c9 fill:#8c564b,color:#fff; + classDef c10 fill:#c49c94,color:#000; + classDef c11 fill:#e377c2,color:#fff; + classDef c12 fill:#f7b6d2,color:#000; + classDef c13 fill:#bcbd22,color:#fff; + classDef c14 fill:#dbdb8d,color:#000; + classDef c15 fill:#17becf,color:#fff; + classDef c16 fill:#9edae5,color:#000; + + classDef skip fill:#ffffff + + ``` + +=== "Partial" + + ``` mermaid + block-beta + columns 36 + s1["I"] s2["N"] s3["T"] s4["E"] s5["L"] s6["L"] s7["I"] s8["G"] s9["E"] s10["N"] + s11["C"] s12["E"] s13[" "] s14["-"] s15["-"] s16[" "] s17["T"] s18["-"] s19["-"] s20[" "] + s21["-"] s22["B"] s23["-"] s24["L"] s25["-"] s26["T"] s27["-"] s28["-"] s29["T"] s30["-"] + s31["-"] s32["-"] s33["D"] s34["-"] s35["P"] s36["T"] + + classDef c1 fill:#ff7f0e,color:#fff; + classDef c2 fill:#ffbb78,color:#000; + classDef c3 fill:#2ca02c,color:#fff; + classDef c4 fill:#98df8a,color:#000; + classDef c5 fill:#d62728,color:#fff; + classDef c6 fill:#ff9896,color:#000; + classDef c7 fill:#9467bd,color:#fff; + classDef c8 fill:#c5b0d5,color:#000; + classDef c9 fill:#8c564b,color:#fff; + classDef c10 fill:#c49c94,color:#000; + classDef c11 fill:#e377c2,color:#fff; + classDef c12 fill:#f7b6d2,color:#000; + classDef c13 fill:#bcbd22,color:#fff; + classDef c14 fill:#dbdb8d,color:#000; + classDef c15 fill:#17becf,color:#fff; + classDef c16 fill:#9edae5,color:#000; + + classDef skip fill:#ffffff + + class s14,s15,s18,s19,s21,s23,s25,s27,s28,s30,s31,s32,s34 skip + ``` + +=== "Congeneric" + + ``` mermaid + block-beta + columns 36 + s1["-"] s2["-"] s3["T"] s4["-"] s5["-"] s6["-"] s7["-"] s8["-"] s9["-"] s10["-"] + s11["-"] s12["-"] s13["-"] s14["-"] s15["-"] s16["-"] s17["T"] s18["-"] s19["-"] s20["-"] + s21["-"] s22["-"] s23["-"] s24["-"] s25["-"] s26["T"] s27["-"] s28["-"] s29["T"] s30["-"] + s31["-"] s32["-"] s33["-"] s34["-"] s35["-"] s36["T"] + + classDef c1 fill:#ff7f0e,color:#fff; + classDef c2 fill:#ffbb78,color:#000; + classDef c3 fill:#2ca02c,color:#fff; + classDef c4 fill:#98df8a,color:#000; + classDef c5 fill:#d62728,color:#fff; + classDef c6 fill:#ff9896,color:#000; + classDef c7 fill:#9467bd,color:#fff; + classDef c8 fill:#c5b0d5,color:#000; + classDef c9 fill:#8c564b,color:#fff; + classDef c10 fill:#c49c94,color:#000; + classDef c11 fill:#e377c2,color:#fff; + classDef c12 fill:#f7b6d2,color:#000; + classDef c13 fill:#bcbd22,color:#fff; + classDef c14 fill:#dbdb8d,color:#000; + classDef c15 fill:#17becf,color:#fff; + classDef c16 fill:#9edae5,color:#000; + + classDef skip fill:#ffffff + + class s1,s2,s4,s5,s6,s7,s8,s9,s10 skip + class s11,s12,s13,s14,s15,s16,s18,s19,s20 skip + class s21,s22,s23,s24,s25,s27,s28,s30 skip + class s31,s32,s33,s34,s35 skip + ``` + +Every operation and statement described in [_Order and its measures_](../order/index.md) that can be applied to _Sequence_ are also valid for Partial sequence, keeping in mind that only non-empty elements are involved. +Read the following documentation to clarify the differences that appear for Partial [_Sequence_](./sequence/index.md), [_Order_](./order/index.md), and [_Intervals Chain_](./intervals_chain/index.md). diff --git a/docs/fundamentals/partials_and_congenerics/intervals_chain/congeneric.md b/docs/fundamentals/partials_and_congenerics/intervals_chain/congeneric.md new file mode 100644 index 00000000..e1ca3d91 --- /dev/null +++ b/docs/fundamentals/partials_and_congenerics/intervals_chain/congeneric.md @@ -0,0 +1,63 @@ +# Congeneric Intervals Chain + +A _Congeneric intervals chain_ is an [_Partial Interval Chain_](./index.md) where all _non-empty_ elements are part of the one trace path (trace to the same [terminal value](../../order/intervals_chain/index.md)). + +``` mermaid +block-beta +columns 29 + +i1["1"] i2["2"] i3["3"] i4["4"] i5["5"] i6["6"] i7["7"] i8["8"] i9["9"] i10["10"] i11["11"] i12["12"] +i13["13"] i14["14"] i15["15"] i16["16"] i17["17"] i18["18"] i19["19"] i20["20"] +i21["21"] i22["12"] i23["23"] i24["24"] i25["25"] i26["26"] i27["27"] +i28["28"] i29["29"] + +s1["-"] s2["-"] s3["3"] s4["-"] s5["-"] s6["-"] s7["-"] s8["-"] s9["-"] s10["-"] +s11["-"] s12["-"] s13["-"] s14["-"] s15["-"] s16["-"] s17["14"] s18["-"] s19["-"] s20["-"] +s21["-"] s22["-"] s23["-"] s24["-"] s25["-"] s26["9"] s27["-"] s28["-"] s29["3"] + +classDef c1 fill:#ff7f0e,color:#fff; +classDef c2 fill:#ffbb78,color:#000; +classDef c3 fill:#2ca02c,color:#fff; +classDef c4 fill:#98df8a,color:#000; +classDef c5 fill:#d62728,color:#fff; +classDef c6 fill:#ff9896,color:#000; +classDef c7 fill:#9467bd,color:#fff; +classDef c8 fill:#c5b0d5,color:#000; +classDef c9 fill:#8c564b,color:#fff; +classDef c10 fill:#c49c94,color:#000; +classDef c11 fill:#e377c2,color:#fff; +classDef c12 fill:#f7b6d2,color:#000; +classDef c13 fill:#bcbd22,color:#fff; +classDef c14 fill:#dbdb8d,color:#000; +classDef c15 fill:#17becf,color:#fff; +classDef c16 fill:#9edae5,color:#000; + +classDef skip fill:#ffffff +classDef index fill:#ffffff,stroke-width:0px + +class s1,s2,s4,s5,s6,s7,s8,s9,s10 skip +class s11,s12,s13,s14,s15,s16,s18,s19,s20 skip +class s21,s22,s23,s24,s25,s27,s28,s30 skip +class s31,s32,s33,s34,s35 skip + + +class i1,i2,i3,i4,i5,i6,i7,i8,i9,i10 index +class i11,i12,i13,i14,i15,i16,i17,i18,i19,i20 index +class i21,i22,i23,i24,i25,i26,i27,i28,i29 index +``` + +## Mathematical Definition + +Let $-$ is [_empty value_](../carrier_set.md#mathematical-definition) + +Let $IC_p$ is [_Partial interval chain_](index.md#define-partial-intervals-chain) $IC_p : \{1, ..., l\} \longrightarrow \{1,...,l\} \cup \{-\},$ + +Let $Trace_p$ is [_trace function of partial interval chain_](index.md#define-partial-intervals-chain) + +$$Trace_p : \big\{Binding_p\big\} \times \big\{ IC_p \big\} \longrightarrow \big\{ R_p \big\},$$ + +$IC_p$ is called $IC_c$ _Congeneric interval chain_ if + +$$trace = Trace_p(b_p, IC_P)$$ + +$$trace(i) = trace(j) \bigg| \forall i \ne j, IC_{p}(i) \notin \{-\} \land IC_{p}(j) \notin \{-\}$$ diff --git a/docs/fundamentals/partials_and_congenerics/intervals_chain/index.md b/docs/fundamentals/partials_and_congenerics/intervals_chain/index.md new file mode 100644 index 00000000..d54df1a7 --- /dev/null +++ b/docs/fundamentals/partials_and_congenerics/intervals_chain/index.md @@ -0,0 +1,575 @@ +# Partial Intervals Chain + +_Partial Intervals Chain_ is an [_Intervals chain_](../../order/intervals_chain/index.md#mathematical-definition) that could contains `-` [_empty_](../carrier_set.md#mathematical-definition) elements. All statements valid for an _intervals chain elements_ should be valid for _non-empty_ elements of _partial intervals chain_ + +The idea of _partial intervals chain_ is easy to explain by a concrete example: + + +=== "From a partial sequence" + + ``` mermaid + block-beta + columns 8 + space p1["1"] space:3 p5["5"] p6["l"] space + space s1["-"] s2["C"] s3["T"] s4["C"] s5["-"] s6["G"] space + + classDef imaginary fill:#526cfe09,color:#000,stroke-dasharray: 10 5; + classDef position fill:#fff,color:#000,stroke-width:0px; + class inf,sup imaginary + class p0,p1,p5,p6,p7 position + + classDef skip fill:#ffffff + + class s1,s5 skip + + classDef c1 fill:#ff7f0e,color:#fff; + classDef c2 fill:#ffbb78,color:#000; + classDef c2a fill:#ffbb788a,color:#000; + classDef c3 fill:#2ca02c,color:#fff; + classDef c4 fill:#98df8a,color:#000; + classDef c4a fill:#98df8a8a,color:#000; + classDef c5 fill:#d62728,color:#fff; + classDef c6 fill:#ff9896,color:#000; + classDef c6a fill:#ff98968a,color:#000; + classDef c7 fill:#9467bd,color:#fff; + classDef c8 fill:#c5b0d5,color:#000; + classDef c9 fill:#8c564b,color:#fff; + classDef c10 fill:#c49c94,color:#000; + classDef c11 fill:#e377c2,color:#fff; + classDef c12 fill:#f7b6d2,color:#000; + classDef c13 fill:#bcbd22,color:#fff; + classDef c14 fill:#dbdb8d,color:#000; + classDef c14a fill:#dbdb8d8a,color:#000; + classDef c15 fill:#17becf,color:#fff; + classDef c16 fill:#9edae5,color:#000; + ``` + + Let there be a partial sequence length of $l=6$ (indexed from 1 to l=6) + +=== "with a binding" + + ``` mermaid + block-beta + columns 7 + p0["0"] p1["1"] p2["2"] space p4["4"] p5["5"] p6["6"] + inf["⊥"] s1["-"] s2["C"] s3["T"] s4["C"] s5["-"] s6["G"] + e0["0 = Iteratorₚ(2)"]:3 space:4 + space:2 t1["2 = Iteratorₚ(4)"]:3 space:2 + + classDef imaginary fill:#526cfe09,color:#000,stroke-dasharray: 10 5; + classDef position fill:#fff,color:#000,stroke-width:0px; + class inf,sup imaginary + class p0,p1,p2,p4,p5,p6,p7 position + + classDef skip fill:#ffffff + class s1,s5 skip + + classDef c1 fill:#ff7f0e,color:#fff; + classDef c2 fill:#ffbb78,color:#000; + classDef c2a fill:#ffbb788a,color:#000; + classDef c3 fill:#2ca02c,color:#fff; + classDef c4 fill:#98df8a,color:#000; + classDef c4a fill:#98df8a8a,color:#000; + classDef c5 fill:#d62728,color:#fff; + classDef c6 fill:#ff9896,color:#000; + classDef c6a fill:#ff98968a,color:#000; + classDef c7 fill:#9467bd,color:#fff; + classDef c8 fill:#c5b0d5,color:#000; + classDef c9 fill:#8c564b,color:#fff; + classDef c10 fill:#c49c94,color:#000; + classDef c11 fill:#e377c2,color:#fff; + classDef c12 fill:#f7b6d2,color:#000; + classDef c13 fill:#bcbd22,color:#fff; + classDef c14 fill:#dbdb8d,color:#000; + classDef c14a fill:#dbdb8d8a,color:#000; + classDef c15 fill:#17becf,color:#fff; + classDef c16 fill:#9edae5,color:#000; + + class s2,s4 c4 + class inf,t1,e0 c4a + class pomn,p00,p01,p06,p07,p02n position + class t1,t2,t5,e0,e1 position + + ``` + + Define $Binding_p$ as a pair of an $Iterator_p$ function, that seeks a corresponding referenced element, and + set of _terminate states_, to determine the interval when there is no matching element in the sequence. + For `-` _empty_ elements, we do not search for matching elements - just put `-` instead of matching value. + +=== "get correspoding indexes" + + ``` mermaid + block-beta + columns 7 + p0["0"] p1["1"] p2["2"] p3["3"] p4["4"] p5["5"] p6["6"] + inf["⊥"] s1["-"] s2["C"] s3["T"] s4["C"] s5["-"] s6["G"] + space i1["-"] i2["0"] i3["0"] i4["2"] i5["-"] i6["0"] + + classDef imaginary fill:#526cfe09,color:#000,stroke-dasharray: 10 5; + classDef position fill:#fff,color:#000,stroke-width:0px; + class inf,sup imaginary + class p0,p1,p2,p3,p4,p5,p6,p7 position + + classDef skip fill:#ffffff + class s1,s5 skip + + classDef c1 fill:#ff7f0e,color:#fff; + classDef c2 fill:#ffbb78,color:#000; + classDef c2a fill:#ffbb788a,color:#000; + classDef c3 fill:#2ca02c,color:#fff; + classDef c4 fill:#98df8a,color:#000; + classDef c4a fill:#98df8a8a,color:#000; + classDef c5 fill:#d62728,color:#fff; + classDef c6 fill:#ff9896,color:#000; + classDef c6a fill:#ff98968a,color:#000; + classDef c7 fill:#9467bd,color:#fff; + classDef c8 fill:#c5b0d5,color:#000; + classDef c9 fill:#8c564b,color:#fff; + classDef c10 fill:#c49c94,color:#000; + classDef c11 fill:#e377c2,color:#fff; + classDef c12 fill:#f7b6d2,color:#000; + classDef c13 fill:#bcbd22,color:#fff; + classDef c14 fill:#dbdb8d,color:#000; + classDef c14a fill:#dbdb8d8a,color:#000; + classDef c15 fill:#17becf,color:#fff; + classDef c16 fill:#9edae5,color:#000; + + class s1,s5,i1,i5 skip + class s2,s4,i2,i4 c1 + class s3,i3 c5 + class s6,i6 c7 + class pomn,p00,p01,p06,p07,p02n position + class t1,t2,t5,e0,e1 position + + ``` + + With $Binding_p$ we can get a sequence of corresponding indexes. + For all first appearances of the elements it would be $0$, + and for `C` at position `4` corresponding index would be `2`. + +=== "and calculate partial intervals chain" + + ``` mermaid + block-beta + columns 7 + p0["0"] p1["1"] p2["2"] p3["3"] p4["4"] p5["5"] p6["6"] + space i1["-"] i2["0"] i3["0"] i4["2"] i5["-"] i6["0"] + space s1["-"] s2["2"] s3["3"] s4["2"] s5["-"] s6["6"] + + classDef imaginary fill:#526cfe09,color:#000,stroke-dasharray: 10 5; + classDef position fill:#fff,color:#000,stroke-width:0px; + class inf,sup imaginary + class p0,p1,p2,p3,p4,p5,p6,p7 position + + classDef skip fill:#ffffff + + classDef c1 fill:#ff7f0e,color:#fff; + classDef c2 fill:#ffbb78,color:#000; + classDef c2a fill:#ffbb788a,color:#000; + classDef c3 fill:#2ca02c,color:#fff; + classDef c4 fill:#98df8a,color:#000; + classDef c4a fill:#98df8a8a,color:#000; + classDef c5 fill:#d62728,color:#fff; + classDef c6 fill:#ff9896,color:#000; + classDef c6a fill:#ff98968a,color:#000; + classDef c7 fill:#9467bd,color:#fff; + classDef c8 fill:#c5b0d5,color:#000; + classDef c9 fill:#8c564b,color:#fff; + classDef c10 fill:#c49c94,color:#000; + classDef c11 fill:#e377c2,color:#fff; + classDef c12 fill:#f7b6d2,color:#000; + classDef c13 fill:#bcbd22,color:#fff; + classDef c14 fill:#dbdb8d,color:#000; + classDef c14a fill:#dbdb8d8a,color:#000; + classDef c15 fill:#17becf,color:#fff; + classDef c16 fill:#9edae5,color:#000; + + class s1,s5,i1,i5 skip + class s2,s4,i2,i4 c1 + class s3,i3 c5 + class s6,i6 c7 + class pomn,p00,p01,p06,p07,p02n position + class t1,t2,t5,e0,e1 position + + ``` + + Calculated interval by $Intervals_p$ function is the [absolute value](https://en.wikipedia.org/wiki/Absolute_value) + of difference the _corresponding index_ and the _index_. For example, for index `4` interval would be $|4-2|=2$ + + +--- + +There should exists an inverse function that restores by _interval chain_ a sequence with the original [order](../order/index.md) + +=== "From a partial interval chain" + + ``` mermaid + block-beta + columns 7 + space p1["1"] p2["2"] p3["3"] p4["4"] p5["5"] p6["6"] + space s1["-"] s2["2"] s3["3"] s4["2"] s5["-"] s6["6"] + + classDef imaginary fill:#526cfe09,color:#000,stroke-dasharray: 10 5; + classDef position fill:#fff,color:#000,stroke-width:0px; + class inf,sup imaginary + class p0,p1,p2,p3,p4,p5,p6,p7 position + + classDef skip fill:#ffffff + class s1,s5 skip + + classDef c1 fill:#ff7f0e,color:#fff; + classDef c2 fill:#ffbb78,color:#000; + classDef c2a fill:#ffbb788a,color:#000; + classDef c3 fill:#2ca02c,color:#fff; + classDef c4 fill:#98df8a,color:#000; + classDef c4a fill:#98df8a8a,color:#000; + classDef c5 fill:#d62728,color:#fff; + classDef c6 fill:#ff9896,color:#000; + classDef c6a fill:#ff98968a,color:#000; + classDef c7 fill:#9467bd,color:#fff; + classDef c8 fill:#c5b0d5,color:#000; + classDef c9 fill:#8c564b,color:#fff; + classDef c10 fill:#c49c94,color:#000; + classDef c11 fill:#e377c2,color:#fff; + classDef c12 fill:#f7b6d2,color:#000; + classDef c13 fill:#bcbd22,color:#fff; + classDef c14 fill:#dbdb8d,color:#000; + classDef c14a fill:#dbdb8d8a,color:#000; + classDef c15 fill:#17becf,color:#fff; + classDef c16 fill:#9edae5,color:#000; + + class pomn,p00,p01,p06,p07,p02n position + class t1,t2,t5,e0,e1 position + + ``` + + Let there be a _partial interval chain_. + +=== "calculate correspoding indexes" + + ``` mermaid + block-beta + columns 7 + p0["0"] p1["1"] p2["2"] p3["3"] p4["4"] p5["5"] p6["6"] + space s1["-"] s2["2"] s3["3"] s4["2"] s5["-"] s6["6"] + space i1["-"] i2["0"] i3["0"] i4["2"] i5["-"] i6["0"] + + classDef imaginary fill:#526cfe09,color:#000,stroke-dasharray: 10 5; + classDef position fill:#fff,color:#000,stroke-width:0px; + class inf,sup imaginary + class p0,p1,p2,p3,p4,p5,p6,p7 position + + classDef skip fill:#ffffff + class s1,s5,i1,i5 skip + + + classDef c1 fill:#ff7f0e,color:#fff; + classDef c2 fill:#ffbb78,color:#000; + classDef c2a fill:#ffbb788a,color:#000; + classDef c3 fill:#2ca02c,color:#fff; + classDef c4 fill:#98df8a,color:#000; + classDef c4a fill:#98df8a8a,color:#000; + classDef c5 fill:#d62728,color:#fff; + classDef c6 fill:#ff9896,color:#000; + classDef c6a fill:#ff98968a,color:#000; + classDef c7 fill:#9467bd,color:#fff; + classDef c8 fill:#c5b0d5,color:#000; + classDef c9 fill:#8c564b,color:#fff; + classDef c10 fill:#c49c94,color:#000; + classDef c11 fill:#e377c2,color:#fff; + classDef c12 fill:#f7b6d2,color:#000; + classDef c13 fill:#bcbd22,color:#fff; + classDef c14 fill:#dbdb8d,color:#000; + classDef c14a fill:#dbdb8d8a,color:#000; + classDef c15 fill:#17becf,color:#fff; + classDef c16 fill:#9edae5,color:#000; + + class pomn,p00,p01,p06,p07,p02n position + class t1,t2,t5,e0,e1 position + + ``` + + The $Intervals_p^{-1}$ function for calculating _corresponding index_ based on the current _index_ and _interval_ is closly coupled + with direction in selected _Binding_. For `-` _empty_ element it just put `-` instead of calculating the index + +=== "and use binding⁻¹" + + ``` mermaid + block-beta + columns 6 + p1["1"] p2["2"] space p4["4"] p5["5"] p6["6"] + s1["-"] s2["0"] s3["0"] s4["2"] s5["-"] s6["0"] + e0["Iteratorₚ⁻¹(2) = 2"]:2 space:4 + space t1["Iteratorₚ⁻¹(4) = 2"]:3 space:2 + + classDef imaginary fill:#526cfe09,color:#000,stroke-dasharray: 10 5; + classDef position fill:#fff,color:#000,stroke-width:0px; + class inf,sup imaginary + class p0,p1,p2,p4,p5,p6,p7 position + + classDef skip fill:#ffffff + class s1,s5,i1,i5 skip + + classDef c1 fill:#ff7f0e,color:#fff; + classDef c2 fill:#ffbb78,color:#000; + classDef c2a fill:#ffbb788a,color:#000; + classDef c3 fill:#2ca02c,color:#fff; + classDef c4 fill:#98df8a,color:#000; + classDef c4a fill:#98df8a8a,color:#000; + classDef c5 fill:#d62728,color:#fff; + classDef c6 fill:#ff9896,color:#000; + classDef c6a fill:#ff98968a,color:#000; + classDef c7 fill:#9467bd,color:#fff; + classDef c8 fill:#c5b0d5,color:#000; + classDef c9 fill:#8c564b,color:#fff; + classDef c10 fill:#c49c94,color:#000; + classDef c11 fill:#e377c2,color:#fff; + classDef c12 fill:#f7b6d2,color:#000; + classDef c13 fill:#bcbd22,color:#fff; + classDef c14 fill:#dbdb8d,color:#000; + classDef c14a fill:#dbdb8d8a,color:#000; + classDef c15 fill:#17becf,color:#fff; + classDef c16 fill:#9edae5,color:#000; + + class s2,s4 c4 + class inf,t1,e0 c4a + class pomn,p00,p01,p06,p07,p02n position + class t1,t2,t5,e0,e1 position + + ``` + + For each $Binding_p$ should exists $Binding_p^{-1}$ with an $Iterator_p^{-1}$ that allows + to relabel elements of _interval chain_ with a unique number of the traversed path that it belongs to. + +=== "to partial sequence" + + ``` mermaid + block-beta + columns 6 + p1["1"] p2["2"] p3["3"] p4["4"] p5["5"] p6["6"] + i1["-"] i2["0"] i3["0"] i4["2"] i5["-"] i6["0"] + s1["-"] s2["2"] s3["3"] s4["2"] s5["-"] s6["4"] + + classDef imaginary fill:#526cfe09,color:#000,stroke-dasharray: 10 5; + classDef position fill:#fff,color:#000,stroke-width:0px; + class inf,sup imaginary + class p0,p1,p2,p3,p4,p5,p6,p7 position + + classDef skip fill:#ffffff + class s1,s5,i1,i5 skip + + classDef c1 fill:#ff7f0e,color:#fff; + classDef c2 fill:#ffbb78,color:#000; + classDef c2a fill:#ffbb788a,color:#000; + classDef c3 fill:#2ca02c,color:#fff; + classDef c4 fill:#98df8a,color:#000; + classDef c4a fill:#98df8a8a,color:#000; + classDef c5 fill:#d62728,color:#fff; + classDef c6 fill:#ff9896,color:#000; + classDef c6a fill:#ff98968a,color:#000; + classDef c7 fill:#9467bd,color:#fff; + classDef c8 fill:#c5b0d5,color:#000; + classDef c9 fill:#8c564b,color:#fff; + classDef c10 fill:#c49c94,color:#000; + classDef c11 fill:#e377c2,color:#fff; + classDef c12 fill:#f7b6d2,color:#000; + classDef c13 fill:#bcbd22,color:#fff; + classDef c14 fill:#dbdb8d,color:#000; + classDef c14a fill:#dbdb8d8a,color:#000; + classDef c15 fill:#17becf,color:#fff; + classDef c16 fill:#9edae5,color:#000; + + class s2,s4,i2,i4 c1 + class s3,i3 c5 + class s6,i6 c7 + class pomn,p00,p01,p06,p07,p02n position + class t1,t2,t5,e0,e1 position + + ``` + + The reconstructed partial sequence is not equal to the original one, but it preserves the same [partial order](../order/index.md) of elements + and its _partial intervals chain_ would be equal to the _partial interval chain_ of the original sequence. + + ``` mermaid + block-beta + columns 6 + p1["1"] p2["2"] p3["3"] p4["4"] p5["5"] p6["6"] + s1["-"] s2["2"] s3["3"] s4["2"] s5["-"] s6["4"] + i1["-"] i2["C"] i3["T"] i4["C"] i5["-"] i6["G"] + + classDef imaginary fill:#526cfe09,color:#000,stroke-dasharray: 10 5; + classDef position fill:#fff,color:#000,stroke-width:0px; + class inf,sup imaginary + class p0,p1,p2,p3,p4,p5,p6,p7 position + + classDef skip fill:#ffffff + + classDef c1 fill:#ff7f0e,color:#fff; + classDef c2 fill:#ffbb78,color:#000; + classDef c2a fill:#ffbb788a,color:#000; + classDef c3 fill:#2ca02c,color:#fff; + classDef c4 fill:#98df8a,color:#000; + classDef c4a fill:#98df8a8a,color:#000; + classDef c5 fill:#d62728,color:#fff; + classDef c6 fill:#ff9896,color:#000; + classDef c6a fill:#ff98968a,color:#000; + classDef c7 fill:#9467bd,color:#fff; + classDef c8 fill:#c5b0d5,color:#000; + classDef c9 fill:#8c564b,color:#fff; + classDef c10 fill:#c49c94,color:#000; + classDef c11 fill:#e377c2,color:#fff; + classDef c12 fill:#f7b6d2,color:#000; + classDef c13 fill:#bcbd22,color:#fff; + classDef c14 fill:#dbdb8d,color:#000; + classDef c14a fill:#dbdb8d8a,color:#000; + classDef c15 fill:#17becf,color:#fff; + classDef c16 fill:#9edae5,color:#000; + + class s1,s5,i1,i5 skip + class s2,s4,i2,i4 c1 + class s3,i3 c5 + class s6,i6 c7 + class pomn,p00,p01,p06,p07,p02n position + class t1,t2,t5,e0,e1 position + + ``` + +--- + +$Bindings_p$, $Intervals_p$ and its inverse functions could be produced from functions defined for regular [_Bindings_, _Intervals chains_](../../order/intervals_chain/index.md#mathematical-definition) by adding condition that returns `-` for input `-` elements. + +## Mathematical Definition + +Let $X$ is [_Carrier set_](../../order/carrier_set.md#mathematical-definition) + +Let $X_{-}$ is [_Partial Carrier set_](../carrier_set.md#mathematical-definition) + +Let $-$ is [_Empty element_](../carrier_set.md#mathematical-definition) + +Let $S$ is [_Sequence_](../../order/sequence.md#mathematical-definition) length of $l$ described as function $S : \{1,...,l\} \longrightarrow X$ + +Let $S_p$ is [_Partial Sequence_](../sequence/index.md#mathematical-definition) length of $l$ described as function $S_p : \{1,...,l\} \longrightarrow X_{-}$ + +Let $IC = <\Delta_1, \Delta_2, ..., \Delta_l> | \forall j \in \{1,...,l\} \exists \Delta_j \in \{1,...,l\}$ is [_Interval chain_](../../order/intervals_chain/index.md#define-intervals-chain) + +Let $Binding = $ is [_Binding_](../../order/intervals_chain/index.md#define-bindings) + +Let $R : \{1,...,l\} \longrightarrow \{1,...,l\} \cup \bot,$ is a corresponding [_references_](../../order/intervals_chain/index.md#define-bindings) + +Then _Iterator_ defined as $Iterator \big\{ S \big\} \longrightarrow \big\{ R \big\},$ + +### Define Partial Bindings + +Let $R_p : \{1,...,l\} \longrightarrow \{1,...,l\} \cup \bot \cup \{-\},$ is a corresponding _partial references_ + +Then + +$$X \subset X_{-},$$ + +$$\{S\} \subset \{S_p\},$$ + +$$\{R\} \subset \{R_p\},$$ + +Define + +$$Iterator_p : \big\{ S_p \big\} \longrightarrow \big\{ R_p \big\},$$ + +$$\{Iterator_p\} \supset \{Iterator\},$$ + +$$Iterator_p(S_p)(i) = \Bigg \{ \begin{array}{l} Intertor(S_p)(i) , & S_p(i) \notin \{-\} \\ -, & S_p(i) \in \{-\} \end{array},$$ + +and + +$$Binding_p = ,$$ + +$$\{Binding_p\} \supset \{Binding\}$$ + +the same way + +$$\exists Binding_p^{-1} = ,$$ + +$$\{Binding_p^{-1}\} \supset \{Binding^{-1}\},$$ + +where + +$$Iterator_p^{-1} : \big\{ R_p \big\} \longrightarrow \big\{ \{1,...,l\} \longrightarrow \{1,...,m\} \cup \{-\} | m \leq l \big\},$$ + +$$\{Iterator_p^{-1}\} \supset \{Iterator^{-1}\},$$ + +$$Iterator_p^{-1}(R_p)(i) = \Bigg \{ \begin{array}{l} Intertor^{-1}(R_p)(i) , & R_p(i) \notin \{-\} \\ -, & R_p(i) \in \{-\} \end{array}$$ + +The condition $Iterator_p(S_p) = Iterator_p(Iterator_p^{-1}(Iterator_p(S_p)))$ is valid. + +### Define Partial Intervals Chain + +as l-tuple of natural numbers and `-` empty elements + +$$IC_p = <\Delta_1, \Delta_2, ..., \Delta_l> | \forall j \in \{1,...,l\} \exists \Delta_j \in \{1,...,l\} \cup \{-\},$$ + +Then + +$$\{IC_p\} \supset \{IC\},$$ + +$$\exists \ Intervals_p : \big\{Binding_p\big\} \times \big\{S_p\} \longrightarrow \big\{ IC_p \big\},$$ + +$$\{Intervals_p\} \supset \{Intervals\},$$ + +$$Intervals_p(b_p, S_p)(i) = \Bigg \{ \begin{array}{l} Intervals(b_p, S_p)(i) , & S_p(i) \notin \{-\} \\ -, & S_p(i) \in \{-\} \end{array},$$ + +$$\exists \ Intervals_p^{-1} : \big\{Binding_p^{-1}\big\} \times \big\{ IC_p \big\} \longrightarrow \big\{ \{1,...,l\} \longrightarrow \{1,...,m\} \cup \{-\} | m \leq l \big\},$$ + +$$\{Intervals_p^{-1}\} \supset \{Intervals^{-1}\},$$ + +$$Intervals_p^{-1}(b_p^{-1}, IC_p)(i) = \Bigg \{ \begin{array}{l} Intervals^{-1}(b_p^{-1}, IC_p)(i) , & IC_p(i) \notin \{-\} \\ -, & IC_p(i) \in \{-\} \end{array},$$ + +The condition would be true + +$$Intervals_p(b_p, S_p) = Intervals_p(b_p, Intervals_p^{-1}(b_p^{-1}, Intervals_p(b_p, S_p)))$$ + +Let $Follow$ is the [_follow function of interval chain_](../../order/intervals_chain/index.md#define-intervals-chain) described as function $Follow : \big\{Binding\big\} \times \big\{ IC \big\} \longrightarrow \big\{ R \big\},$ + +$$\exists \ Follow_p : \big\{Binding_p\big\} \times \big\{ IC_p \big\} \longrightarrow \big\{ R_p \big\},$$ + +$$\{Binding\} \subset \{Binding_p\},$$ + +$$\{IC\} \subset \{IC_p\},$$ + +$$\{R\} \subset \{R_p\},$$ + +then + +$$\{Follow_p\} \supset \{Follow\}.$$ + +$$Follow_p(b_p, IC_p)(i) = \Bigg \{ \begin{array}{l} Follow(b_p, IC_p)(i) , & IC_p(i) \notin \{-\} \\ -, & IC_p(i) \in \{-\} \end{array},$$ + +The condition would be true + +$$f = Follow_p(b_p, IC_p),$$ + +$$f(i) <> f(j) \lor f(i) \in \bot | \forall i != j \land IC_p(i) \notin \{-\}.$$ + +Let $Trace$ is the [_trace function of interval chain_](../../order/intervals_chain/index.md#define-intervals-chain) described as function $Trace : \big\{Binding\big\} \times \big\{ IC \big\} \longrightarrow \big\{ R \big\},$ + +$$\exists \ Trace_p : \big\{Binding_p\big\} \times \big\{ IC_p \big\} \longrightarrow \big\{ R_p \big\},$$ + +$$\{Binding\} \subset \{Binding_p\},$$ + +$$\{IC\} \subset \{IC_p\},$$ + +$$\{R\} \subset \{R_p\},$$ + +then + +$$\{Trace_p\} \supset \{Trace\}.$$ + +$$Trace_p(b_p, IC_p)(i) = \Bigg \{ \begin{array}{l} Trace_p(b_p, IC_p)(i) , & IC_p(i) \notin \{-\} \\ -, & IC_p(i) \in \{-\} \end{array}.$$ + +The condition would be true + +$$Trace_p(IC_p)(i) \in \bot | \forall i \in \{1,...,n\} \land IC_p(i) \notin \{-\}$$ + +Where: + +- $l := |IC_p|$ is called _length_ of the _partial intervals chained_, $l \in N$ +- $n := |\{ IC_p(i) | IC_p(i) \ne - \}|$ is _non-empty elements count_, $n \in N$ +- $\Delta_i$​ is called the $i$-th _element_ (or interval) of the _partial intervals chained_ diff --git a/docs/fundamentals/partials_and_congenerics/intervals_distribution.md b/docs/fundamentals/partials_and_congenerics/intervals_distribution.md new file mode 100644 index 00000000..94031a29 --- /dev/null +++ b/docs/fundamentals/partials_and_congenerics/intervals_distribution.md @@ -0,0 +1,110 @@ +# Partial Intervals Distribution + +A _Partial intervals distribution_ is an [_Interval distribution_](../order/intervals_distribution/index.md) produced from [_Partial intervals chain_](./intervals_chain/index.md) by counting all _non-empty_ elements (intervals) in distribution + + +=== "From a partial interval chain" + + ``` mermaid + block-beta + columns 7 + space p1["1"] p2["2"] p3["3"] p4["4"] p5["5"] p6["6"] + space s1["-"] s2["2"] s3["3"] s4["2"] s5["-"] s6["6"] + + classDef imaginary fill:#526cfe09,color:#000,stroke-dasharray: 10 5; + classDef position fill:#fff,color:#000,stroke-width:0px; + class inf,sup imaginary + class p0,p1,p2,p3,p4,p5,p6,p7 position + + classDef c1 fill:#ff7f0e,color:#fff; + classDef c2 fill:#ffbb78,color:#000; + classDef c2a fill:#ffbb788a,color:#000; + classDef c3 fill:#2ca02c,color:#fff; + classDef c4 fill:#98df8a,color:#000; + classDef c4a fill:#98df8a8a,color:#000; + classDef c5 fill:#d62728,color:#fff; + classDef c6 fill:#ff9896,color:#000; + classDef c6a fill:#ff98968a,color:#000; + classDef c7 fill:#9467bd,color:#fff; + classDef c8 fill:#c5b0d5,color:#000; + classDef c9 fill:#8c564b,color:#fff; + classDef c10 fill:#c49c94,color:#000; + classDef c11 fill:#e377c2,color:#fff; + classDef c12 fill:#f7b6d2,color:#000; + classDef c13 fill:#bcbd22,color:#fff; + classDef c14 fill:#dbdb8d,color:#000; + classDef c14a fill:#dbdb8d8a,color:#000; + classDef c15 fill:#17becf,color:#fff; + classDef c16 fill:#9edae5,color:#000; + + class pomn,p00,p01,p06,p07,p02n position + class t1,t2,t5,e0,e1 position + + ``` + + Let there be a _partial interval chain_. + +=== "calculate intervals distribution" + + ``` mermaid + block-beta + columns 7 + space p1["1"] p2["2"] p3["3"] p4["4"] p5["5"] p6["6"] + space s1["-"] s2["2"] s3["3"] s4["2"] s5["-"] s6["6"] + space:7 + space i1["0"] i2["2"] i3["1"] i4["0"] i5["0"] i6["1"] + + classDef imaginary fill:#526cfe09,color:#000,stroke-dasharray: 10 5; + classDef position fill:#fff,color:#000,stroke-width:0px; + class inf,sup imaginary + class p0,p1,p2,p3,p4,p5,p6,p7 position + + classDef c1 fill:#ff7f0e,color:#fff; + classDef c2 fill:#ffbb78,color:#000; + classDef c2a fill:#ffbb788a,color:#000; + classDef c3 fill:#2ca02c,color:#fff; + classDef c4 fill:#98df8a,color:#000; + classDef c4a fill:#98df8a8a,color:#000; + classDef c5 fill:#d62728,color:#fff; + classDef c6 fill:#ff9896,color:#000; + classDef c6a fill:#ff98968a,color:#000; + classDef c7 fill:#9467bd,color:#fff; + classDef c8 fill:#c5b0d5,color:#000; + classDef c9 fill:#8c564b,color:#fff; + classDef c10 fill:#c49c94,color:#000; + classDef c11 fill:#e377c2,color:#fff; + classDef c12 fill:#f7b6d2,color:#000; + classDef c13 fill:#bcbd22,color:#fff; + classDef c14 fill:#dbdb8d,color:#000; + classDef c14a fill:#dbdb8d8a,color:#000; + classDef c15 fill:#17becf,color:#fff; + classDef c16 fill:#9edae5,color:#000; + + class pomn,p00,p01,p06,p07,p02n position + class t1,t2,t5,e0,e1 position + + s2 --> i2 + s3 --> i3 + s4 --> i2 + s6 --> i6 + + + ``` + +--- + +_Partial Intervals distribution_, as any _Intervals distribution_, used as an input data in calculating [characteristics](../order/characteristics/index.md). + +## Mathematical Definition + +Let $-$ is [_empty element_](./carrier_set.md#mathematical-definition). + +Let $IC_p$ is [_Partial Interval Chain_](./intervals_chain/index.md#define-intervals-chain) length of $l$ described as function $IC_p : \{1,...,l\} \longrightarrow \{1,...,l\} \cup \{-\}$ + +Let $ID$ is [_Interval Distribution_](../order/intervals_distribution/index.md) length of $l$ described as function $ID : \big\{ IC \big\} \longrightarrow \big\{ \{1,...,l\} \longrightarrow N_0 \big\},$ + +Define + +$$ID_p : \big\{ IC_p \big\} \longrightarrow \big\{ \{1,...,l\} \longrightarrow N_0 \big\},$$ + +$$ID_p(IC_p)(i) = ID(IC_p)(i) \bigg| IC_p(i) \notin \{-\}$$ diff --git a/docs/fundamentals/partials_and_congenerics/order/congeneric.md b/docs/fundamentals/partials_and_congenerics/order/congeneric.md new file mode 100644 index 00000000..4c6101cb --- /dev/null +++ b/docs/fundamentals/partials_and_congenerics/order/congeneric.md @@ -0,0 +1,60 @@ +# Congeneric Order + +A _Congeneric order_ is an [_Partial Order_](./index.md) where all _non-empty_ elements equals $1$. + + +``` mermaid +block-beta +columns 29 + +i1["1"] i2["2"] i3["3"] i4["4"] i5["5"] i6["6"] i7["7"] i8["8"] i9["9"] i10["10"] i11["11"] i12["12"] +i13["13"] i14["14"] i15["15"] i16["16"] i17["17"] i18["18"] i19["19"] i20["20"] +i21["21"] i22["12"] i23["23"] i24["24"] i25["25"] i26["26"] i27["27"] +i28["28"] i29["29"] + +s1["-"] s2["-"] s3["1"] s4["-"] s5["-"] s6["-"] s7["-"] s8["-"] s9["-"] s10["-"] +s11["-"] s12["-"] s13["-"] s14["-"] s15["-"] s16["-"] s17["1"] s18["-"] s19["-"] s20["-"] +s21["-"] s22["-"] s23["-"] s24["-"] s25["-"] s26["1"] s27["-"] s28["-"] s29["1"] + +classDef c1 fill:#ff7f0e,color:#fff; +classDef c2 fill:#ffbb78,color:#000; +classDef c3 fill:#2ca02c,color:#fff; +classDef c4 fill:#98df8a,color:#000; +classDef c5 fill:#d62728,color:#fff; +classDef c6 fill:#ff9896,color:#000; +classDef c7 fill:#9467bd,color:#fff; +classDef c8 fill:#c5b0d5,color:#000; +classDef c9 fill:#8c564b,color:#fff; +classDef c10 fill:#c49c94,color:#000; +classDef c11 fill:#e377c2,color:#fff; +classDef c12 fill:#f7b6d2,color:#000; +classDef c13 fill:#bcbd22,color:#fff; +classDef c14 fill:#dbdb8d,color:#000; +classDef c15 fill:#17becf,color:#fff; +classDef c16 fill:#9edae5,color:#000; + +classDef skip fill:#ffffff +classDef index fill:#ffffff,stroke-width:0px + +class s1,s2,s4,s5,s6,s7,s8,s9,s10 skip +class s11,s12,s13,s14,s15,s16,s18,s19,s20 skip +class s21,s22,s23,s24,s25,s27,s28,s30 skip +class s31,s32,s33,s34,s35 skip + + +class i1,i2,i3,i4,i5,i6,i7,i8,i9,i10 index +class i11,i12,i13,i14,i15,i16,i17,i18,i19,i20 index +class i21,i22,i23,i24,i25,i26,i27,i28,i29 index +``` + +## Mathematical Definition + +Let $- \notin N$ + +Let $N_{-} = N \cup \{-\}$ + +Let $O_p$ is [_Partial order](index.md#mathematical-definition) $O_p : \{1, ..., n\} \longrightarrow N_{-},$ + +$O_p$ is called $O_c$ _Congeneric order_ if + +$$\forall i O_{p}(i) \in \{-, 1\}$$ diff --git a/docs/fundamentals/partials_and_congenerics/order/index.md b/docs/fundamentals/partials_and_congenerics/order/index.md new file mode 100644 index 00000000..df605311 --- /dev/null +++ b/docs/fundamentals/partials_and_congenerics/order/index.md @@ -0,0 +1,111 @@ +# Partial Order + +A _Partial order_ is an [_Order_](../../order/order.md) having _empty_ elements. + + +``` mermaid +block-beta +columns 29 + +i1["1"] i2["2"] i3["3"] i4["4"] i5["5"] i6["6"] i7["7"] i8["8"] i9["9"] i10["10"] i11["11"] i12["12"] +i13["13"] i14["14"] i15["15"] i16["16"] i17["17"] i18["18"] i19["19"] i20["20"] +i21["21"] i22["12"] i23["23"] i24["24"] i25["25"] i26["26"] i27["27"] +i28["28"] i29["29"] + +s1["1"] s2["2"] s3["3"] s4["4"] s5["5"] s6["5"] s7["1"] s8["6"] s9["4"] s10["2"] +s11["7"] s12["4"] s13["8"] s14["-"] s15["-"] s16["8"] s17["3"] s18["-"] s19["-"] s20["8"] +s21["-"] s22["9"] s23["-"] s24["5"] s25["-"] s26["3"] s27["-"] s28["-"] s29["3"] + +classDef c1 fill:#ff7f0e,color:#fff; +classDef c2 fill:#ffbb78,color:#000; +classDef c3 fill:#2ca02c,color:#fff; +classDef c4 fill:#98df8a,color:#000; +classDef c5 fill:#d62728,color:#fff; +classDef c6 fill:#ff9896,color:#000; +classDef c7 fill:#9467bd,color:#fff; +classDef c8 fill:#c5b0d5,color:#000; +classDef c9 fill:#8c564b,color:#fff; +classDef c10 fill:#c49c94,color:#000; +classDef c11 fill:#e377c2,color:#fff; +classDef c12 fill:#f7b6d2,color:#000; +classDef c13 fill:#bcbd22,color:#fff; +classDef c14 fill:#dbdb8d,color:#000; +classDef c15 fill:#17becf,color:#fff; +classDef c16 fill:#9edae5,color:#000; + +classDef skip fill:#ffffff +classDef index fill:#ffffff,stroke-width:0px + +class s14,s15,s18,s19,s21,s23,s25,s27,s28 skip + +class i1,i2,i3,i4,i5,i6,i7,i8,i9,i10 index +class i11,i12,i13,i14,i15,i16,i17,i18,i19,i20 index +class i21,i22,i23,i24,i25,i26,i27,i28,i29 index +``` + +## Mathematical Definition + +Let $-$ is [_Empty element_](../carrier_set.md#mathematical-definition) + +Let $- \notin N$ + +Define $N_{-} = N \cup \{-\}$ + +The _Partial order_ $O_p$ is defined as an l-tuple with additional constraints: + +$$O_p = ,$$ + +$$\forall i \in \{1, ..., l\} \exists o_i \in N_{-} $$ + +$$ \exists j \in \{1, ..., l\}, \forall i < j | O_p(i) \in \{ -\} \land O_p(j) = 1 $$ + +$$\forall i \in \{1, ..., l\}, O_p(i) \in \{-\} \lor O_p(i) \leq max(o_1, ..., o_{i-1}) + 1 \big| max(\{-\})=0$$ + +Where: + +- $o_i$​ is called the $i$-th _element_ (or coordinate) of the partial order +- $l := |O_p|$ is called _length_ of the partial order, $l \in N$ +- $n := |\{ O_p(i) | O_p(i) \ne - \}|$ is _non-empty elements count_, $n \in N$ + +### Order of Partial Sequence + +Let $X$ is [_Carrier Set_](../../order/carrier_set.md#mathematical-definition) + +Let $X_{-}$ is [_Partial Carrier Set_](../carrier_set.md#mathematical-definition) + +$$X \subset X_{-}$$ + +Let $-$ is [_Empty element_](../carrier_set.md#mathematical-definition) of _Partial Carrier Set_ + +Let $S_p$ is [_Partial Sequence_](../sequence/index.md#mathematical-definition) described as function $S_p : \{1,...,l\} \longrightarrow X_{-}$ + +Let $alphabet_p$ is [_Alphabet of Partial Sequence function_](../alphabet/index.md#mathematical-definition) + +$$alphabet_p : \big\{\{1,...,l\} \longrightarrow X_{-} \big\} \longrightarrow \big\{\{1,...,m\} \longrightarrow X \big\}$$ + +Define + +$$order_p(S_p) : \big\{\{1,...,l\} \longrightarrow X_{-} \big\} \longrightarrow \big\{\{1,...,l\} \longrightarrow \{1,...,l\} \big\},$$ + +$$A = alphabet_p(S_p),$$ + +$$order_p(S_p)(i) = \Bigg\{\begin{array}{l} j \ \big| j \in \{1,...,l\}, S_p(i)=A(j), & S_p(i) \notin \{-\} \\ -, & S_p(i) \in \{-\} \end{array}$$ + + +### Order product Alphabet + +Let $X$ is a [_Carrier set_](../../order/carrier_set.md) + +Let $A$ is a [_Aphabet_](../../order/alphabet.md) $A : \{1, ..., m\} \longrightarrow X,$ + +Let $S_p$ is a [_Partial sequenece_](../sequence/index.md) $S : \{1, ..., l\} \longrightarrow X_{-},$ + +the following equations are true + +$$O_p = order_p(S_p),$$ + +$$A = alphabet_p(S_p),$$ + +$$S_p = ( O_p \odot A),$$ + +$$S_p(i) = \Bigg\{\begin{array}{l} A(O_p(i)) , & O_p(i) \notin \{-\} \\ -, & O_p(i) \in \{-\} \end{array}$$ diff --git a/docs/fundamentals/partials_and_congenerics/sequence/congeneric.md b/docs/fundamentals/partials_and_congenerics/sequence/congeneric.md new file mode 100644 index 00000000..25862abe --- /dev/null +++ b/docs/fundamentals/partials_and_congenerics/sequence/congeneric.md @@ -0,0 +1,60 @@ +# Congeneric Sequence + +_Congeneric sequence_ is an extreme case of [_Parial sequence_](./index.md) where all _non-empty_ elements are equals. + + $S_{c|T}$ is _Congeneric sequence_ for `T` + +``` mermaid +block-beta +columns 29 + +i1["1"] i2["2"] i3["3"] i4["4"] i5["5"] i6["6"] i7["7"] i8["8"] i9["9"] i10["10"] i11["11"] i12["12"] +i13["13"] i14["14"] i15["15"] i16["16"] i17["17"] i18["18"] i19["19"] i20["20"] +i21["21"] i22["12"] i23["23"] i24["24"] i25["25"] i26["26"] i27["27"] +i28["28"] i29["29"] + +s1["-"] s2["-"] s3["T"] s4["-"] s5["-"] s6["-"] s7["-"] s8["-"] s9["-"] s10["-"] +s11["-"] s12["-"] s13["-"] s14["-"] s15["-"] s16["-"] s17["T"] s18["-"] s19["-"] s20["-"] +s21["-"] s22["-"] s23["-"] s24["-"] s25["-"] s26["T"] s27["-"] s28["-"] s29["T"] + +classDef c1 fill:#ff7f0e,color:#fff; +classDef c2 fill:#ffbb78,color:#000; +classDef c3 fill:#2ca02c,color:#fff; +classDef c4 fill:#98df8a,color:#000; +classDef c5 fill:#d62728,color:#fff; +classDef c6 fill:#ff9896,color:#000; +classDef c7 fill:#9467bd,color:#fff; +classDef c8 fill:#c5b0d5,color:#000; +classDef c9 fill:#8c564b,color:#fff; +classDef c10 fill:#c49c94,color:#000; +classDef c11 fill:#e377c2,color:#fff; +classDef c12 fill:#f7b6d2,color:#000; +classDef c13 fill:#bcbd22,color:#fff; +classDef c14 fill:#dbdb8d,color:#000; +classDef c15 fill:#17becf,color:#fff; +classDef c16 fill:#9edae5,color:#000; + +classDef skip fill:#ffffff +classDef index fill:#ffffff,stroke-width:0px + +class s1,s2,s4,s5,s6,s7,s8,s9,s10 skip +class s11,s12,s13,s14,s15,s16,s18,s19,s20 skip +class s21,s22,s23,s24,s25,s27,s28,s30 skip +class s31,s32,s33,s34,s35 skip + +class i1,i2,i3,i4,i5,i6,i7,i8,i9,i10 index +class i11,i12,i13,i14,i15,i16,i17,i18,i19,i20 index +class i21,i22,i23,i24,i25,i26,i27,i28,i29 index +``` + +## Mathematical Definition + +Let $X$ is [_Carrier Set_](../../order/carrier_set.md#mathematical-definition) + +Let $X_{-}$ is [_Partial Carrier Set_](../carrier_set.md#mathematical-definition) + +$$X \subset X_{-}$$ + +Let $S_p$ is [_Partial sequence_](index.md#mathematical-definition) $S_p : \{1, ..., l\} \longrightarrow X_{-},$ + +$S_p$ is called $S_{c|e}$ - _Congeneric sequence_ of $e$ element - if $\exists e \in X\Big|\forall i, S_{p}(i) \in \{-, e\}$ diff --git a/docs/fundamentals/partials_and_congenerics/sequence/index.md b/docs/fundamentals/partials_and_congenerics/sequence/index.md new file mode 100644 index 00000000..576705f3 --- /dev/null +++ b/docs/fundamentals/partials_and_congenerics/sequence/index.md @@ -0,0 +1,171 @@ +# Partial Sequence + +_Partial sequence_ is a [_sequence_](../../order/sequence.md) where some elements are skipped. +The concept can be treated as equivalent to the _masked sequence_ that is used in bioinformatics and data science. +In FOA `-` symbol used as `empty` element. + +``` mermaid +block-beta +columns 29 + +i1["1"] i2["2"] i3["3"] i4["4"] i5["5"] i6["6"] i7["7"] i8["8"] i9["9"] i10["10"] i11["11"] i12["12"] +i13["13"] i14["14"] i15["15"] i16["16"] i17["17"] i18["18"] i19["19"] i20["20"] +i21["21"] i22["12"] i23["23"] i24["24"] i25["25"] i26["26"] i27["27"] +i28["28"] i29["29"] + +s1["I"] s2["N"] s3["T"] s4["E"] s5["L"] s6["L"] s7["I"] s8["G"] s9["E"] s10["N"] +s11["C"] s12["E"] s13[" "] s14["-"] s15["-"] s16[" "] s17["T"] s18["-"] s19["-"] s20[" "] +s21["-"] s22["B"] s23["-"] s24["L"] s25["-"] s26["T"] s27["-"] s28["-"] s29["T"] + +classDef c1 fill:#ff7f0e,color:#fff; +classDef c2 fill:#ffbb78,color:#000; +classDef c3 fill:#2ca02c,color:#fff; +classDef c4 fill:#98df8a,color:#000; +classDef c5 fill:#d62728,color:#fff; +classDef c6 fill:#ff9896,color:#000; +classDef c7 fill:#9467bd,color:#fff; +classDef c8 fill:#c5b0d5,color:#000; +classDef c9 fill:#8c564b,color:#fff; +classDef c10 fill:#c49c94,color:#000; +classDef c11 fill:#e377c2,color:#fff; +classDef c12 fill:#f7b6d2,color:#000; +classDef c13 fill:#bcbd22,color:#fff; +classDef c14 fill:#dbdb8d,color:#000; +classDef c15 fill:#17becf,color:#fff; +classDef c16 fill:#9edae5,color:#000; + +classDef skip fill:#ffffff +classDef index fill:#ffffff,stroke-width:0px + +class s14,s15,s18,s19,s21,s23,s25,s27,s28 skip + +class i1,i2,i3,i4,i5,i6,i7,i8,i9,i10 index +class i11,i12,i13,i14,i15,i16,i17,i18,i19,i20 index +class i21,i22,i23,i24,i25,i26,i27,i28,i29 index +``` + +## Mathematical Definition + +Let $X_{-}$ is [_Partial Carrier set_](../carrier_set.md#mathematical-definition) + +A _Partial sequence_ $S_{p}$ is a l-tuple defined as + +$$S_{p} = ,$$ + +$$\forall i \in \{1, ..., l\} \exists s_i \in X_{-}$$ + +where: + +- $s_i$​ is called the $i$-th _element_ (or coordinate) of the sequence. +- $l := |S_p|$ is _length_, $l \in N$ +- $n := |\{ S_p(i) | S_p(i) \ne - \}|$ is _non-empty elements count_, $n \in N$ + +The _sequence_ $S$ can be also defined as a function + +$$S_p : \{1, ..., l\} \longrightarrow X_{-},$$ + +$$S_p(i)=s_i | i \in \{1, ..., l\}$$ + + +### Compatibility + +Two _Partial Sequences_ are called compatible if there are no _non-empty_ elements in the same position in both sequences. + +=== "Сompatible" + + ``` mermaid + block-beta + columns 36 + s1["I"] s2["N"] s3["T"] s4["E"] s5["L"] s6["L"] s7["I"] s8["G"] s9["E"] s10["N"] + s11["C"] s12["E"] s13[" "] s14["-"] s15["-"] s16[" "] s17["T"] s18["-"] s19["-"] s20[" "] + s21["-"] s22["B"] s23["-"] s24["L"] s25["-"] s26["T"] s27["-"] s28["-"] s29["T"] s30["-"] + s31["-"] s32["-"] s33["D"] s34["-"] s35["P"] s36["T"] + + q1["-"] q2["-"] q3["-"] q4["-"] q5["-"] q6["-"] q7["-"] q8["-"] q9["-"] q10["-"] + q11["-"] q12["-"] q13["-"] q14["I"] q15["S"] q16["-"] q17["-"] q18["H"] q19["E"] q20["-"] + q21["A"] q22["-"] q23["I"] q24["-"] q25["I"] q26["-"] q27["I"] q28[" "] q29["-"] q30["O"] + q31[" "] q32["A"] q33["-"] q34["A"] q35["-"] q36["-"] + + + classDef c1 fill:#ff7f0e,color:#fff; + classDef c2 fill:#ffbb78,color:#000; + classDef c3 fill:#2ca02c,color:#fff; + classDef c4 fill:#98df8a,color:#000; + classDef c5 fill:#d62728,color:#fff; + classDef c6 fill:#ff9896,color:#000; + classDef c7 fill:#9467bd,color:#fff; + classDef c8 fill:#c5b0d5,color:#000; + classDef c9 fill:#8c564b,color:#fff; + classDef c10 fill:#c49c94,color:#000; + classDef c11 fill:#e377c2,color:#fff; + classDef c12 fill:#f7b6d2,color:#000; + classDef c13 fill:#bcbd22,color:#fff; + classDef c14 fill:#dbdb8d,color:#000; + classDef c15 fill:#17becf,color:#fff; + classDef c16 fill:#9edae5,color:#000; + + classDef skip fill:#ffffff + + class s14,s15,s18,s19,s21,s23,s25,s27,s28,s30,s31,s32,s34 skip + + class q1,q2,q3,q4,q5,q6,q7,q8,q9,q10 skip + class q11,q12,q13,q16,q17,q20 skip + class q22,q24,q26,q29 skip + class q33,q35,q36 skip + + ``` + +=== "Incompatible" + + ``` mermaid + block-beta + columns 36 + s1["I"] s2["N"] s3["T"] s4["E"] s5["L"] s6["L"] s7["I"] s8["G"] s9["E"] s10["N"] + s11["C"] s12["E"] s13[" "] s14["-"] s15["-"] s16[" "] s17["T"] s18["-"] s19["-"] s20[" "] + s21["-"] s22["B"] s23["-"] s24["L"] s25["-"] s26["T"] s27["-"] s28["-"] s29["T"] s30["-"] + s31["-"] s32["-"] s33["D"] s34["-"] s35["P"] s36["T"] + + q1["I"] q2["-"] q3["-"] q4["-"] q5["-"] q6["-"] q7["I"] q8["-"] q9["-"] q10["-"] + q11["-"] q12["-"] q13[" "] q14["I"] q15["S"] q16["-"] q17["-"] q18["H"] q19["E"] q20["-"] + q21["A"] q22["-"] q23["I"] q24["-"] q25["I"] q26["-"] q27["I"] q28[" "] q29["-"] q30["O"] + q31[" "] q32["A"] q33["-"] q34["A"] q35["-"] q36["-"] + + + classDef c1 fill:#ff7f0e,color:#fff; + classDef c2 fill:#ffbb78,color:#000; + classDef c3 fill:#2ca02c,color:#fff; + classDef c4 fill:#98df8a,color:#000; + classDef c5 fill:#d62728,color:#fff; + classDef c6 fill:#ff9896,color:#000; + classDef c7 fill:#9467bd,color:#fff; + classDef c8 fill:#c5b0d5,color:#000; + classDef c9 fill:#8c564b,color:#fff; + classDef c10 fill:#c49c94,color:#000; + classDef c11 fill:#e377c2,color:#fff; + classDef c12 fill:#f7b6d2,color:#000; + classDef c13 fill:#bcbd22,color:#fff; + classDef c14 fill:#dbdb8d,color:#000; + classDef c15 fill:#17becf,color:#fff; + classDef c16 fill:#9edae5,color:#000; + + classDef skip fill:#ffffff + + classDef conflict fill:#ff0000,color:#fff + + class s14,s15,s18,s19,s21,s23,s25,s27,s28,s30,s31,s32,s34 skip + + class q2,q3,q4,q5,q6,q8,q9,q10 skip + class q11,q12,q13,q16,q17,q20 skip + class q22,q24,q26,q29 skip + class q33,q35,q36 skip + + class s1,q1,s7,q7 conflict + ``` + + +Let $S1_p$ and $S2_p$ are _Partial sequences_ + +Define + + +$$compatible(S1_p, S2_p) = \forall i \in \{1,...,l\}\ S1_p(i) \notin \{-\} \lor S2_p(i) \notin \{-\} $$ diff --git a/mkdocs.yml b/mkdocs.yml index db37f756..25ecc017 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -32,6 +32,23 @@ nav: - "Volume": fundamentals/order/characteristics/volume.md - "Average remoteness": fundamentals/order/characteristics/average_remoteness.md - "Depth": fundamentals/order/characteristics/depth.md + - "Partials and congenerics": + - fundamentals/partials_and_congenerics/index.md + - "Carrier set": fundamentals/partials_and_congenerics/carrier_set.md + - "Sequence": + - fundamentals/partials_and_congenerics/sequence/index.md + - "Congeneric": fundamentals/partials_and_congenerics/sequence/congeneric.md + - "Alphabet": + - fundamentals/partials_and_congenerics/alphabet/index.md + - "Congeneric": fundamentals/partials_and_congenerics/alphabet/congeneric.md + - "Order": + - fundamentals/partials_and_congenerics/order/index.md + - "Congeneric": fundamentals/partials_and_congenerics/order/congeneric.md + - "Intervals chain": + - fundamentals/partials_and_congenerics/intervals_chain/index.md + - "Congeneric": fundamentals/partials_and_congenerics/intervals_chain/congeneric.md + - "Intervals distribution": fundamentals/partials_and_congenerics/intervals_distribution.md + - "Characteristics": fundamentals/partials_and_congenerics/characteristics.md - "Congeneric decomposition": - fundamentals/congeneric_decomposition/index.md - "Congeneric sequences": fundamentals/congeneric_decomposition/congeneric_sequences.md From 2482332fdce37e9e4ec839c9bc8c7868ca2373be Mon Sep 17 00:00:00 2001 From: Igor Rodionov Date: Mon, 11 Aug 2025 03:03:01 +0200 Subject: [PATCH 33/35] Added fundamentals docs --- .../congeneric_decomposition/alphabet.md | 357 ++++++++++++++++++ .../characteristics/arithmetic_mean.md | 3 - .../characteristics/average_remoteness.md | 3 - .../characteristics/depth.md | 3 - .../descriptive_information.md | 56 ++- .../characteristics/geometric_mean.md | 3 - .../identifying_information.md | 57 ++- .../characteristics/index.md | 10 +- .../characteristics/periodicity.md | 3 - .../characteristics/regularity.md | 73 ++++ .../characteristics/uniformity.md | 62 ++- .../characteristics/volume.md | 3 - .../congeneric_intervals_distribution.md | 3 - .../congeneric_intervals_order.md | 3 - .../congeneric_orders.md | 3 - .../congeneric_sequences.md | 3 - .../congeneric_decomposition/index.md | 243 +++++++++++- .../intervals_chains.md | 245 ++++++++++++ .../intervals_distribution.md | 184 +++++++++ .../congeneric_decomposition/orders.md | 262 +++++++++++++ .../congeneric_decomposition/sequences.md | 199 ++++++++++ docs/fundamentals/index.md | 12 +- .../intervals_chain/congeneric.md | 2 +- .../intervals_chain/index.md | 4 + .../order/congeneric.md | 2 +- .../partials_and_congenerics/order/index.md | 2 +- .../sequence/congeneric.md | 2 +- .../sequence/index.md | 2 +- mkdocs.yml | 40 +- 29 files changed, 1781 insertions(+), 63 deletions(-) create mode 100644 docs/fundamentals/congeneric_decomposition/alphabet.md delete mode 100644 docs/fundamentals/congeneric_decomposition/characteristics/arithmetic_mean.md delete mode 100644 docs/fundamentals/congeneric_decomposition/characteristics/average_remoteness.md delete mode 100644 docs/fundamentals/congeneric_decomposition/characteristics/depth.md delete mode 100644 docs/fundamentals/congeneric_decomposition/characteristics/geometric_mean.md delete mode 100644 docs/fundamentals/congeneric_decomposition/characteristics/periodicity.md create mode 100644 docs/fundamentals/congeneric_decomposition/characteristics/regularity.md delete mode 100644 docs/fundamentals/congeneric_decomposition/characteristics/volume.md delete mode 100644 docs/fundamentals/congeneric_decomposition/congeneric_intervals_distribution.md delete mode 100644 docs/fundamentals/congeneric_decomposition/congeneric_intervals_order.md delete mode 100644 docs/fundamentals/congeneric_decomposition/congeneric_orders.md delete mode 100644 docs/fundamentals/congeneric_decomposition/congeneric_sequences.md create mode 100644 docs/fundamentals/congeneric_decomposition/intervals_chains.md create mode 100644 docs/fundamentals/congeneric_decomposition/intervals_distribution.md create mode 100644 docs/fundamentals/congeneric_decomposition/orders.md create mode 100644 docs/fundamentals/congeneric_decomposition/sequences.md diff --git a/docs/fundamentals/congeneric_decomposition/alphabet.md b/docs/fundamentals/congeneric_decomposition/alphabet.md new file mode 100644 index 00000000..b1f21ba9 --- /dev/null +++ b/docs/fundamentals/congeneric_decomposition/alphabet.md @@ -0,0 +1,357 @@ +# Alphabet of Congeneric sequences + +_Alphabet_ of [_Congeneric sequences_](./sequences.md#mathematical-definition) is an [_Alphabet_](../order/alphabet.md#mathematical-definition). + + +=== "Congeneric sequences" + ``` mermaid + block-beta + columns 31 + + space:2 i1["1"] i2["2"] i3["3"] i4["4"] i5["5"] i6["6"] i7["7"] i8["8"] i9["9"] i10["10"] i11["11"] i12["12"] + i13["13"] i14["14"] i15["15"] i16["16"] i17["17"] i18["18"] i19["19"] i20["20"] + i21["21"] i22["22"] i23["23"] i24["24"] i25["25"] i26["26"] i27["27"] + i28["28"] i29["29"] + + space j1["1"] s1["I"] s2["-"] s3["-"] s4["-"] s5["-"] s6["-"] s7["I"] s8["-"] s9["-"] s10["-"] + s11["-"] s12["-"] s13["-"] s14["-"] s15["-"] s16["-"] s17["-"] s18["-"] s19["-"] s20["-"] + s21["-"] s22["-"] s23["-"] s24["-"] s25["-"] s26["-"] s27["-"] s28["-"] s29["-"] + + space j2["2"] n1["-"] n2["N"] n3["-"] n4["-"] n5["-"] n6["-"] n7["-"] n8["-"] n9["-"] n10["N"] + n11["-"] n12["-"] n13["-"] n14["-"] n15["-"] n16["-"] n17["-"] n18["-"] n19["-"] n20["-"] + n21["-"] n22["-"] n23["-"] n24["-"] n25["-"] n26["-"] n27["-"] n28["-"] n29["-"] + + space j3["3"] t1["-"] t2["-"] t3["T"] t4["-"] t5["-"] t6["-"] t7["-"] t8["-"] t9["-"] t10["-"] + t11["-"] t12["-"] t13["-"] t14["-"] t15["-"] t16["-"] t17["T"] t18["-"] t19["-"] t20["-"] + t21["-"] t22["-"] t23["-"] t24["-"] t25["-"] t26["T"] t27["-"] t28["-"] t29["T"] + + space j4["4"] e1["-"] e2["-"] e3["-"] e4["E"] e5["-"] e6["-"] e7["-"] e8["-"] e9["E"] e10["-"] + e11["-"] e12["E"] e13["-"] e14["-"] e15["-"] e16["-"] e17["-"] e18["-"] e19["-"] e20["-"] + e21["-"] e22["-"] e23["-"] e24["-"] e25["-"] e26["-"] e27["-"] e28["-"] e29["-"] + + space j5["5"] l1["-"] l2["-"] l3["-"] l4["-"] l5["L"] l6["L"] l7["-"] l8["-"] l9["-"] l10["-"] + l11["-"] l12["-"] l13["-"] l14["-"] l15["-"] l16["-"] l17["-"] l18["-"] l19["-"] l20["-"] + l21["-"] l22["-"] l23["-"] l24["L"] l25["-"] l26["-"] l27["-"] l28["-"] l29["-"] + + space j6["6"] g1["-"] g2["-"] g3["-"] g4["-"] g5["-"] g6["-"] g7["-"] g8["G"] g9["-"] g10["-"] + g11["-"] g12["-"] g13["-"] g14["-"] g15["-"] g16["-"] g17["-"] g18["-"] g19["-"] g20["-"] + g21["-"] g22["-"] g23["-"] g24["-"] g25["-"] g26["-"] g27["-"] g28["-"] g29["-"] + + space j7["7"] c1["-"] c2["-"] c3["-"] c4["-"] c5["-"] c6["-"] c7["-"] c8["-"] c9["-"] c10["-"] + c11["C"] c12["-"] c13["-"] c14["-"] c15["-"] c16["-"] c17["-"] c18["-"] c19["-"] c20["-"] + c21["-"] c22["-"] c23["-"] c24["-"] c25["-"] c26["-"] c27["-"] c28["-"] c29["-"] + + space j8["8"] sp1["-"] sp2["-"] sp3["-"] sp4["-"] sp5["-"] sp6["-"] sp7["-"] sp8["-"] sp9["-"] sp10["-"] + sp11["-"] sp12["-"] sp13[" "] sp14["-"] sp15["-"] sp16[" "] sp17["-"] sp18["-"] sp19["-"] sp20[" "] + sp21["-"] sp22["-"] sp23["-"] sp24["-"] sp25["-"] sp26["-"] sp27["-"] sp28["-"] sp29["-"] + + space j9["9"] b1["-"] b2["-"] b3["-"] b4["-"] b5["-"] b6["-"] b7["-"] b8["-"] b9["-"] b10["-"] + b11["-"] b12["-"] b13["-"] b14["-"] b15["-"] b16["-"] b17["-"] b18["-"] b19["-"] b20["-"] + b21["-"] b22["B"] b23["-"] b24["-"] b25["-"] b26["-"] b27["-"] b28["-"] b29["-"] + + classDef c1 fill:#ff7f0e,color:#fff; + classDef c2 fill:#ffbb78,color:#000; + classDef c3 fill:#2ca02c,color:#fff; + classDef c4 fill:#98df8a,color:#000; + classDef c5 fill:#d62728,color:#fff; + classDef c6 fill:#ff9896,color:#000; + classDef c7 fill:#9467bd,color:#fff; + classDef c8 fill:#c5b0d5,color:#000; + classDef c9 fill:#8c564b,color:#fff; + classDef c10 fill:#c49c94,color:#000; + classDef c11 fill:#e377c2,color:#fff; + classDef c12 fill:#f7b6d2,color:#000; + classDef c13 fill:#bcbd22,color:#fff; + classDef c14 fill:#dbdb8d,color:#000; + classDef c15 fill:#17becf,color:#fff; + classDef c16 fill:#9edae5,color:#000; + + classDef skip fill:#ffffff + classDef index fill:#ffffff,stroke-width:0px + + class s2,s3,s4,s5,s6,s8,s9,s10 index + class s11,s12,s13,s14,s15,s16,s17,s18,s19,s20 index + class s21,s22,s23,s24,s25,s26,s27,s28,s29 index + + class n1,n3,n4,n5,n6,n7,n8,n9 index + class n11,n12,n13,n14,n15,n16,n17,n18,n19,n20 index + class n21,n22,n23,n24,n25,n26,n27,n28,n29 index + + class t1,t2,t4,t5,t6,t7,t8,t9,t10 index + class t11,t12,t13,t14,t15,t16,t18,t19,t20 index + class t21,t22,t23,t24,t25,t27,t28 index + + class e1,e2,e3,e5,e6,e7,e8,e10 index + class e11,e13,e14,e15,e16,e17,e18,e19,e20 index + class e21,e22,e23,e24,e25,e26,e27,e28,e29 index + + class l1,l2,l3,l4,l7,l8,l9,l10 index + class l11,l12,l13,l14,l15,l16,l17,l18,l19,l20 index + class l21,l22,l23,l25,l26,l27,l28,l29 index + + class g1,g2,g3,g4,g5,g6,g7,g9,g10 index + class g11,g12,g13,g14,g15,g16,g17,g18,g19,g20 index + class g21,g22,g23,g24,g25,g26,g27,g28,g29 index + + class c1,c2,c3,c4,c5,c6,c7,c8,c9,c10 index + class c12,c13,c14,c15,c16,c17,c18,c19,c20 index + class c21,c22,c23,c24,c25,c26,c27,c28,c29 index + + class sp1,sp2,sp3,sp4,sp5,sp6,sp7,sp8,sp9,sp10 index + class sp11,sp12,sp14,sp15,sp17,sp18,sp19 index + class sp21,sp22,sp23,sp24,sp25,sp26,sp27,sp28,sp29 index + + class b1,b2,b3,b4,b5,b6,b7,b8,b9,b10 index + class b11,b12,b13,b14,b15,b16,b17,b18,b19,b20 index + class b21,b23,b24,b25,b26,b27,b28,b29 index + + + class i1,i2,i3,i4,i5,i6,i7,i8,i9,i10 index + class i11,i12,i13,i14,i15,i16,i17,i18,i19,i20 index + class i21,i22,i23,i24,i25,i26,i27,i28,i29 index + + class j1,j2,j3,j4,j5,j6,j7,j8,j9 index + ``` + + +=== "Alphabet and Congeneric sequences" + ``` mermaid + block-beta + columns 31 + + space:2 i1["1"] i2["2"] i3["3"] i4["4"] i5["5"] i6["6"] i7["7"] i8["8"] i9["9"] i10["10"] i11["11"] i12["12"] + i13["13"] i14["14"] i15["15"] i16["16"] i17["17"] i18["18"] i19["19"] i20["20"] + i21["21"] i22["22"] i23["23"] i24["24"] i25["25"] i26["26"] i27["27"] + i28["28"] i29["29"] + + a1["I"] j1["1"] s1["I"] s2["-"] s3["-"] s4["-"] s5["-"] s6["-"] s7["I"] s8["-"] s9["-"] s10["-"] + s11["-"] s12["-"] s13["-"] s14["-"] s15["-"] s16["-"] s17["-"] s18["-"] s19["-"] s20["-"] + s21["-"] s22["-"] s23["-"] s24["-"] s25["-"] s26["-"] s27["-"] s28["-"] s29["-"] + + a2["N"] j2["2"] n1["-"] n2["N"] n3["-"] n4["-"] n5["-"] n6["-"] n7["-"] n8["-"] n9["-"] n10["N"] + n11["-"] n12["-"] n13["-"] n14["-"] n15["-"] n16["-"] n17["-"] n18["-"] n19["-"] n20["-"] + n21["-"] n22["-"] n23["-"] n24["-"] n25["-"] n26["-"] n27["-"] n28["-"] n29["-"] + + a3["T"] j3["3"] t1["-"] t2["-"] t3["T"] t4["-"] t5["-"] t6["-"] t7["-"] t8["-"] t9["-"] t10["-"] + t11["-"] t12["-"] t13["-"] t14["-"] t15["-"] t16["-"] t17["T"] t18["-"] t19["-"] t20["-"] + t21["-"] t22["-"] t23["-"] t24["-"] t25["-"] t26["T"] t27["-"] t28["-"] t29["T"] + + a4["E"] j4["4"] e1["-"] e2["-"] e3["-"] e4["E"] e5["-"] e6["-"] e7["-"] e8["-"] e9["E"] e10["-"] + e11["-"] e12["E"] e13["-"] e14["-"] e15["-"] e16["-"] e17["-"] e18["-"] e19["-"] e20["-"] + e21["-"] e22["-"] e23["-"] e24["-"] e25["-"] e26["-"] e27["-"] e28["-"] e29["-"] + + a5["L"] j5["5"] l1["-"] l2["-"] l3["-"] l4["-"] l5["L"] l6["L"] l7["-"] l8["-"] l9["-"] l10["-"] + l11["-"] l12["-"] l13["-"] l14["-"] l15["-"] l16["-"] l17["-"] l18["-"] l19["-"] l20["-"] + l21["-"] l22["-"] l23["-"] l24["L"] l25["-"] l26["-"] l27["-"] l28["-"] l29["-"] + + a6["G"] j6["6"] g1["-"] g2["-"] g3["-"] g4["-"] g5["-"] g6["-"] g7["-"] g8["G"] g9["-"] g10["-"] + g11["-"] g12["-"] g13["-"] g14["-"] g15["-"] g16["-"] g17["-"] g18["-"] g19["-"] g20["-"] + g21["-"] g22["-"] g23["-"] g24["-"] g25["-"] g26["-"] g27["-"] g28["-"] g29["-"] + + a7["C"] j7["7"] c1["-"] c2["-"] c3["-"] c4["-"] c5["-"] c6["-"] c7["-"] c8["-"] c9["-"] c10["-"] + c11["C"] c12["-"] c13["-"] c14["-"] c15["-"] c16["-"] c17["-"] c18["-"] c19["-"] c20["-"] + c21["-"] c22["-"] c23["-"] c24["-"] c25["-"] c26["-"] c27["-"] c28["-"] c29["-"] + + a8[" "] j8["8"] sp1["-"] sp2["-"] sp3["-"] sp4["-"] sp5["-"] sp6["-"] sp7["-"] sp8["-"] sp9["-"] sp10["-"] + sp11["-"] sp12["-"] sp13[" "] sp14["-"] sp15["-"] sp16[" "] sp17["-"] sp18["-"] sp19["-"] sp20[" "] + sp21["-"] sp22["-"] sp23["-"] sp24["-"] sp25["-"] sp26["-"] sp27["-"] sp28["-"] sp29["-"] + + a9["B"] j9["9"] b1["-"] b2["-"] b3["-"] b4["-"] b5["-"] b6["-"] b7["-"] b8["-"] b9["-"] b10["-"] + b11["-"] b12["-"] b13["-"] b14["-"] b15["-"] b16["-"] b17["-"] b18["-"] b19["-"] b20["-"] + b21["-"] b22["B"] b23["-"] b24["-"] b25["-"] b26["-"] b27["-"] b28["-"] b29["-"] + + classDef c1 fill:#ff7f0e,color:#fff; + classDef c2 fill:#ffbb78,color:#000; + classDef c3 fill:#2ca02c,color:#fff; + classDef c4 fill:#98df8a,color:#000; + classDef c5 fill:#d62728,color:#fff; + classDef c6 fill:#ff9896,color:#000; + classDef c7 fill:#9467bd,color:#fff; + classDef c8 fill:#c5b0d5,color:#000; + classDef c9 fill:#8c564b,color:#fff; + classDef c10 fill:#c49c94,color:#000; + classDef c11 fill:#e377c2,color:#fff; + classDef c12 fill:#f7b6d2,color:#000; + classDef c13 fill:#bcbd22,color:#fff; + classDef c14 fill:#dbdb8d,color:#000; + classDef c15 fill:#17becf,color:#fff; + classDef c16 fill:#9edae5,color:#000; + + classDef skip fill:#fff + classDef index fill:#fff,stroke-width:0px + classDef hide fill:#fff,color:#fff,stroke-width:0px + + class s2,s3,s4,s5,s6,s8,s9,s10 index + class s11,s12,s13,s14,s15,s16,s17,s18,s19,s20 index + class s21,s22,s23,s24,s25,s26,s27,s28,s29 index + + class n1,n3,n4,n5,n6,n7,n8,n9 index + class n11,n12,n13,n14,n15,n16,n17,n18,n19,n20 index + class n21,n22,n23,n24,n25,n26,n27,n28,n29 index + + class t1,t2,t4,t5,t6,t7,t8,t9,t10 index + class t11,t12,t13,t14,t15,t16,t18,t19,t20 index + class t21,t22,t23,t24,t25,t27,t28 index + + class e1,e2,e3,e5,e6,e7,e8,e10 index + class e11,e13,e14,e15,e16,e17,e18,e19,e20 index + class e21,e22,e23,e24,e25,e26,e27,e28,e29 index + + class l1,l2,l3,l4,l7,l8,l9,l10 index + class l11,l12,l13,l14,l15,l16,l17,l18,l19,l20 index + class l21,l22,l23,l25,l26,l27,l28,l29 index + + class g1,g2,g3,g4,g5,g6,g7,g9,g10 index + class g11,g12,g13,g14,g15,g16,g17,g18,g19,g20 index + class g21,g22,g23,g24,g25,g26,g27,g28,g29 index + + class c1,c2,c3,c4,c5,c6,c7,c8,c9,c10 index + class c12,c13,c14,c15,c16,c17,c18,c19,c20 index + class c21,c22,c23,c24,c25,c26,c27,c28,c29 index + + class sp1,sp2,sp3,sp4,sp5,sp6,sp7,sp8,sp9,sp10 index + class sp11,sp12,sp14,sp15,sp17,sp18,sp19 index + class sp21,sp22,sp23,sp24,sp25,sp26,sp27,sp28,sp29 index + + class b1,b2,b3,b4,b5,b6,b7,b8,b9,b10 index + class b11,b12,b13,b14,b15,b16,b17,b18,b19,b20 index + class b21,b23,b24,b25,b26,b27,b28,b29 index + + + class i1,i2,i3,i4,i5,i6,i7,i8,i9,i10 index + class i11,i12,i13,i14,i15,i16,i17,i18,i19,i20 index + class i21,i22,i23,i24,i25,i26,i27,i28,i29 index + + class j1,j2,j3,j4,j5,j6,j7,j8,j9 index + ``` + + +=== "Alphabet" + + ``` mermaid + block-beta + columns 31 + + space:2 i1["1"] i2["2"] i3["3"] i4["4"] i5["5"] i6["6"] i7["7"] i8["8"] i9["9"] i10["10"] i11["11"] i12["12"] + i13["13"] i14["14"] i15["15"] i16["16"] i17["17"] i18["18"] i19["19"] i20["20"] + i21["21"] i22["22"] i23["23"] i24["24"] i25["25"] i26["26"] i27["27"] + i28["28"] i29["29"] + + a1["I"] j1["1"] s1["I"] s2["-"] s3["-"] s4["-"] s5["-"] s6["-"] s7["I"] s8["-"] s9["-"] s10["-"] + s11["-"] s12["-"] s13["-"] s14["-"] s15["-"] s16["-"] s17["-"] s18["-"] s19["-"] s20["-"] + s21["-"] s22["-"] s23["-"] s24["-"] s25["-"] s26["-"] s27["-"] s28["-"] s29["-"] + + a2["N"] j2["2"] n1["-"] n2["N"] n3["-"] n4["-"] n5["-"] n6["-"] n7["-"] n8["-"] n9["-"] n10["N"] + n11["-"] n12["-"] n13["-"] n14["-"] n15["-"] n16["-"] n17["-"] n18["-"] n19["-"] n20["-"] + n21["-"] n22["-"] n23["-"] n24["-"] n25["-"] n26["-"] n27["-"] n28["-"] n29["-"] + + a3["T"] j3["3"] t1["-"] t2["-"] t3["T"] t4["-"] t5["-"] t6["-"] t7["-"] t8["-"] t9["-"] t10["-"] + t11["-"] t12["-"] t13["-"] t14["-"] t15["-"] t16["-"] t17["T"] t18["-"] t19["-"] t20["-"] + t21["-"] t22["-"] t23["-"] t24["-"] t25["-"] t26["T"] t27["-"] t28["-"] t29["T"] + + a4["E"] j4["4"] e1["-"] e2["-"] e3["-"] e4["E"] e5["-"] e6["-"] e7["-"] e8["-"] e9["E"] e10["-"] + e11["-"] e12["E"] e13["-"] e14["-"] e15["-"] e16["-"] e17["-"] e18["-"] e19["-"] e20["-"] + e21["-"] e22["-"] e23["-"] e24["-"] e25["-"] e26["-"] e27["-"] e28["-"] e29["-"] + + a5["L"] j5["5"] l1["-"] l2["-"] l3["-"] l4["-"] l5["L"] l6["L"] l7["-"] l8["-"] l9["-"] l10["-"] + l11["-"] l12["-"] l13["-"] l14["-"] l15["-"] l16["-"] l17["-"] l18["-"] l19["-"] l20["-"] + l21["-"] l22["-"] l23["-"] l24["L"] l25["-"] l26["-"] l27["-"] l28["-"] l29["-"] + + a6["G"] j6["6"] g1["-"] g2["-"] g3["-"] g4["-"] g5["-"] g6["-"] g7["-"] g8["G"] g9["-"] g10["-"] + g11["-"] g12["-"] g13["-"] g14["-"] g15["-"] g16["-"] g17["-"] g18["-"] g19["-"] g20["-"] + g21["-"] g22["-"] g23["-"] g24["-"] g25["-"] g26["-"] g27["-"] g28["-"] g29["-"] + + a7["C"] j7["7"] c1["-"] c2["-"] c3["-"] c4["-"] c5["-"] c6["-"] c7["-"] c8["-"] c9["-"] c10["-"] + c11["C"] c12["-"] c13["-"] c14["-"] c15["-"] c16["-"] c17["-"] c18["-"] c19["-"] c20["-"] + c21["-"] c22["-"] c23["-"] c24["-"] c25["-"] c26["-"] c27["-"] c28["-"] c29["-"] + + a8[" "] j8["8"] sp1["-"] sp2["-"] sp3["-"] sp4["-"] sp5["-"] sp6["-"] sp7["-"] sp8["-"] sp9["-"] sp10["-"] + sp11["-"] sp12["-"] sp13[" "] sp14["-"] sp15["-"] sp16[" "] sp17["-"] sp18["-"] sp19["-"] sp20[" "] + sp21["-"] sp22["-"] sp23["-"] sp24["-"] sp25["-"] sp26["-"] sp27["-"] sp28["-"] sp29["-"] + + a9["B"] j9["9"] b1["-"] b2["-"] b3["-"] b4["-"] b5["-"] b6["-"] b7["-"] b8["-"] b9["-"] b10["-"] + b11["-"] b12["-"] b13["-"] b14["-"] b15["-"] b16["-"] b17["-"] b18["-"] b19["-"] b20["-"] + b21["-"] b22["B"] b23["-"] b24["-"] b25["-"] b26["-"] b27["-"] b28["-"] b29["-"] + + classDef c1 fill:#ff7f0e,color:#fff; + classDef c2 fill:#ffbb78,color:#000; + classDef c3 fill:#2ca02c,color:#fff; + classDef c4 fill:#98df8a,color:#000; + classDef c5 fill:#d62728,color:#fff; + classDef c6 fill:#ff9896,color:#000; + classDef c7 fill:#9467bd,color:#fff; + classDef c8 fill:#c5b0d5,color:#000; + classDef c9 fill:#8c564b,color:#fff; + classDef c10 fill:#c49c94,color:#000; + classDef c11 fill:#e377c2,color:#fff; + classDef c12 fill:#f7b6d2,color:#000; + classDef c13 fill:#bcbd22,color:#fff; + classDef c14 fill:#dbdb8d,color:#000; + classDef c15 fill:#17becf,color:#fff; + classDef c16 fill:#9edae5,color:#000; + + classDef skip fill:#fff + classDef index fill:#fff,stroke-width:0px + classDef hide fill:#fff,color:#fff,stroke-width:0px + + class s1,s2,s3,s4,s5,s6,s7,s8,s9,s10 hide + class s11,s12,s13,s14,s15,s16,s17,s18,s19,s20 hide + class s21,s22,s23,s24,s25,s26,s27,s28,s29 hide + + class n1,n2,n3,n4,n5,n6,n7,n8,n9,n10 hide + class n11,n12,n13,n14,n15,n16,n17,n18,n19,n20 hide + class n21,n22,n23,n24,n25,n26,n27,n28,n29 hide + + class t1,t2,t3,t4,t5,t6,t7,t8,t9,t10 hide + class t11,t12,t13,t14,t15,t16,t17,t18,t19,t20 hide + class t21,t22,t23,t24,t25,t26,t27,t28,t29 hide + + class e1,e2,e3,e4,e5,e6,e7,e8,e9,e10 hide + class e11,e12,e13,e14,e15,e16,e17,e18,e19,e20 hide + class e21,e22,e23,e24,e25,e26,e27,e28,e29 hide + + class l1,l2,l3,l4,l5,l6,l7,l8,l9,l10 hide + class l11,l12,l13,l14,l15,l16,l17,l18,l19,l20 hide + class l21,l22,l23,l24,l25,l26,l27,l28,l29 hide + + class g1,g2,g3,g4,g5,g6,g7,g8,g9,g10 hide + class g11,g12,g13,g14,g15,g16,g17,g18,g19,g20 hide + class g21,g22,g23,g24,g25,g26,g27,g28,g29 hide + + class c1,c2,c3,c4,c5,c6,c7,c8,c9,c10 hide + class c11,c12,c13,c14,c15,c16,c17,c18,c19,c20 hide + class c21,c22,c23,c24,c25,c26,c27,c28,c29 hide + + class sp1,sp2,sp3,sp4,sp5,sp6,sp7,sp8,sp9,sp10 hide + class sp11,sp12,sp13,sp14,sp15,sp16,sp17,sp18,sp19,sp20 hide + class sp21,sp22,sp23,sp24,sp25,sp26,sp27,sp28,sp29 hide + + class b1,b2,b3,b4,b5,b6,b7,b8,b9,b10 hide + class b11,b12,b13,b14,b15,b16,b17,b18,b19,b20 hide + class b21,b22,b23,b24,b25,b26,b27,b28,b29 hide + + + class i1,i2,i3,i4,i5,i6,i7,i8,i9,i10 hide + class i11,i12,i13,i14,i15,i16,i17,i18,i19,i20 hide + class i21,i22,i23,i24,i25,i26,i27,i28,i29 hide + + class j1,j2,j3,j4,j5,j6,j7,j8,j9 index + ``` + + +## Mathematical Definition + +Let $X_{-}$ is [_Partial Carrier set_](../partials_and_congenerics/carrier_set.md#mathematical-definition) + +Let $CS$ is [_Congeneric Sequences_](./sequences.md#as-m-tuple-of-congeneric-sequences) + +Let $alphabet_p$ is [_Alphabet of partial sequence_](../partials_and_congenerics/alphabet/index.md#mathematical-definition) + +Because by definition of _Congeneric sequences_ $\forall j \in \{1,...,m\}$ $CS(j)$ is [_Congeneric sequence_](../partials_and_congenerics/sequence/congeneric.md), so +$|alphabet_p(CS(j))| = 1$ because of [_Alphabet of Congeneric sequences_](../partials_and_congenerics/alphabet/congeneric.md#mathematical-definition) lemma. + +Define _Alphabet of congeneric sequences_ function + +$$alphabet_c : \big\{\{1,...,m\} \times \{1,...,l\} \longrightarrow X_{-} \big\} \longrightarrow \big\{\{1,...,m\} \longrightarrow X \big\},$$ + +$$alphabet_c(CS)(j) = alphabet_p(CS(j))(1)$$ diff --git a/docs/fundamentals/congeneric_decomposition/characteristics/arithmetic_mean.md b/docs/fundamentals/congeneric_decomposition/characteristics/arithmetic_mean.md deleted file mode 100644 index 3f3ed90f..00000000 --- a/docs/fundamentals/congeneric_decomposition/characteristics/arithmetic_mean.md +++ /dev/null @@ -1,3 +0,0 @@ -# Arithmetic Mean - -Coming soon diff --git a/docs/fundamentals/congeneric_decomposition/characteristics/average_remoteness.md b/docs/fundamentals/congeneric_decomposition/characteristics/average_remoteness.md deleted file mode 100644 index 415f7290..00000000 --- a/docs/fundamentals/congeneric_decomposition/characteristics/average_remoteness.md +++ /dev/null @@ -1,3 +0,0 @@ -# Average Remoteness - -Coming soon diff --git a/docs/fundamentals/congeneric_decomposition/characteristics/depth.md b/docs/fundamentals/congeneric_decomposition/characteristics/depth.md deleted file mode 100644 index 16f82bad..00000000 --- a/docs/fundamentals/congeneric_decomposition/characteristics/depth.md +++ /dev/null @@ -1,3 +0,0 @@ -# Depth - -Coming soon diff --git a/docs/fundamentals/congeneric_decomposition/characteristics/descriptive_information.md b/docs/fundamentals/congeneric_decomposition/characteristics/descriptive_information.md index 57d65081..b747c47f 100644 --- a/docs/fundamentals/congeneric_decomposition/characteristics/descriptive_information.md +++ b/docs/fundamentals/congeneric_decomposition/characteristics/descriptive_information.md @@ -1,3 +1,57 @@ # Descriptive Information -Coming soon +The Descriptive Information + +## Mathematical Definition + +The descriptive information can be calculated + + +### from Congeneric Intervals Chains + +Let $CIC$ is [_Congenerics Intervals Chains_](../intervals_chains.md#as-matrix-ml) defined as matrix + +$$ +CIC = +\begin{pmatrix} +\Delta_{1,1} & \Delta_{1,2} & \cdots & \Delta_{1,l} \\ +\Delta_{2,1} & \Delta_{2,2} & \cdots & \Delta_{2,l} \\ +\vdots & \vdots & \ddots & \vdots \\ +\Delta_{m,1} & \Delta_{m,2} & \cdots & \Delta_{m,l} +\end{pmatrix} +$$ + +$$D=\prod_{j=1}^{m}{\left(\frac{1}{n_j} \times \sum_{i=1}^{l}{\Bigg\{\begin{array}{l} + \Delta_{i,j}, & \Delta_{i,j} \notin \{-\} \\ + 0, & \Delta_{i,j} \in \{ - \} +\end{array}}\right)^{\frac{n_j}{n}}}$$ + +where $m$ the _power_, $n_j = \sum_{i=1}^{l}{\Bigg\{\begin{array}{l} + 1, & \Delta_{i,j} \notin \{-\} \\ + 0, & \Delta_{i,j} \in \{ - \} +\end{array}}$ is count of _non-empty_ elements in $j$ _congeneric intervals chain_, +$\Delta_{i,j}$ the $i$-th element of $j$-th _congeneric intervals chain_. + +$$n=\sum_{j=1}^{m}{n_j}$$ + + +### from Congenerics Intervals Distributions + +Let $CID$ is [_Congenerics Intervals Distributions_](../intervals_distribution.md#as-matrix-ml) defined as matrix + +$$ +CID = +\begin{pmatrix} +cid_{1,1} & cid_{1,2} & \cdots & cid_{1,l} \\ +cid_{2,1} & cid_{2,2} & \cdots & cid_{2,l} \\ +\vdots & \vdots & \ddots & \vdots \\ +cid_{m,1} & cid_{m,2} & \cdots & cid_{m,l} +\end{pmatrix} +$$ + +$$D=\prod_{j=1}^{m}{\left(\sum_{i=1}^{l}{\frac{i \times cid_{i,j}}{n_j}}\right)^{\frac{n_j}{n}}}$$ + +where $m$ the _power_, $n_j = \sum_{i=1}^{l}{cid_{i,j}}$ is count of _non-empty_ elements in $j$ _congeneric intervals distribution_, +$cid_{i,j}$ the $i$-th element of $j$-th _congeneric intervals distribution_. + +$$n=\sum_{j=1}^{m}{n_j}$$ diff --git a/docs/fundamentals/congeneric_decomposition/characteristics/geometric_mean.md b/docs/fundamentals/congeneric_decomposition/characteristics/geometric_mean.md deleted file mode 100644 index bfe6dcdb..00000000 --- a/docs/fundamentals/congeneric_decomposition/characteristics/geometric_mean.md +++ /dev/null @@ -1,3 +0,0 @@ -# Geometric Mean - -Coming soon diff --git a/docs/fundamentals/congeneric_decomposition/characteristics/identifying_information.md b/docs/fundamentals/congeneric_decomposition/characteristics/identifying_information.md index 6bd90c57..15ffe80d 100644 --- a/docs/fundamentals/congeneric_decomposition/characteristics/identifying_information.md +++ b/docs/fundamentals/congeneric_decomposition/characteristics/identifying_information.md @@ -1,3 +1,58 @@ # Identifying Information -Coming soon +The Identifying Information or Entropy + +## Mathematical Definition + +The identifying information/entropy can be calculated + + +### from Congeneric Intervals Chains + +Let $CIC$ is [_Congenerics Intervals Chains_](../intervals_chains.md#as-matrix-ml) defined as matrix + +$$ +CIC = +\begin{pmatrix} +\Delta_{1,1} & \Delta_{1,2} & \cdots & \Delta_{1,l} \\ +\Delta_{2,1} & \Delta_{2,2} & \cdots & \Delta_{2,l} \\ +\vdots & \vdots & \ddots & \vdots \\ +\Delta_{m,1} & \Delta_{m,2} & \cdots & \Delta_{m,l} +\end{pmatrix} +$$ + +$$H=\frac {1} {n} * \sum_{j=1}^{m}{\Bigg(n_j \times \log_2 \bigg( \sum_{i=1}^{l}{\Bigg\{\begin{array}{l} + \Delta_{i,j}, & \Delta_{i,j} \notin \{-\} \\ + 0, & \Delta_{i,j} \in \{ - \} +\end{array}}\bigg) - \log_2 n_j^{n_j} \Bigg)}$$ + +where $m$ the _power_, $n_j = \sum_{i=1}^{l}{\Bigg\{\begin{array}{l} + 1, & \Delta_{i,j} \notin \{-\} \\ + 0, & \Delta_{i,j} \in \{ - \} +\end{array}}$ is count of _non-empty_ elements in $j$ _congeneric intervals chain_, +$\Delta_{i,j}$ the $i$-th element of $j$-th _congeneric intervals chain_. + +$$n=\sum_{j=1}^{m}{n_j}$$ + + +### from Congenerics Intervals Distributions + +Let $CID$ is [_Congenerics Intervals Distributions_](../intervals_distribution.md#as-matrix-ml) defined as matrix + +$$ +CID = +\begin{pmatrix} +cid_{1,1} & cid_{1,2} & \cdots & cid_{1,l} \\ +cid_{2,1} & cid_{2,2} & \cdots & cid_{2,l} \\ +\vdots & \vdots & \ddots & \vdots \\ +cid_{m,1} & cid_{m,2} & \cdots & cid_{m,l} +\end{pmatrix} +$$ + +$$H=\frac {1} {n} * \sum_{j=1}^{m}{\Bigg(n_j \times \log_2 \sum_{i=1}^{l}{ \frac{i \times cid_{i,j}}{n_j}} \Bigg)}$$ + + +where $m$ the _power_, $n_j = \sum_{i=1}^{l}{cid_{i,j}}$ is count of _non-empty_ elements in $j$ _congeneric intervals distribution_, +$cid_{i,j}$ the $i$-th element of $j$-th _congeneric intervals distribution_. + +$$n=\sum_{j=1}^{m}{n_j}$$ diff --git a/docs/fundamentals/congeneric_decomposition/characteristics/index.md b/docs/fundamentals/congeneric_decomposition/characteristics/index.md index ba1feea7..e7d3122b 100644 --- a/docs/fundamentals/congeneric_decomposition/characteristics/index.md +++ b/docs/fundamentals/congeneric_decomposition/characteristics/index.md @@ -1,3 +1,11 @@ # Characteristics -Coming soon +Applying any of [_interval-based characteristics_](../../order/characteristics/index.md) to each element of _Congenetric Itervals Distributions_ stack produce +a vector of the characteristic. These vectors could be useful in analyzing parts of the sequence. + +In addition to that, there are four integral measures based on _congeneric intervals distributions_ that characterise the whole sequence + +- [Descriptive Information](./descriptive_information.md) +- [Identifying Information](./identifying_information.md) +- [Regularity](./regularity.md) +- [Uniformity](./uniformity.md) diff --git a/docs/fundamentals/congeneric_decomposition/characteristics/periodicity.md b/docs/fundamentals/congeneric_decomposition/characteristics/periodicity.md deleted file mode 100644 index a26aaa16..00000000 --- a/docs/fundamentals/congeneric_decomposition/characteristics/periodicity.md +++ /dev/null @@ -1,3 +0,0 @@ -# Periodicity - -Coming soon diff --git a/docs/fundamentals/congeneric_decomposition/characteristics/regularity.md b/docs/fundamentals/congeneric_decomposition/characteristics/regularity.md new file mode 100644 index 00000000..64f4c65e --- /dev/null +++ b/docs/fundamentals/congeneric_decomposition/characteristics/regularity.md @@ -0,0 +1,73 @@ +# Regularity + +The Regularity + +## Mathematical Definition + +The regularity can be calculated + + +### from Congeneric Intervals Chains + +Let $CIC$ is [_Congenerics Intervals Chains_](../intervals_chains.md#as-matrix-ml) defined as matrix + +$$ +CIC = +\begin{pmatrix} +\Delta_{1,1} & \Delta_{1,2} & \cdots & \Delta_{1,l} \\ +\Delta_{2,1} & \Delta_{2,2} & \cdots & \Delta_{2,l} \\ +\vdots & \vdots & \ddots & \vdots \\ +\Delta_{m,1} & \Delta_{m,2} & \cdots & \Delta_{m,l} +\end{pmatrix} +$$ + +$$r= \sqrt[n]{\prod_{j=1}^{m} \frac{ +\prod_{j=1}^{l} \Bigg\{\begin{array}{l} + \Delta_{i,j}, & \Delta_{i,j} \notin \{-\} \\ + 1, & \Delta_{i,j} \in \{ - \} +\end{array}} +{{\left(\frac{1}{n_j} \times \sum_{i=1}^{l}{\Bigg\{\begin{array}{l} + \Delta_{i,j}, & \Delta_{i,j} \notin \{-\} \\ + 0, & \Delta_{i,j} \in \{ - \} +\end{array}}\right)^{n_j}} +} +}$$ + + +where $m$ the _power_, $n_j = \sum_{i=1}^{l}{\Bigg\{\begin{array}{l} + 1, & \Delta_{i,j} \notin \{-\} \\ + 0, & \Delta_{i,j} \in \{ - \} +\end{array}}$ is count of _non-empty_ elements in $j$ _congeneric intervals chain_, +$\Delta_{i,j}$ the $i$-th element of $j$-th _congeneric intervals chain_. + +$$n=\sum_{j=1}^{m}{n_j}$$ + + +### from Congenerics Intervals Distributions + +Let $CID$ is [_Congenerics Intervals Distributions_](../intervals_distribution.md#as-matrix-ml) defined as matrix + +$$ +CID = +\begin{pmatrix} +cid_{1,1} & cid_{1,2} & \cdots & cid_{1,l} \\ +cid_{2,1} & cid_{2,2} & \cdots & cid_{2,l} \\ +\vdots & \vdots & \ddots & \vdots \\ +cid_{m,1} & cid_{m,2} & \cdots & cid_{m,l} +\end{pmatrix} +$$ + +$$r= \sqrt[n]{\prod_{j=1}^{m} \frac{ +\prod_{j=1}^{l} \Bigg\{\begin{array}{l} + i \times cid_{i,j}, & cid_{i,j} \neq 0 \\ + 1, & cid_{i,j} = 0 +\end{array}} +{{\left(\frac{1}{n_j} \times \sum_{i=1}^{l}{(i \times cid_{i,j})}\right)^{n_j}} +} +}$$ + + +where $m$ the _power_, $n_j = \sum_{i=1}^{l}{cid_{i,j}}$ is count of _non-empty_ elements in $j$ _congeneric intervals distribution_, +$cid_{i,j}$ the $i$-th element of $j$-th _congeneric intervals distribution_. + +$$n=\sum_{j=1}^{m}{n_j}$$ diff --git a/docs/fundamentals/congeneric_decomposition/characteristics/uniformity.md b/docs/fundamentals/congeneric_decomposition/characteristics/uniformity.md index 35fc8f22..260ee66d 100644 --- a/docs/fundamentals/congeneric_decomposition/characteristics/uniformity.md +++ b/docs/fundamentals/congeneric_decomposition/characteristics/uniformity.md @@ -1,3 +1,63 @@ # Uniformity -Coming soon +The Uniformity + +## Mathematical Definition + +The uniformity can be calculated + +### from Congeneric Intervals Chains + +Let $CIC$ is [_Congenerics Intervals Chains_](../intervals_chains.md#as-matrix-ml) defined as matrix + +$$ +CIC = +\begin{pmatrix} +\Delta_{1,1} & \Delta_{1,2} & \cdots & \Delta_{1,l} \\ +\Delta_{2,1} & \Delta_{2,2} & \cdots & \Delta_{2,l} \\ +\vdots & \vdots & \ddots & \vdots \\ +\Delta_{m,1} & \Delta_{m,2} & \cdots & \Delta_{m,l} +\end{pmatrix} +$$ + +$$u = \frac {1} {n} * \sum_{j=1}^{m}{\log_2 \frac{ \left(\sum_{i=1}^{l}{\Bigg\{\begin{array}{l} + \Delta_{i,j}, & \Delta_{i,j} \notin \{-\} \\ + 0, & \Delta_{i,j} \in \{ - \} +\end{array}}\right)^{n_j} } { \prod_{j=1}^{l} \Bigg\{\begin{array}{l} + \Delta_{i,j}, & \Delta_{i,j} \notin \{-\} \\ + 1, & \Delta_{i,j} \in \{ - \} +\end{array}} }$$ + +where $m$ the _power_, $n_j = \sum_{i=1}^{l}{\Bigg\{\begin{array}{l} + 1, & \Delta_{i,j} \notin \{-\} \\ + 0, & \Delta_{i,j} \in \{ - \} +\end{array}}$ is count of _non-empty_ elements in $j$ _congeneric intervals chain_, +$\Delta_{i,j}$ the $i$-th element of $j$-th _congeneric intervals chain_. + +$$n=\sum_{j=1}^{m}{n_j}$$ + + +### from Congenerics Intervals Distributions + +Let $CID$ is [_Congenerics Intervals Distributions_](../intervals_distribution.md#as-matrix-ml) defined as matrix + +$$ +CID = +\begin{pmatrix} +cid_{1,1} & cid_{1,2} & \cdots & cid_{1,l} \\ +cid_{2,1} & cid_{2,2} & \cdots & cid_{2,l} \\ +\vdots & \vdots & \ddots & \vdots \\ +cid_{m,1} & cid_{m,2} & \cdots & cid_{m,l} +\end{pmatrix} +$$ + +$$u = \frac {1} {n} * \sum_{j=1}^{m}{\log_2 \Bigg(\frac{ \sum_{i=1}^{l}{(i \times cid_{i,j})}^{n_j} } { \prod_{j=1}^{l} \Bigg\{\begin{array}{l} + i \times cid_{i,j}, & cid_{i,j} \neq 0 \\ + 1, & cid_{i,j} = 0 +\end{array}} }\Bigg)$$ + + +where $m$ the _power_, $n_j = \sum_{i=1}^{l}{cid_{i,j}}$ is count of _non-empty_ elements in $j$ _congeneric intervals distribution_, +$cid_{i,j}$ the $i$-th element of $j$-th _congeneric intervals distribution_. + +$$n=\sum_{j=1}^{m}{n_j}$$ diff --git a/docs/fundamentals/congeneric_decomposition/characteristics/volume.md b/docs/fundamentals/congeneric_decomposition/characteristics/volume.md deleted file mode 100644 index 0cee8e6a..00000000 --- a/docs/fundamentals/congeneric_decomposition/characteristics/volume.md +++ /dev/null @@ -1,3 +0,0 @@ -# Volume - -Coming soon diff --git a/docs/fundamentals/congeneric_decomposition/congeneric_intervals_distribution.md b/docs/fundamentals/congeneric_decomposition/congeneric_intervals_distribution.md deleted file mode 100644 index a887f538..00000000 --- a/docs/fundamentals/congeneric_decomposition/congeneric_intervals_distribution.md +++ /dev/null @@ -1,3 +0,0 @@ -# Congeneric Intervals Distribution - -Coming soon diff --git a/docs/fundamentals/congeneric_decomposition/congeneric_intervals_order.md b/docs/fundamentals/congeneric_decomposition/congeneric_intervals_order.md deleted file mode 100644 index b86f13ae..00000000 --- a/docs/fundamentals/congeneric_decomposition/congeneric_intervals_order.md +++ /dev/null @@ -1,3 +0,0 @@ -# Congeneric Intervals Order - -Coming soon diff --git a/docs/fundamentals/congeneric_decomposition/congeneric_orders.md b/docs/fundamentals/congeneric_decomposition/congeneric_orders.md deleted file mode 100644 index 57c3cd38..00000000 --- a/docs/fundamentals/congeneric_decomposition/congeneric_orders.md +++ /dev/null @@ -1,3 +0,0 @@ -# Congeneric Orders - -Coming soon diff --git a/docs/fundamentals/congeneric_decomposition/congeneric_sequences.md b/docs/fundamentals/congeneric_decomposition/congeneric_sequences.md deleted file mode 100644 index dfbdda11..00000000 --- a/docs/fundamentals/congeneric_decomposition/congeneric_sequences.md +++ /dev/null @@ -1,3 +0,0 @@ -# Congeneric Sequences - -Coming soon diff --git a/docs/fundamentals/congeneric_decomposition/index.md b/docs/fundamentals/congeneric_decomposition/index.md index 878292d3..912a6df4 100644 --- a/docs/fundamentals/congeneric_decomposition/index.md +++ b/docs/fundamentals/congeneric_decomposition/index.md @@ -1,3 +1,244 @@ # Congeneric Decomposition -Coming soon +Any [_Sequence_](../order/sequence.md) (including [_Partial Sequence_](../partials_and_congenerics/sequence/index.md)) can be decomposed into $m$ (power of an [_Alphabet_](../order/alphabet.md)) [_Congeneric Sequences_](../partials_and_congenerics/sequence/congeneric.md) length of $l$. Each _congeneric sequence_ would be [_compatible_](../partials_and_congenerics/sequence/index.md#compatibility) with all other _congeneric sequences_, so the procedure is invertible. Result of the decomposition can be represented as a matrix $m \times l$ + +The sequence + +``` mermaid +block-beta + columns 36 + seq1["I"] seq2["N"] seq3["T"] seq4["E"] seq5["L"] seq6["L"] seq7["I"] seq8["G"] seq9["E"] seq10["N"] + seq11["C"] seq12["E"] seq13[" "] seq14["I"] seq15["S"] seq16[" "] seq17["T"] seq18["H"] seq19["E"] seq20[" "] + seq21["A"] seq22["B"] seq23["I"] seq24["L"] seq25["I"] seq26["T"] seq27["Y"] seq28[" "] seq29["T"] seq30["O"] + seq31[" "] seq32["A"] seq33["D"] seq34["A"] seq35["P"] seq36["T"] + + classDef c1 fill:#ff7f0e,color:#fff; + classDef c2 fill:#ffbb78,color:#000; + classDef c3 fill:#2ca02c,color:#fff; + classDef c4 fill:#98df8a,color:#000; + classDef c5 fill:#d62728,color:#fff; + classDef c6 fill:#ff9896,color:#000; + classDef c7 fill:#9467bd,color:#fff; + classDef c8 fill:#c5b0d5,color:#000; + classDef c9 fill:#8c564b,color:#fff; + classDef c10 fill:#c49c94,color:#000; + classDef c11 fill:#e377c2,color:#fff; + classDef c12 fill:#f7b6d2,color:#000; + classDef c13 fill:#bcbd22,color:#fff; + classDef c14 fill:#dbdb8d,color:#000; + classDef c15 fill:#17becf,color:#fff; + classDef c16 fill:#9edae5,color:#000; + class seq1,seq7,seq14,seq23,seq25,i1,i7,i14,i23,i25 c1 + class seq2,seq10,n2,n10 c2 + class seq3,seq17,seq26,seq29,seq36,t3,t17,t26,t29,t36 c3 + class seq4,seq9,seq12,seq19,e4,e9,e12,e19 c4 + class seq5,seq6,seq24,l5,l6,l24 c5 + class seq8,g8 c6 + class seq11,c11 c7 + class seq13,seq16,seq20,seq28,seq31,sp13,sp16,sp20,sp28,sp31 c8 + class seq15,s15 c9 + class seq18,h18 c10 + class seq21,seq32,seq34,a21,a32,a34 c11 + class seq22,b22 c12 + class seq27,y27 c13 + class seq30,o30 c14 + class seq33,d33 c15 + class seq35,p35 c16 +``` + +decomposed into + +``` mermaid +block-beta + columns 37 + diag["⟍"] col1["1"] col2["2"] space:16 col19["..."] space:16 col36["l"] + row1["1"] i1["I"] i2["-"] i3["-"] i4["-"] i5["-"] i6["-"] i7["I"] i8["-"] i9["-"] i10["-"] + i11["-"] i12["-"] i13["-"] i14["I"] i15["-"] i16["-"] i17["-"] i18["-"] i19["-"] i20["-"] + i21["-"] i22["-"] i23["I"] i24["-"] i25["I"] i26["-"] i27["-"] i28["-"] i29["-"] i30["-"] + i31["-"] i32["-"] i33["-"] i34["-"] i35["-"] i36["-"] + row2["2"] n1["-"] n2["N"] n3["-"] n4["-"] n5["-"] n6["-"] n7["-"] n8["-"] n9["-"] n10["N"] + n11["-"] n12["-"] n13["-"] n14["-"] n15["-"] n16["-"] n17["-"] n18["-"] n19["-"] n20["-"] + n21["-"] n22["-"] n23["-"] n24["-"] n25["-"] n26["-"] n27["-"] n28["-"] n29["-"] n30["-"] + n31["-"] n32["-"] n33["-"] n34["-"] n35["-"] n36["-"] + space t1["-"] t2["-"] t3["T"] t4["-"] t5["-"] t6["-"] t7["-"] t8["-"] t9["-"] t10["-"] + t11["-"] t12["-"] t13["-"] t14["-"] t15["-"] t16["-"] t17["T"] t18["-"] t19["-"] t20["-"] + t21["-"] t22["-"] t23["-"] t24["-"] t25["-"] t26["T"] t27["-"] t28["-"] t29["T"] t30["-"] + t31["-"] t32["-"] t33["-"] t34["-"] t35["-"] t36["T"] + space e1["-"] e2["-"] e3["-"] e4["E"] e5["-"] e6["-"] e7["-"] e8["-"] e9["E"] e10["-"] + e11["-"] e12["E"] e13["-"] e14["-"] e15["-"] e16["-"] e17["-"] e18["-"] e19["E"] e20["-"] + e21["-"] e22["-"] e23["-"] e24["-"] e25["-"] e26["-"] e27["-"] e28["-"] e29["-"] e30["-"] + e31["-"] e32["-"] e33["-"] e34["-"] e35["-"] e36["-"] + space l1["-"] l2["-"] l3["-"] l4["-"] l5["L"] l6["L"] l7["-"] l8["-"] l9["-"] l10["-"] + l11["-"] l12["-"] l13["-"] l14["-"] l15["-"] l16["-"] l17["-"] l18["-"] l19["-"] l20["-"] + l21["-"] l22["-"] l23["-"] l24["L"] l25["-"] l26["-"] l27["-"] l28["-"] l29["-"] l30["-"] + l31["-"] l32["-"] l33["-"] l34["-"] l35["-"] l36["-"] + space g1["-"] g2["-"] g3["-"] g4["-"] g5["-"] g6["-"] g7["-"] g8["G"] g9["-"] g10["-"] + g11["-"] g12["-"] g13["-"] g14["-"] g15["-"] g16["-"] g17["-"] g18["-"] g19["-"] g20["-"] + g21["-"] g22["-"] g23["-"] g24["-"] g25["-"] g26["-"] g27["-"] g28["-"] g29["-"] g30["-"] + g31["-"] g32["-"] g33["-"] g34["-"] g35["-"] g36["-"] + space c1["-"] c2["-"] c3["-"] c4["-"] c5["-"] c6["-"] c7["-"] c8["-"] c9["-"] c10["-"] + c11["C"] c12["-"] c13["-"] c14["-"] c15["-"] c16["-"] c17["-"] c18["-"] c19["-"] c20["-"] + c21["-"] c22["-"] c23["-"] c24["-"] c25["-"] c26["-"] c27["-"] c28["-"] c29["-"] c30["-"] + c31["-"] c32["-"] c33["-"] c34["-"] c35["-"] c36["-"] + space sp1["-"] sp2["-"] sp3["-"] sp4["-"] sp5["-"] sp6["-"] sp7["-"] sp8["-"] sp9["-"] sp10["-"] + sp11["-"] sp12["-"] sp13[" "] sp14["-"] sp15["-"] sp16[" "] sp17["-"] sp18["-"] sp19["-"] sp20[" "] + sp21["-"] sp22["-"] sp23["-"] sp24["-"] sp25["-"] sp26["-"] sp27["-"] sp28[" "] sp29["-"] sp30["-"] + sp31[" "] sp32["-"] sp33["-"] sp34["-"] sp35["-"] sp36["-"] + row9["⋮"] s1["-"] s2["-"] s3["-"] s4["-"] s5["-"] s6["-"] s7["-"] s8["-"] s9["-"] s10["-"] + s11["-"] s12["-"] s13["-"] s14["-"] s15["S"] s16["-"] s17["-"] s18["-"] s19["-"] s20["-"] + s21["-"] s22["-"] s23["-"] s24["-"] s25["-"] s26["-"] s27["-"] s28["-"] s29["-"] s30["-"] + s31["-"] s32["-"] s33["-"] s34["-"] s35["-"] s36["-"] + space h1["-"] h2["-"] h3["-"] h4["-"] h5["-"] h6["-"] h7["-"] h8["-"] h9["-"] h10["-"] + h11["-"] h12["-"] h13["-"] h14["-"] h15["-"] h16["-"] h17["-"] h18["H"] h19["-"] h20["-"] + h21["-"] h22["-"] h23["-"] h24["-"] h25["-"] h26["-"] h27["-"] h28["-"] h29["-"] h30["-"] + h31["-"] h32["-"] h33["-"] h34["-"] h35["-"] h36["-"] + space a1["-"] a2["-"] a3["-"] a4["-"] a5["-"] a6["-"] a7["-"] a8["-"] a9["-"] a10["-"] + a11["-"] a12["-"] a13["-"] a14["-"] a15["-"] a16["-"] a17["-"] a18["-"] a19["-"] a20["-"] + a21["A"] a22["-"] a23["-"] a24["-"] a25["-"] a26["-"] a27["-"] a28["-"] a29["-"] a30["-"] + a31["-"] a32["A"] a33["-"] a34["A"] a35["-"] a36["-"] + space b1["-"] b2["-"] b3["-"] b4["-"] b5["-"] b6["-"] b7["-"] b8["-"] b9["-"] b10["-"] + b11["-"] b12["-"] b13["-"] b14["-"] b15["-"] b16["-"] b17["-"] b18["-"] b19["-"] b20["-"] + b21["-"] b22["B"] b23["-"] b24["-"] b25["-"] b26["-"] b27["-"] b28["-"] b29["-"] b30["-"] + b31["-"] b32["-"] b33["-"] b34["-"] b35["-"] b36["-"] + space y1["-"] y2["-"] y3["-"] y4["-"] y5["-"] y6["-"] y7["-"] y8["-"] y9["-"] y10["-"] + y11["-"] y12["-"] y13["-"] y14["-"] y15["-"] y16["-"] y17["-"] y18["-"] y19["-"] y20["-"] + y21["-"] y22["-"] y23["-"] y24["-"] y25["-"] y26["-"] y27["Y"] y28["-"] y29["-"] y30["-"] + y31["-"] y32["-"] y33["-"] y34["-"] y35["-"] y36["-"] + space o1["-"] o2["-"] o3["-"] o4["-"] o5["-"] o6["-"] o7["-"] o8["-"] o9["-"] o10["-"] + o11["-"] o12["-"] o13["-"] o14["-"] o15["-"] o16["-"] o17["-"] o18["-"] o19["-"] o20["-"] + o21["-"] o22["-"] o23["-"] o24["-"] o25["-"] o26["-"] o27["-"] o28["-"] o29["-"] o30["O"] + o31["-"] o32["-"] o33["-"] o34["-"] o35["-"] o36["-"] + space d1["-"] d2["-"] d3["-"] d4["-"] d5["-"] d6["-"] d7["-"] d8["-"] d9["-"] d10["-"] + d11["-"] d12["-"] d13["-"] d14["-"] d15["-"] d16["-"] d17["-"] d18["-"] d19["-"] d20["-"] + d21["-"] d22["-"] d23["-"] d24["-"] d25["-"] d26["-"] d27["-"] d28["-"] d29["-"] d30["-"] + d31["-"] d32["-"] d33["D"] d34["-"] d35["-"] d36["-"] + row16["m"] p1["-"] p2["-"] p3["-"] p4["-"] p5["-"] p6["-"] p7["-"] p8["-"] p9["-"] p10["-"] + p11["-"] p12["-"] p13["-"] p14["-"] p15["-"] p16["-"] p17["-"] p18["-"] p19["-"] p20["-"] + p21["-"] p22["-"] p23["-"] p24["-"] p25["-"] p26["-"] p27["-"] p28["-"] p29["-"] p30["-"] + p31["-"] p32["-"] p33["-"] p34["-"] p35["P"] p36["-"] + + + classDef c1 fill:#ff7f0e,color:#fff; + classDef c2 fill:#ffbb78,color:#000; + classDef c3 fill:#2ca02c,color:#fff; + classDef c4 fill:#98df8a,color:#000; + classDef c5 fill:#d62728,color:#fff; + classDef c6 fill:#ff9896,color:#000; + classDef c7 fill:#9467bd,color:#fff; + classDef c8 fill:#c5b0d5,color:#000; + classDef c9 fill:#8c564b,color:#fff; + classDef c10 fill:#c49c94,color:#000; + classDef c11 fill:#e377c2,color:#fff; + classDef c12 fill:#f7b6d2,color:#000; + classDef c13 fill:#bcbd22,color:#fff; + classDef c14 fill:#dbdb8d,color:#000; + classDef c15 fill:#17becf,color:#fff; + classDef c16 fill:#9edae5,color:#000; + classDef text fill:#fff,color:#000,stroke-width:0px + + class row1,row2,row9,row16 text + class col1,col2,col19,col36 text + class diag text + + + class i2,i3,i4,i5,i6,i8,i9,i10 text + class i11,i12,i13,i15,i16,i17,i18,i19,i20 text + class i21,i22,i24,i26,i27,i28,i29,i30 text + class i31,i32,i33,i34,i35,i36 text + + class n1,n3,n4,n5,n6,n7,n8,n9 text + class n11,n12,n13,n14,n15,n16,n17,n18,n19,n20 text + class n21,n22,n23,n24,n25,n26,n27,n28,n29,n30 text + class n31,n32,n33,n34,n35,n36 text + + class t1,t2,t4,t5,t6,t7,t8,t9,t10 text + class t11,t12,t13,t14,t15,t16,t18,t19,t20 text + class t21,t22,t23,t24,t25,t27,t28,t30 text + class t31,t32,t33,t34,t35 text + + class e1,e2,e3,e5,e6,e7,e8,e10 text + class e11,e13,e14,e15,e16,e17,e18,e20 text + class e21,e22,e23,e24,e25,e26,e27,e28,e29,e30 text + class e31,e32,e33,e34,e35,e36 text + + class l1,l2,l3,l4,l7,l8,l9,l10 text + class l11,l12,l13,l14,l15,l16,l17,l18,l19,l20 text + class l21,l22,l23,l25,l26,l27,l28,l29,l30 text + class l31,l32,l33,l34,l35,l36 text + + class g1,g2,g3,g4,g5,g6,g7,g9,g10 text + class g11,g12,g13,g14,g15,g16,g17,g18,g19,g20 text + class g21,g22,g23,g24,g25,g26,g27,g28,g29,g30 text + class g31,g32,g33,g34,g35,g36 text + + class c1,c2,c3,c4,c5,c6,c7,c8,c9,c10 text + class c12,c13,c14,c15,c16,c17,c18,c19,c20 text + class c21,c22,c23,c24,c25,c26,c27,c28,c29,c30 text + class c31,c32,c33,c34,c35,c36 text + + class sp1,sp2,sp3,sp4,sp5,sp6,sp7,sp8,sp9,sp10 text + class sp11,sp12,sp14,sp15,sp17,sp18,sp19 text + class sp21,sp22,sp23,sp24,sp25,sp26,sp27,sp28,sp29,sp30 text + class sp31,sp32,sp33,sp34,sp35,sp36 text + + class s1,s2,s3,s4,s5,s6,s7,s8,s9,s10 text + class s11,s12,s13,s14,s16,s17,s18,s19,s20 text + class s21,s22,s23,s24,s25,s26,s27,s28,s29,s30 text + class s31,s32,s33,s34,s35,s36 text + + class h1,h2,h3,h4,h5,h6,h7,h8,h9,h10 text + class h11,h12,h13,h14,h15,h16,h17,h19,h20 text + class h21,h22,h23,h24,h25,h26,h27,h28,h29,h30 text + class h31,h32,h33,h34,h35,h36 text + + + class a1,a2,a3,a4,a5,a6,a7,a8,a9,a10 text + class a11,a12,a13,a14,a15,a16,a17,a18,a19,a20 text + class a22,a23,a24,a25,a26,a27,a28,a29,a30 text + class a31,a33,a35,a36 text + + class b1,b2,b3,b4,b5,b6,b7,b8,b9,b10 text + class b11,b12,b13,b14,b15,b16,b17,b18,b19,b20 text + class b21,b23,b24,b25,b26,b27,b28,b29,b30 text + class b31,b32,b33,b34,b35,b36 text + + class y1,y2,y3,y4,y5,y6,y7,y8,y9,y10 text + class y11,y12,y13,y14,y15,y16,y17,y18,y19,y20 text + class y21,y22,y23,y24,y25,y26,y28,y29,y30 text + class y31,y32,y33,y34,y35,y36 text + + class o1,o2,o3,o4,o5,o6,o7,o8,o9,o10 text + class o11,o12,o13,o14,o15,o16,o17,o18,o19,o20 text + class o21,o22,o23,o24,o25,o26,o27,o28,o29 text + class o31,o32,o33,o34,o35,o36 text + + class d1,d2,d3,d4,d5,d6,d7,d8,d9,d10 text + class d11,d12,d13,d14,d15,d16,d17,d18,d19,d20 text + class d21,d22,d23,d24,d25,d26,d27,d28,d29,d30 text + class d31,d32,d34,d35,d36 text + + class p1,p2,p3,p4,p5,p6,p7,p8,p9,p10 text + class p11,p12,p13,p14,p15,p16,p17,p18,p19,p20 text + class p21,p22,p23,p24,p25,p26,p27,p28,p29,p30 text + class p31,p32,p33,p34,p36 text + + class seq1,seq7,seq14,seq23,seq25,i1,i7,i14,i23,i25 c1 + class seq2,seq10,n2,n10 c2 + class seq3,seq17,seq26,seq29,seq36,t3,t17,t26,t29,t36 c3 + class seq4,seq9,seq12,seq19,e4,e9,e12,e19 c4 + class seq5,seq6,seq24,l5,l6,l24 c5 + class seq8,g8 c6 + class seq11,c11 c7 + class seq13,seq16,seq20,seq28,seq31,sp13,sp16,sp20,sp28,sp31 c8 + class seq15,s15 c9 + class seq18,h18 c10 + class seq21,seq32,seq34,a21,a32,a34 c11 + class seq22,b22 c12 + class seq27,y27 c13 + class seq30,o30 c14 + class seq33,d33 c15 + class seq35,p35 c16 +``` + +Applying [operations](../order/index.md) to [_Congeneric sequences_](./sequences.md) and its derivatives produces [_Congenerics Orders_](./orders.md), [_Congenerics Intervals Chains_](./intervals_chains.md), +[_Congenerics Intervals Distributions_](./intervals_distribution.md) and finally [_Characteristics_](./characteristics/index.md) specific for _congeneric_ matrix. diff --git a/docs/fundamentals/congeneric_decomposition/intervals_chains.md b/docs/fundamentals/congeneric_decomposition/intervals_chains.md new file mode 100644 index 00000000..5c21222c --- /dev/null +++ b/docs/fundamentals/congeneric_decomposition/intervals_chains.md @@ -0,0 +1,245 @@ +# Congeneric Intervals Chains + +_Congeneric Intervals Chains_ is a stack of a [_compatible_](../partials_and_congenerics/sequence/index.md#compatibility) [_congeric interval chain_](../partials_and_congenerics/intervals_chain/congeneric.md) +that represents [_Intervals Chain_](../order/intervals_chain/index.md) or [_Partial Intervals Chain_](../partials_and_congenerics/intervals_chain/index.md). The _congeneric intervals chains_ are sorted in the stack by the first position with a _non-empty_ element in it. + +``` mermaid +block-beta +columns 30 + +space i1["1"] i2["2"] i3["3"] i4["4"] i5["5"] i6["6"] i7["7"] i8["8"] i9["9"] i10["10"] i11["11"] i12["12"] +i13["13"] i14["14"] i15["15"] i16["16"] i17["17"] i18["18"] i19["19"] i20["20"] +i21["21"] i22["22"] i23["23"] i24["24"] i25["25"] i26["26"] i27["27"] +i28["28"] i29["29"] + +j1["1"] s1["23"] s2["-"] s3["-"] s4["-"] s5["-"] s6["-"] s7["6"] s8["-"] s9["-"] s10["-"] +s11["-"] s12["-"] s13["-"] s14["-"] s15["-"] s16["-"] s17["-"] s18["-"] s19["-"] s20["-"] +s21["-"] s22["-"] s23["-"] s24["-"] s25["-"] s26["-"] s27["-"] s28["-"] s29["-"] + +j2["2"] n1["-"] n2["21"] n3["-"] n4["-"] n5["-"] n6["-"] n7["-"] n8["-"] n9["-"] n10["8"] +n11["-"] n12["-"] n13["-"] n14["-"] n15["-"] n16["-"] n17["-"] n18["-"] n19["-"] n20["-"] +n21["-"] n22["-"] n23["-"] n24["-"] n25["-"] n26["-"] n27["-"] n28["-"] n29["-"] + +j3["3"] t1["-"] t2["-"] t3["3"] t4["-"] t5["-"] t6["-"] t7["-"] t8["-"] t9["-"] t10["-"] +t11["-"] t12["-"] t13["-"] t14["-"] t15["-"] t16["-"] t17["14"] t18["-"] t19["-"] t20["-"] +t21["-"] t22["-"] t23["-"] t24["-"] t25["-"] t26["9"] t27["-"] t28["-"] t29["3"] + +j4["4"] e1["-"] e2["-"] e3["-"] e4["21"] e5["-"] e6["-"] e7["-"] e8["-"] e9["5"] e10["-"] +e11["-"] e12["3"] e13["-"] e14["-"] e15["-"] e16["-"] e17["-"] e18["-"] e19["-"] e20["-"] +e21["-"] e22["-"] e23["-"] e24["-"] e25["-"] e26["-"] e27["-"] e28["-"] e29["-"] + +j5["5"] l1["-"] l2["-"] l3["-"] l4["-"] l5["10"] l6["1"] l7["-"] l8["-"] l9["-"] l10["-"] +l11["-"] l12["-"] l13["-"] l14["-"] l15["-"] l16["-"] l17["-"] l18["-"] l19["-"] l20["-"] +l21["-"] l22["-"] l23["-"] l24["18"] l25["-"] l26["-"] l27["-"] l28["-"] l29["-"] + +j6["6"] g1["-"] g2["-"] g3["-"] g4["-"] g5["-"] g6["-"] g7["-"] g8["29"] g9["-"] g10["-"] +g11["-"] g12["-"] g13["-"] g14["-"] g15["-"] g16["-"] g17["-"] g18["-"] g19["-"] g20["-"] +g21["-"] g22["-"] g23["-"] g24["-"] g25["-"] g26["-"] g27["-"] g28["-"] g29["-"] + +j7["7"] c1["-"] c2["-"] c3["-"] c4["-"] c5["-"] c6["-"] c7["-"] c8["-"] c9["-"] c10["-"] +c11["29"] c12["-"] c13["-"] c14["-"] c15["-"] c16["-"] c17["-"] c18["-"] c19["-"] c20["-"] +c21["-"] c22["-"] c23["-"] c24["-"] c25["-"] c26["-"] c27["-"] c28["-"] c29["-"] + +j8["8"] sp1["-"] sp2["-"] sp3["-"] sp4["-"] sp5["-"] sp6["-"] sp7["-"] sp8["-"] sp9["-"] sp10["-"] +sp11["-"] sp12["-"] sp13["22"] sp14["-"] sp15["-"] sp16["3"] sp17["-"] sp18["-"] sp19["-"] sp20["4"] +sp21["-"] sp22["-"] sp23["-"] sp24["-"] sp25["-"] sp26["-"] sp27["-"] sp28["-"] sp29["-"] + +j9["9"] b1["-"] b2["-"] b3["-"] b4["-"] b5["-"] b6["-"] b7["-"] b8["-"] b9["-"] b10["-"] +b11["-"] b12["-"] b13["-"] b14["-"] b15["-"] b16["-"] b17["-"] b18["-"] b19["-"] b20["-"] +b21["-"] b22["29"] b23["-"] b24["-"] b25["-"] b26["-"] b27["-"] b28["-"] b29["-"] + + +classDef c1 fill:#ff7f0e,color:#fff; +classDef c2 fill:#ffbb78,color:#000; +classDef c3 fill:#2ca02c,color:#fff; +classDef c4 fill:#98df8a,color:#000; +classDef c5 fill:#d62728,color:#fff; +classDef c6 fill:#ff9896,color:#000; +classDef c7 fill:#9467bd,color:#fff; +classDef c8 fill:#c5b0d5,color:#000; +classDef c9 fill:#8c564b,color:#fff; +classDef c10 fill:#c49c94,color:#000; +classDef c11 fill:#e377c2,color:#fff; +classDef c12 fill:#f7b6d2,color:#000; +classDef c13 fill:#bcbd22,color:#fff; +classDef c14 fill:#dbdb8d,color:#000; +classDef c15 fill:#17becf,color:#fff; +classDef c16 fill:#9edae5,color:#000; + +classDef skip fill:#ffffff +classDef index fill:#ffffff,stroke-width:0px + +class s2,s3,s4,s5,s6,s8,s9,s10 index +class s11,s12,s13,s14,s15,s16,s17,s18,s19,s20 index +class s21,s22,s23,s24,s25,s26,s27,s28,s29 index + +class n1,n3,n4,n5,n6,n7,n8,n9 index +class n11,n12,n13,n14,n15,n16,n17,n18,n19,n20 index +class n21,n22,n23,n24,n25,n26,n27,n28,n29 index + +class t1,t2,t4,t5,t6,t7,t8,t9,t10 index +class t11,t12,t13,t14,t15,t16,t18,t19,t20 index +class t21,t22,t23,t24,t25,t27,t28 index + +class e1,e2,e3,e5,e6,e7,e8,e10 index +class e11,e13,e14,e15,e16,e17,e18,e19,e20 index +class e21,e22,e23,e24,e25,e26,e27,e28,e29 index + +class l1,l2,l3,l4,l7,l8,l9,l10 index +class l11,l12,l13,l14,l15,l16,l17,l18,l19,l20 index +class l21,l22,l23,l25,l26,l27,l28,l29 index + +class g1,g2,g3,g4,g5,g6,g7,g9,g10 index +class g11,g12,g13,g14,g15,g16,g17,g18,g19,g20 index +class g21,g22,g23,g24,g25,g26,g27,g28,g29 index + +class c1,c2,c3,c4,c5,c6,c7,c8,c9,c10 index +class c12,c13,c14,c15,c16,c17,c18,c19,c20 index +class c21,c22,c23,c24,c25,c26,c27,c28,c29 index + +class sp1,sp2,sp3,sp4,sp5,sp6,sp7,sp8,sp9,sp10 index +class sp11,sp12,sp14,sp15,sp17,sp18,sp19 index +class sp21,sp22,sp23,sp24,sp25,sp26,sp27,sp28,sp29 index + +class b1,b2,b3,b4,b5,b6,b7,b8,b9,b10 index +class b11,b12,b13,b14,b15,b16,b17,b18,b19,b20 index +class b21,b23,b24,b25,b26,b27,b28,b29 index + + +class i1,i2,i3,i4,i5,i6,i7,i8,i9,i10 index +class i11,i12,i13,i14,i15,i16,i17,i18,i19,i20 index +class i21,i22,i23,i24,i25,i26,i27,i28,i29 index + +class j1,j2,j3,j4,j5,j6,j7,j8,j9 index +``` + +## Mathematical Definition + +Let $IC_{c}$ is [_Congeneric Interval Chain_](../partials_and_congenerics/intervals_chain/congeneric.md#mathematical-definition) + +Define a _Congeric intervals chains_ + +### as m-tuple of congeneric intervals chain + +Let $compatible(IC1_c, IC2_c)$ is [_compatibility of Partial Sequences function_](../partials_and_congenerics/sequence/index.md#compatibility) + +$CIC$ is m-tuple of $IC_c$ _intervals chain_ + +$$CIC = ,$$ + +$$\forall j \in \{1, ..., m\} \exists cic_j \in \{IC_c\}, $$ + +all _congeneric intervals chains_ are _compatible_ + +$$compatible(CIC(k), CIC(j)) \bigg| \forall k,j \in \{1, ..., m\}, k \ne j,$$ + +and sorted by first apperance of _non-empty_ element + +$$\forall k > j \in \{1,...,m\},\ x < i \in \{1,...,l\}, CIC(k)(x) \ne 1 \bigg| CIC(j)(i) \notin \{-\} \land CIC(j)(x) \in \{-\}$$ + +where: + +- $cic_j$​ is called the $j$-th _congeneric intervals chain_. +- $l := |CIC(1)|$ is _length_, $l \in N$ +- $m := |CIC|$ is _power_, $m \in N$ + +### as matrix (m,l) + +$CIC$ is (m,l) matrix of $\{1,..,, l\} \cup \{-\}$ + +$$ +CIC = +\begin{pmatrix} +\Delta_{1,1} & \Delta_{1,2} & \cdots & \Delta_{1,l} \\ +\Delta_{2,1} & \Delta_{2,2} & \cdots & \Delta_{2,l} \\ +\vdots & \vdots & \ddots & \vdots \\ +\Delta_{m,1} & \Delta_{m,2} & \cdots & \Delta_{m,l} +\end{pmatrix} +$$ + +$$\forall j \in \{1, ..., m\}, i \in \{1, ..., l\} \exists \Delta_{j,i} \in \{1,..,, l\} \cup \{-\}, $$ + +columns are _compatible_ + +$$\ \Delta_{k,i} \in \{-\} \big | \forall i \in \{1,...,l\}, \forall j \in \{1,...,m\}, \forall k \ne j,\ \Delta_{j,i} \in \{1,...,l\} $$ + +and sorted by first apperance of _non-empty_ element + +$$\forall k > j \in \{1,...,m\},\ x < i \in \{1,...,l\}, \Delta_{k,x} \in \{-\} \bigg| \Delta_{j,i} \in \{1,...,l\} \land \Delta_{j,x} \in \{-\}$$ + +where: + +- $\Delta_j$​ is called the $j$-th _congeneric intervals chain_ or $j$-th _row_. +- $\Delta_{j,i}$​ is called the $i$-th element of $j$-th _congeneric intervals chain_. +- $l$ is _length_, $l \in N$ +- $m$ is _power_, $m \in N$ + + +### from Congeneric Sequences + +Let $X_{-}$ is a [_Parial carrier set_](../partials_and_congenerics/carrier_set.md#mathematical-definition) + +Let $CS$ is [_Congeneric Sequences_](./sequences.md#mathematical-definition) - (m,l) matrix of $X_{-}$ + +Let $Binging_p$ is [_Partial Binding_](../partials_and_congenerics/intervals_chain/index.md#define-partial-bindings) + +Let $Intervals_p$ is [_Partial Intervals function_](../partials_and_congenerics/intervals_chain/index.md#define-partial-intervals-chain) described as function + +$$Intervals_p : \big\{Binding_p\big\} \times \big\{S_p\} \longrightarrow \big\{ IC_p \big\}$$ + +$$ +CS = +\begin{pmatrix} +cs_{1,1} & cs_{1,2} & \cdots & cs_{1,l} \\ +cs_{2,1} & cs_{2,2} & \cdots & cs_{2,l} \\ +\vdots & \vdots & \ddots & \vdots \\ +cs_{m,1} & cs_{m,2} & \cdots & cs_{m,l} +\end{pmatrix} +$$ + +Define + +$$congenerics\_intervals\_chains : \{CS\} \longrightarrow \{CIC\}$$ + +$$congenerics\_intervals\_chains(CS)(j)(i) = Intervals_p(CS(j))(i) $$ + +$$\exists congenerics\_intervals\_chain^{-1} : \{CIC\} \longrightarrow \{CS\},$$ + +$$congenerics\_intervals\_chains^{-1}(CIC)(i) = \Bigg\{\begin{array}{l} + j, & \exists j \in \{1,...,m\}, CIC(j)(i) \notin \{-\} \\ + -, & otherwise +\end{array}$$ + + +### from Congeneric Orders + +Let $CO$ is [_Congeneric Orders_](./orders.md#mathematical-definition) - (m,l) matrix of $\{1,...,l\} \cup \{-\}$ + +Let $Binging_p$ is [_Partial Binding_](../partials_and_congenerics/intervals_chain/index.md#define-partial-bindings) + +Let $Intervals_p$ is [_Partial Intervals function_](../partials_and_congenerics/intervals_chain/index.md#define-partial-intervals-chain) described as function + +$$Intervals_p : \big\{Binding_p\big\} \times \big\{S_p\} \longrightarrow \big\{ IC_p \big\}$$ + +$$ +CO = +\begin{pmatrix} +co_{1,1} & co_{1,2} & \cdots & co_{1,l} \\ +co_{2,1} & co_{2,2} & \cdots & co_{2,l} \\ +\vdots & \vdots & \ddots & \vdots \\ +co_{m,1} & co_{m,2} & \cdots & co_{m,l} +\end{pmatrix} +$$ + +Define + +$$congenerics\_intervals\_chains : \{CO\} \longrightarrow \{CIC\}$$ + +$$congenerics\_intervals\_chains(CO)(j)(i) = Intervals_p(CO(j))(i) $$ + +$$\exists congenerics\_intervals\_chain^{-1} : \{CIC\} \longrightarrow \{CO\},$$ + +$$congenerics\_intervals\_chains^{-1}(CIC)(i) = \Bigg\{\begin{array}{l} + 1, & \exists j \in \{1,...,m\}, CIC(j)(i) \notin \{-\} \\ + -, & otherwise +\end{array}$$ diff --git a/docs/fundamentals/congeneric_decomposition/intervals_distribution.md b/docs/fundamentals/congeneric_decomposition/intervals_distribution.md new file mode 100644 index 00000000..f188b391 --- /dev/null +++ b/docs/fundamentals/congeneric_decomposition/intervals_distribution.md @@ -0,0 +1,184 @@ +# Congeneric Intervals Distributions + +_Congeneric Intervals Distributions_ is a stack of [_Partials Intervals Distribution_](../partials_and_congenerics/intervals_distribution.md) +that represents [_Intervals Distribution_](../order/intervals_distribution/index.md). + +``` mermaid +block-beta +columns 30 + +space i1["1"] i2["2"] i3["3"] i4["4"] i5["5"] i6["6"] i7["7"] i8["8"] i9["9"] i10["10"] i11["11"] i12["12"] +i13["13"] i14["14"] i15["15"] i16["16"] i17["17"] i18["18"] i19["19"] i20["20"] +i21["21"] i22["22"] i23["23"] i24["24"] i25["25"] i26["26"] i27["27"] +i28["28"] i29["29"] + +j1["1"] s1["0"] s2["0"] s3["0"] s4["0"] s5["0"] s6["1"] s7["0"] s8["0"] s9["0"] s10["0"] +s11["0"] s12["0"] s13["0"] s14["0"] s15["0"] s16["0"] s17["0"] s18["0"] s19["0"] s20["0"] +s21["0"] s22["0"] s23["1"] s24["0"] s25["0"] s26["0"] s27["0"] s28["0"] s29["0"] + +j2["2"] n1["0"] n2["0"] n3["0"] n4["0"] n5["0"] n6["0"] n7["0"] n8["1"] n9["0"] n10["0"] +n11["0"] n12["0"] n13["0"] n14["0"] n15["0"] n16["0"] n17["0"] n18["0"] n19["0"] n20["0"] +n21["1"] n22["0"] n23["0"] n24["0"] n25["0"] n26["0"] n27["0"] n28["0"] n29["0"] + +j3["3"] t1["0"] t2["0"] t3["2"] t4["0"] t5["0"] t6["0"] t7["0"] t8["0"] t9["1"] t10["0"] +t11["0"] t12["0"] t13["0"] t14["1"] t15["0"] t16["0"] t17["0"] t18["0"] t19["0"] t20["0"] +t21["0"] t22["0"] t23["0"] t24["0"] t25["0"] t26["0"] t27["0"] t28["0"] t29["0"] + +j4["4"] e1["0"] e2["0"] e3["1"] e4["0"] e5["1"] e6["0"] e7["0"] e8["0"] e9["0"] e10["0"] +e11["0"] e12["0"] e13["0"] e14["0"] e15["0"] e16["0"] e17["0"] e18["0"] e19["0"] e20["0"] +e21["1"] e22["0"] e23["0"] e24["0"] e25["0"] e26["0"] e27["0"] e28["0"] e29["0"] + +j5["5"] l1["1"] l2["0"] l3["0"] l4["0"] l5["0"] l6["0"] l7["0"] l8["0"] l9["0"] l10["1"] +l11["0"] l12["0"] l13["0"] l14["0"] l15["0"] l16["0"] l17["0"] l18["1"] l19["0"] l20["0"] +l21["0"] l22["0"] l23["0"] l24["0"] l25["0"] l26["0"] l27["0"] l28["0"] l29["0"] + +j6["6"] g1["0"] g2["0"] g3["0"] g4["0"] g5["0"] g6["0"] g7["0"] g8["0"] g9["0"] g10["0"] +g11["0"] g12["0"] g13["0"] g14["0"] g15["0"] g16["0"] g17["0"] g18["0"] g19["0"] g20["0"] +g21["0"] g22["0"] g23["0"] g24["0"] g25["0"] g26["0"] g27["0"] g28["0"] g29["1"] + +j7["7"] c1["0"] c2["0"] c3["0"] c4["0"] c5["0"] c6["0"] c7["0"] c8["0"] c9["0"] c10["0"] +c11["0"] c12["0"] c13["0"] c14["0"] c15["0"] c16["0"] c17["0"] c18["0"] c19["0"] c20["0"] +c21["0"] c22["0"] c23["0"] c24["0"] c25["0"] c26["0"] c27["0"] c28["0"] c29["1"] + +j8["8"] sp1["0"] sp2["0"] sp3["1"] sp4["1"] sp5["0"] sp6["0"] sp7["0"] sp8["0"] sp9["0"] sp10["0"] +sp11["0"] sp12["0"] sp13["0"] sp14["0"] sp15["0"] sp16["0"] sp17["0"] sp18["0"] sp19["0"] sp20["0"] +sp21["0"] sp22["1"] sp23["0"] sp24["0"] sp25["0"] sp26["0"] sp27["0"] sp28["0"] sp29["0"] + +j9["9"] b1["0"] b2["0"] b3["0"] b4["0"] b5["0"] b6["0"] b7["0"] b8["0"] b9["0"] b10["0"] +b11["0"] b12["0"] b13["0"] b14["0"] b15["0"] b16["0"] b17["0"] b18["0"] b19["0"] b20["0"] +b21["0"] b22["0"] b23["0"] b24["0"] b25["0"] b26["0"] b27["0"] b28["0"] b29["1"] + + +classDef c1 fill:#ff7f0e,color:#fff; +classDef c2 fill:#ffbb78,color:#000; +classDef c3 fill:#2ca02c,color:#fff; +classDef c4 fill:#98df8a,color:#000; +classDef c5 fill:#d62728,color:#fff; +classDef c6 fill:#ff9896,color:#000; +classDef c7 fill:#9467bd,color:#fff; +classDef c8 fill:#c5b0d5,color:#000; +classDef c9 fill:#8c564b,color:#fff; +classDef c10 fill:#c49c94,color:#000; +classDef c11 fill:#e377c2,color:#fff; +classDef c12 fill:#f7b6d2,color:#000; +classDef c13 fill:#bcbd22,color:#fff; +classDef c14 fill:#dbdb8d,color:#000; +classDef c15 fill:#17becf,color:#fff; +classDef c16 fill:#9edae5,color:#000; + +classDef skip fill:#ffffff +classDef index fill:#ffffff,stroke-width:0px + +class s1,s2,s3,s4,s5,s7,s8,s9,s10 index +class s11,s12,s13,s14,s15,s16,s17,s18,s19,s20 index +class s21,s22,s24,s25,s26,s27,s28,s29 index + +class n1,n2,n3,n4,n5,n6,n7,n9,n10 index +class n11,n12,n13,n14,n15,n16,n17,n18,n19,n20 index +class n22,n23,n24,n25,n26,n27,n28,n29 index + +class t1,t2,t4,t5,t6,t7,t8,t10 index +class t11,t12,t13,t15,t16,t17,t18,t19,t20 index +class t21,t22,t23,t24,t25,t26,t27,t28,t29 index + +class e1,e2,e4,e6,e7,e8,e9,e10 index +class e11,e12,e13,e14,e15,e16,e17,e18,e19,e20 index +class e22,e23,e24,e25,e26,e27,e28,e29 index + +class l2,l3,l4,l5,l6,l7,l8,l9 index +class l11,l12,l13,l14,l15,l16,l17,l19,l20 index +class l21,l22,l23,l24,l25,l26,l27,l28,l29 index + +class g1,g2,g3,g4,g5,g6,g7,g8,g9,g10 index +class g11,g12,g13,g14,g15,g16,g17,g18,g19,g20 index +class g21,g22,g23,g24,g25,g26,g27,g28 index + +class c1,c2,c3,c4,c5,c6,c7,c8,c9,c10 index +class c11,c12,c13,c14,c15,c16,c17,c18,c19,c20 index +class c21,c22,c23,c24,c25,c26,c27,c28 index + +class sp1,sp2,sp5,sp6,sp7,sp8,sp9,sp10 index +class sp11,sp12,sp13,sp14,sp15,sp16,sp17,sp18,sp19,sp20 index +class sp21,sp23,sp24,sp25,sp26,sp27,sp28,sp29 index + +class b1,b2,b3,b4,b5,b6,b7,b8,b9,b10 index +class b11,b12,b13,b14,b15,b16,b17,b18,b19,b20 index +class b21,b22,b23,b24,b25,b26,b27,b28 index + + +class i1,i2,i3,i4,i5,i6,i7,i8,i9,i10 index +class i11,i12,i13,i14,i15,i16,i17,i18,i19,i20 index +class i21,i22,i23,i24,i25,i26,i27,i28,i29 index + +class j1,j2,j3,j4,j5,j6,j7,j8,j9 index +``` + +## Mathematical Definition + +Let $ID_p$ is [_Partial Interval Distribution_](../partials_and_congenerics/intervals_distribution.md#mathematical-definition) + +Define a _Congeric intervals distributions_ + +### as m-tuple of congeneric intervals distributions + +$CID$ is m-tuple of $ID_c$ _intervals distributions_ + +$$CID = ,$$ + +$$\forall j \in \{1, ..., m\} \exists cid_j \in \{ID_c\}, $$ + +where: + +- $cid_j$​ is called the $j$-th _congeneric intervals distribution_. +- $l := |CID(1)|$ is _length_, $l \in N$ +- $m := |CID|$ is _power_, $m \in N$ + +### as matrix (m,l) + +$CID$ is (m,l) matrix of $\{0,..,, l\}$ + +$$ +CID = +\begin{pmatrix} +cid_{1,1} & cid_{1,2} & \cdots & cid_{1,l} \\ +cid_{2,1} & cid_{2,2} & \cdots & cid_{2,l} \\ +\vdots & \vdots & \ddots & \vdots \\ +cid_{m,1} & cid_{m,2} & \cdots & cid_{m,l} +\end{pmatrix} +$$ + +$$\forall j \in \{1, ..., m\}, i \in \{1, ..., l\} \exists cid_{j,i} \in \{0,..,, l\}, $$ + +where: + +- $cid_j$​ is called the $j$-th _congeneric intervals distribution_ or $j$-th _row_. +- $cid_{j,i}$​ is called the $i$-th element of $j$-th _congeneric intervals distribution_. +- $l$ is _length_, $l \in N$ +- $m$ is _power_, $m \in N$ + + +### from Congeneric Intervals Chains + +Let $IC_{p}$ is [_Partial Interval Chain_](../partials_and_congenerics/intervals_chain/index.md#define-partial-intervals-chain) + +Let $ID_p$ is [_Partial Intervals distribution_](../partials_and_congenerics/intervals_distribution.md#mathematical-definition) described as function + +$$ID_p : \big\{ IC_p \big\} \longrightarrow \big\{ \{1,...,l\} \longrightarrow N_0 \big\},$$ + +Let $CIC$ is [_Congeneric Intervals Chains_](./intervals_chains.md#as-matrix-ml) - (m,l) matrix of $\{1,...,l\} \cup \{-\}$ + +$$ +CIC = +\begin{pmatrix} +\Delta_{1,1} & \Delta_{1,2} & \cdots & \Delta_{1,l} \\ +\Delta_{2,1} & \Delta_{2,2} & \cdots & \Delta_{2,l} \\ +\vdots & \vdots & \ddots & \vdots \\ +\Delta_{m,1} & \Delta_{m,2} & \cdots & \Delta_{m,l} +\end{pmatrix} +$$ + +Define + +$$congenerics\_intervals\_distributions : \{CIC\} \longrightarrow \{CID\}$$ + +$$congenerics\_intervals\_distributions(CIC)(j)(i) = ID_p(CIC(j))(i) $$ diff --git a/docs/fundamentals/congeneric_decomposition/orders.md b/docs/fundamentals/congeneric_decomposition/orders.md new file mode 100644 index 00000000..f0c980a6 --- /dev/null +++ b/docs/fundamentals/congeneric_decomposition/orders.md @@ -0,0 +1,262 @@ +# Congeneric Orders + +_Congeneric orders_ is a stack of a [_compatible_](../partials_and_congenerics/sequence/index.md#compatibility) [_congeric orders_](../partials_and_congenerics/order/congeneric.md) +that represents [_Order_](../order/order.md) or [_Partial Order_](../partials_and_congenerics/order/index.md). The _congeneric orders_ are sorted in the stack by the first position with a _non-empty_ element in it. + +``` mermaid +block-beta +columns 30 + +space i1["1"] i2["2"] i3["3"] i4["4"] i5["5"] i6["6"] i7["7"] i8["8"] i9["9"] i10["10"] i11["11"] i12["12"] +i13["13"] i14["14"] i15["15"] i16["16"] i17["17"] i18["18"] i19["19"] i20["20"] +i21["21"] i22["22"] i23["23"] i24["24"] i25["25"] i26["26"] i27["27"] +i28["28"] i29["29"] + +j1["1"] s1["1"] s2["-"] s3["-"] s4["-"] s5["-"] s6["-"] s7["1"] s8["-"] s9["-"] s10["-"] +s11["-"] s12["-"] s13["-"] s14["-"] s15["-"] s16["-"] s17["-"] s18["-"] s19["-"] s20["-"] +s21["-"] s22["-"] s23["-"] s24["-"] s25["-"] s26["-"] s27["-"] s28["-"] s29["-"] + +j2["2"] n1["-"] n2["1"] n3["-"] n4["-"] n5["-"] n6["-"] n7["-"] n8["-"] n9["-"] n10["1"] +n11["-"] n12["-"] n13["-"] n14["-"] n15["-"] n16["-"] n17["-"] n18["-"] n19["-"] n20["-"] +n21["-"] n22["-"] n23["-"] n24["-"] n25["-"] n26["-"] n27["-"] n28["-"] n29["-"] + +j3["3"] t1["-"] t2["-"] t3["1"] t4["-"] t5["-"] t6["-"] t7["-"] t8["-"] t9["-"] t10["-"] +t11["-"] t12["-"] t13["-"] t14["-"] t15["-"] t16["-"] t17["1"] t18["-"] t19["-"] t20["-"] +t21["-"] t22["-"] t23["-"] t24["-"] t25["-"] t26["1"] t27["-"] t28["-"] t29["1"] + +j4["4"] e1["-"] e2["-"] e3["-"] e4["1"] e5["-"] e6["-"] e7["-"] e8["-"] e9["1"] e10["-"] +e11["-"] e12["1"] e13["-"] e14["-"] e15["-"] e16["-"] e17["-"] e18["-"] e19["-"] e20["-"] +e21["-"] e22["-"] e23["-"] e24["-"] e25["-"] e26["-"] e27["-"] e28["-"] e29["-"] + +j5["5"] l1["-"] l2["-"] l3["-"] l4["-"] l5["1"] l6["1"] l7["-"] l8["-"] l9["-"] l10["-"] +l11["-"] l12["-"] l13["-"] l14["-"] l15["-"] l16["-"] l17["-"] l18["-"] l19["-"] l20["-"] +l21["-"] l22["-"] l23["-"] l24["1"] l25["-"] l26["-"] l27["-"] l28["-"] l29["-"] + +j6["6"] g1["-"] g2["-"] g3["-"] g4["-"] g5["-"] g6["-"] g7["-"] g8["1"] g9["-"] g10["-"] +g11["-"] g12["-"] g13["-"] g14["-"] g15["-"] g16["-"] g17["-"] g18["-"] g19["-"] g20["-"] +g21["-"] g22["-"] g23["-"] g24["-"] g25["-"] g26["-"] g27["-"] g28["-"] g29["-"] + +j7["7"] c1["-"] c2["-"] c3["-"] c4["-"] c5["-"] c6["-"] c7["-"] c8["-"] c9["-"] c10["-"] +c11["1"] c12["-"] c13["-"] c14["-"] c15["-"] c16["-"] c17["-"] c18["-"] c19["-"] c20["-"] +c21["-"] c22["-"] c23["-"] c24["-"] c25["-"] c26["-"] c27["-"] c28["-"] c29["-"] + +j8["8"] sp1["-"] sp2["-"] sp3["-"] sp4["-"] sp5["-"] sp6["-"] sp7["-"] sp8["-"] sp9["-"] sp10["-"] +sp11["-"] sp12["-"] sp13["1"] sp14["-"] sp15["-"] sp16["1"] sp17["-"] sp18["-"] sp19["-"] sp20["1"] +sp21["-"] sp22["-"] sp23["-"] sp24["-"] sp25["-"] sp26["-"] sp27["-"] sp28["-"] sp29["-"] + +j9["9"] b1["-"] b2["-"] b3["-"] b4["-"] b5["-"] b6["-"] b7["-"] b8["-"] b9["-"] b10["-"] +b11["-"] b12["-"] b13["-"] b14["-"] b15["-"] b16["-"] b17["-"] b18["-"] b19["-"] b20["-"] +b21["-"] b22["1"] b23["-"] b24["-"] b25["-"] b26["-"] b27["-"] b28["-"] b29["-"] + + +classDef c1 fill:#ff7f0e,color:#fff; +classDef c2 fill:#ffbb78,color:#000; +classDef c3 fill:#2ca02c,color:#fff; +classDef c4 fill:#98df8a,color:#000; +classDef c5 fill:#d62728,color:#fff; +classDef c6 fill:#ff9896,color:#000; +classDef c7 fill:#9467bd,color:#fff; +classDef c8 fill:#c5b0d5,color:#000; +classDef c9 fill:#8c564b,color:#fff; +classDef c10 fill:#c49c94,color:#000; +classDef c11 fill:#e377c2,color:#fff; +classDef c12 fill:#f7b6d2,color:#000; +classDef c13 fill:#bcbd22,color:#fff; +classDef c14 fill:#dbdb8d,color:#000; +classDef c15 fill:#17becf,color:#fff; +classDef c16 fill:#9edae5,color:#000; + +classDef skip fill:#ffffff +classDef index fill:#ffffff,stroke-width:0px + +class s2,s3,s4,s5,s6,s8,s9,s10 index +class s11,s12,s13,s14,s15,s16,s17,s18,s19,s20 index +class s21,s22,s23,s24,s25,s26,s27,s28,s29 index + +class n1,n3,n4,n5,n6,n7,n8,n9 index +class n11,n12,n13,n14,n15,n16,n17,n18,n19,n20 index +class n21,n22,n23,n24,n25,n26,n27,n28,n29 index + +class t1,t2,t4,t5,t6,t7,t8,t9,t10 index +class t11,t12,t13,t14,t15,t16,t18,t19,t20 index +class t21,t22,t23,t24,t25,t27,t28 index + +class e1,e2,e3,e5,e6,e7,e8,e10 index +class e11,e13,e14,e15,e16,e17,e18,e19,e20 index +class e21,e22,e23,e24,e25,e26,e27,e28,e29 index + +class l1,l2,l3,l4,l7,l8,l9,l10 index +class l11,l12,l13,l14,l15,l16,l17,l18,l19,l20 index +class l21,l22,l23,l25,l26,l27,l28,l29 index + +class g1,g2,g3,g4,g5,g6,g7,g9,g10 index +class g11,g12,g13,g14,g15,g16,g17,g18,g19,g20 index +class g21,g22,g23,g24,g25,g26,g27,g28,g29 index + +class c1,c2,c3,c4,c5,c6,c7,c8,c9,c10 index +class c12,c13,c14,c15,c16,c17,c18,c19,c20 index +class c21,c22,c23,c24,c25,c26,c27,c28,c29 index + +class sp1,sp2,sp3,sp4,sp5,sp6,sp7,sp8,sp9,sp10 index +class sp11,sp12,sp14,sp15,sp17,sp18,sp19 index +class sp21,sp22,sp23,sp24,sp25,sp26,sp27,sp28,sp29 index + +class b1,b2,b3,b4,b5,b6,b7,b8,b9,b10 index +class b11,b12,b13,b14,b15,b16,b17,b18,b19,b20 index +class b21,b23,b24,b25,b26,b27,b28,b29 index + + +class i1,i2,i3,i4,i5,i6,i7,i8,i9,i10 index +class i11,i12,i13,i14,i15,i16,i17,i18,i19,i20 index +class i21,i22,i23,i24,i25,i26,i27,i28,i29 index + +class j1,j2,j3,j4,j5,j6,j7,j8,j9 index +``` + +## Mathematical Definition + +Let $X_{-}$ is [_Partial Carrier set_](../partials_and_congenerics/carrier_set.md#mathematical-definition) + +Let $O_{c}$ is [_Congeneric Order_](../partials_and_congenerics/order/congeneric.md#mathematical-definition) + +Define a _Congeric orders_ + +### as m-tuple of congeneric order + +Let $compatible(O1_c, O2_c)$ is [_compatibility of Partial Sequences function_](../partials_and_congenerics/sequence/index.md#compatibility) + +$CO$ is m-tuple of $O_c$ orders + +$$CO = ,$$ + +$$\forall j \in \{1, ..., m\} \exists co_j \in \{O_c\}, $$ + +all _congeneric orders_ are _compatible_ + +$$compatible(CO(k), CO(j)) \bigg| \forall k,j \in \{1, ..., m\}, k \ne j,$$ + +and sorted by first apperance of _non-empty_ element + +$$\forall k > j \in \{1,...,m\},\ x < i \in \{1,...,l\}, CO(k)(x) \ne 1 \bigg| CO(j)(i) = 1 \land CO(j)(x) \ne 1$$ + +where: + +- $co_j$​ is called the $j$-th _congeneric order_. +- $l := |CO(1)|$ is _length_, $l \in N$ +- $m := |CO|$ is _power_, $m \in N$ + +### as matrix (m,l) + +$CO$ is (m,l) matrix of $\{-, 1\}$ + +$$ +C0 = +\begin{pmatrix} +co_{1,1} & co_{1,2} & \cdots & co_{1,l} \\ +co_{2,1} & co_{2,2} & \cdots & co_{2,l} \\ +\vdots & \vdots & \ddots & \vdots \\ +co_{m,1} & co_{m,2} & \cdots & co_{m,l} +\end{pmatrix} +$$ + +$$\forall j \in \{1, ..., m\}, i \in \{1, ..., l\} \exists co_{j,i} \in \{-, 1\}, $$ + +columns are _compatible_ + +$$\ co_{k,i} \ne 1 \big | \forall i \in \{1,...,l\}, \forall j \in \{1,...,m\}, \forall k \ne j,\ co_{j,i} = 1 $$ + +and sorted by first apperance of _non-empty_ element + +$$\forall k > j \in \{1,...,m\},\ x < i \in \{1,...,l\}, co_{k,x} \ne 1 \bigg| co_{j,i} = 1 \land co_{j,x} \ne 1$$ + +where: + +- $co_j$​ is called the $j$-th _congeneric order or $j$-th _row_. +- $co_{j,i}$​ is called the $i$-th element of $j$-th _congeneric order_. +- $l$ is _length_, $l \in N$ +- $m$ is _power_, $m \in N$ + +### from Order + +Let $O_p$ is [_Partial Order_](../partials_and_congenerics/order/index.md#mathematical-definition) defined as function + +$$O_p : \{1,...,l\} \longrightarrow \{1,...,l\} \cup \{-\}$$ + +$$alphabet_p : \big\{\{1,...,l\} \longrightarrow X_{-} \big\} \longrightarrow \big\{\{1,...,m\} \longrightarrow X \big\}$$ + +Define + +$$congenerics\_orders : \{O_p\} \longrightarrow \{CO\}$$ + +$$ +congenerics\_orders(O_p)(j)(i) = \Bigg\{\begin{array}{l} + 1 & O_p(i)=j \\ + -, & O_p(i) \in \{-\} \lor O_p(i) \ne j +\end{array} +$$ + +$$\exists congenerics\_orders^{-1} : \{CO\} \longrightarrow \{S_p\},$$ + +$$ +congenerics\_orders^{-1}(CO)(i) = \Bigg\{\begin{array}{l} + j, & \exists j \in \{1,...,m\}, CS(j)(i) = 1 \\ + -, & otherwise +\end{array} +$$ + +### from Congeneric Sequences + +Let $CS$ is [_Congeneric Sequences_](./sequences.md#mathematical-definition) - (m,l) matrix of $X_{-}$ + +$$ +CS = +\begin{pmatrix} +cs_{1,1} & cs_{1,2} & \cdots & cs_{1,l} \\ +cs_{2,1} & cs_{2,2} & \cdots & cs_{2,l} \\ +\vdots & \vdots & \ddots & \vdots \\ +cs_{m,1} & cs_{m,2} & \cdots & cs_{m,l} +\end{pmatrix} +$$ + +Define + +$$congenerics\_orders : \{CS\} \longrightarrow \{CO\}$$ + +$$congenerics\_orders(CS)(j)(i) = \Bigg\{\begin{array}{l} + 1, & CS(i) \notin \{-\} \\ + -, & CS(i) \in \{-\} +\end{array}$$ + +$$\exists congenerics\_orders^{-1} : \{CO\} \longrightarrow \{CS\},$$ + +$$congenerics\_orders^{-1}(CO)(i) = \Bigg\{\begin{array}{l} + j, & \exists j \in \{1,...,m\}, CO(j)(i) = 1 \\ + -, & otherwise +\end{array}$$ + +### Congeneric Orders product Alphabet + +Let $X_{-}$ is a [_Parial carrier set_](../partials_and_congenerics/carrier_set.md#mathematical-definition) + +Let $A$ is a [_Aphabet_](./alphabet.md) $A : \{1, ..., m\} \longrightarrow X,$ + +Let $alphabet_p$ is [_Alphabet of Partial Sequence function_](../partials_and_congenerics/alphabet/index.md#mathematical-definition) + +$$alphabet_p : \big\{\{1,...,l\} \longrightarrow X_{-} \big\} \longrightarrow \big\{\{1,...,m\} \longrightarrow X \big\}$$ + +Let $CS$ is a [_Congeneric Sequeneces_](./sequences.md#mathematical-definition) + +the following equations are true + +$$CO = congenerics\_orders(CS),$$ + +$$A = alphabet_p(CS),$$ + +$$CS = ( CO \odot A ),$$ + +$$ +CS(j)(i) = \Bigg\{\begin{array}{l} + A(j), & \exists j \in \{1,...,m\}, CO(j)(i) = 1 \\ + -, & otherwise +\end{array} +$$ diff --git a/docs/fundamentals/congeneric_decomposition/sequences.md b/docs/fundamentals/congeneric_decomposition/sequences.md new file mode 100644 index 00000000..fe9f3a4e --- /dev/null +++ b/docs/fundamentals/congeneric_decomposition/sequences.md @@ -0,0 +1,199 @@ +# Congeneric Sequences + +_Congeneric sequences_ is a stack of a [_compatible_](../partials_and_congenerics/sequence/index.md#compatibility) [_congeric sequnces_](../partials_and_congenerics/sequence/congeneric.md) +that represents [_Sequence_](../order/sequence.md) or [_Partial Sequence_](../partials_and_congenerics/sequence/index.md). The _congeneric sequnces_ are ordered in the stack by the first position with a _non-empty_ element in it. + +``` mermaid +block-beta +columns 30 + +space i1["1"] i2["2"] i3["3"] i4["4"] i5["5"] i6["6"] i7["7"] i8["8"] i9["9"] i10["10"] i11["11"] i12["12"] +i13["13"] i14["14"] i15["15"] i16["16"] i17["17"] i18["18"] i19["19"] i20["20"] +i21["21"] i22["22"] i23["23"] i24["24"] i25["25"] i26["26"] i27["27"] +i28["28"] i29["29"] + +j1["1"] s1["I"] s2["-"] s3["-"] s4["-"] s5["-"] s6["-"] s7["I"] s8["-"] s9["-"] s10["-"] +s11["-"] s12["-"] s13["-"] s14["-"] s15["-"] s16["-"] s17["-"] s18["-"] s19["-"] s20["-"] +s21["-"] s22["-"] s23["-"] s24["-"] s25["-"] s26["-"] s27["-"] s28["-"] s29["-"] + +j2["2"] n1["-"] n2["N"] n3["-"] n4["-"] n5["-"] n6["-"] n7["-"] n8["-"] n9["-"] n10["N"] +n11["-"] n12["-"] n13["-"] n14["-"] n15["-"] n16["-"] n17["-"] n18["-"] n19["-"] n20["-"] +n21["-"] n22["-"] n23["-"] n24["-"] n25["-"] n26["-"] n27["-"] n28["-"] n29["-"] + +j3["3"] t1["-"] t2["-"] t3["T"] t4["-"] t5["-"] t6["-"] t7["-"] t8["-"] t9["-"] t10["-"] +t11["-"] t12["-"] t13["-"] t14["-"] t15["-"] t16["-"] t17["T"] t18["-"] t19["-"] t20["-"] +t21["-"] t22["-"] t23["-"] t24["-"] t25["-"] t26["T"] t27["-"] t28["-"] t29["T"] + +j4["4"] e1["-"] e2["-"] e3["-"] e4["E"] e5["-"] e6["-"] e7["-"] e8["-"] e9["E"] e10["-"] +e11["-"] e12["E"] e13["-"] e14["-"] e15["-"] e16["-"] e17["-"] e18["-"] e19["-"] e20["-"] +e21["-"] e22["-"] e23["-"] e24["-"] e25["-"] e26["-"] e27["-"] e28["-"] e29["-"] + +j5["5"] l1["-"] l2["-"] l3["-"] l4["-"] l5["L"] l6["L"] l7["-"] l8["-"] l9["-"] l10["-"] +l11["-"] l12["-"] l13["-"] l14["-"] l15["-"] l16["-"] l17["-"] l18["-"] l19["-"] l20["-"] +l21["-"] l22["-"] l23["-"] l24["L"] l25["-"] l26["-"] l27["-"] l28["-"] l29["-"] + +j6["6"] g1["-"] g2["-"] g3["-"] g4["-"] g5["-"] g6["-"] g7["-"] g8["G"] g9["-"] g10["-"] +g11["-"] g12["-"] g13["-"] g14["-"] g15["-"] g16["-"] g17["-"] g18["-"] g19["-"] g20["-"] +g21["-"] g22["-"] g23["-"] g24["-"] g25["-"] g26["-"] g27["-"] g28["-"] g29["-"] + +j7["7"] c1["-"] c2["-"] c3["-"] c4["-"] c5["-"] c6["-"] c7["-"] c8["-"] c9["-"] c10["-"] +c11["C"] c12["-"] c13["-"] c14["-"] c15["-"] c16["-"] c17["-"] c18["-"] c19["-"] c20["-"] +c21["-"] c22["-"] c23["-"] c24["-"] c25["-"] c26["-"] c27["-"] c28["-"] c29["-"] + +j8["8"] sp1["-"] sp2["-"] sp3["-"] sp4["-"] sp5["-"] sp6["-"] sp7["-"] sp8["-"] sp9["-"] sp10["-"] +sp11["-"] sp12["-"] sp13[" "] sp14["-"] sp15["-"] sp16[" "] sp17["-"] sp18["-"] sp19["-"] sp20[" "] +sp21["-"] sp22["-"] sp23["-"] sp24["-"] sp25["-"] sp26["-"] sp27["-"] sp28["-"] sp29["-"] + +j9["9"] b1["-"] b2["-"] b3["-"] b4["-"] b5["-"] b6["-"] b7["-"] b8["-"] b9["-"] b10["-"] +b11["-"] b12["-"] b13["-"] b14["-"] b15["-"] b16["-"] b17["-"] b18["-"] b19["-"] b20["-"] +b21["-"] b22["B"] b23["-"] b24["-"] b25["-"] b26["-"] b27["-"] b28["-"] b29["-"] + + +classDef c1 fill:#ff7f0e,color:#fff; +classDef c2 fill:#ffbb78,color:#000; +classDef c3 fill:#2ca02c,color:#fff; +classDef c4 fill:#98df8a,color:#000; +classDef c5 fill:#d62728,color:#fff; +classDef c6 fill:#ff9896,color:#000; +classDef c7 fill:#9467bd,color:#fff; +classDef c8 fill:#c5b0d5,color:#000; +classDef c9 fill:#8c564b,color:#fff; +classDef c10 fill:#c49c94,color:#000; +classDef c11 fill:#e377c2,color:#fff; +classDef c12 fill:#f7b6d2,color:#000; +classDef c13 fill:#bcbd22,color:#fff; +classDef c14 fill:#dbdb8d,color:#000; +classDef c15 fill:#17becf,color:#fff; +classDef c16 fill:#9edae5,color:#000; + +classDef skip fill:#ffffff +classDef index fill:#ffffff,stroke-width:0px + +class s2,s3,s4,s5,s6,s8,s9,s10 index +class s11,s12,s13,s14,s15,s16,s17,s18,s19,s20 index +class s21,s22,s23,s24,s25,s26,s27,s28,s29 index + +class n1,n3,n4,n5,n6,n7,n8,n9 index +class n11,n12,n13,n14,n15,n16,n17,n18,n19,n20 index +class n21,n22,n23,n24,n25,n26,n27,n28,n29 index + +class t1,t2,t4,t5,t6,t7,t8,t9,t10 index +class t11,t12,t13,t14,t15,t16,t18,t19,t20 index +class t21,t22,t23,t24,t25,t27,t28 index + +class e1,e2,e3,e5,e6,e7,e8,e10 index +class e11,e13,e14,e15,e16,e17,e18,e19,e20 index +class e21,e22,e23,e24,e25,e26,e27,e28,e29 index + +class l1,l2,l3,l4,l7,l8,l9,l10 index +class l11,l12,l13,l14,l15,l16,l17,l18,l19,l20 index +class l21,l22,l23,l25,l26,l27,l28,l29 index + +class g1,g2,g3,g4,g5,g6,g7,g9,g10 index +class g11,g12,g13,g14,g15,g16,g17,g18,g19,g20 index +class g21,g22,g23,g24,g25,g26,g27,g28,g29 index + +class c1,c2,c3,c4,c5,c6,c7,c8,c9,c10 index +class c12,c13,c14,c15,c16,c17,c18,c19,c20 index +class c21,c22,c23,c24,c25,c26,c27,c28,c29 index + +class sp1,sp2,sp3,sp4,sp5,sp6,sp7,sp8,sp9,sp10 index +class sp11,sp12,sp14,sp15,sp17,sp18,sp19 index +class sp21,sp22,sp23,sp24,sp25,sp26,sp27,sp28,sp29 index + +class b1,b2,b3,b4,b5,b6,b7,b8,b9,b10 index +class b11,b12,b13,b14,b15,b16,b17,b18,b19,b20 index +class b21,b23,b24,b25,b26,b27,b28,b29 index + + +class i1,i2,i3,i4,i5,i6,i7,i8,i9,i10 index +class i11,i12,i13,i14,i15,i16,i17,i18,i19,i20 index +class i21,i22,i23,i24,i25,i26,i27,i28,i29 index + +class j1,j2,j3,j4,j5,j6,j7,j8,j9 index +``` + +## Mathematical Definition + +Let $X_{-}$ is [_Partial Carrier set_](../partials_and_congenerics/carrier_set.md#mathematical-definition) + +Let $S_{c}$ is [_Congeneric Sequence_](../partials_and_congenerics/sequence/congeneric.md#mathematical-definition) + +Define a _Congeric sequences_ + +### as m-tuple of congeneric sequences + +Let $compatible(S1_c, S2_c)$ is [_compatibility of Partial Sequences function_](../partials_and_congenerics/sequence/index.md#compatibility) + +$CS$ is m-tuple of $S_c$ sequences + +$$CS = ,$$ + +$$\forall j \in \{1, ..., m\} \exists cs_j \in \{S_c\}, $$ + +all _congeneric sequences_ are _compatible_ + +$$compatible(CS(k), CS(j)) \bigg| \forall k,j \in \{1, ..., m\}, k \ne j,$$ + +and sorted by first apperance of _non-empty_ element + +$$\forall k > j \in \{1,...,m\},\ x < i \in \{1,...,l\}, CS(k)(x) \in \{-\} \bigg| CS(j)(i) \notin \{-\} \land CS(j)(x) \in \{-\}$$ + +where: + +- $cs_j$​ is called the $j$-th _congeneric sequence_. +- $l := |CS(1)|$ is _length_, $l \in N$ +- $m := |CS|$ is _power_, $m \in N$ + +### as matrix (m,l) + +$CS$ is (m,l) matrix of $X_{-}$ + +$$ +CS = +\begin{pmatrix} +cs_{1,1} & cs_{1,2} & \cdots & cs_{1,l} \\ +cs_{2,1} & cs_{2,2} & \cdots & cs_{2,l} \\ +\vdots & \vdots & \ddots & \vdots \\ +cs_{m,1} & cs_{m,2} & \cdots & cs_{m,l} +\end{pmatrix} +$$ + +$$\forall j \in \{1, ..., m\}, i \in \{1, ..., l\} \exists cs_{j,i} \in X_{-}, $$ + +columns are _compatible_ + +$$\ cs_{k,i} \in \{-\} \big | \forall i \in \{1,...,l\}, \forall j \in \{1,...,m\}, \forall k \ne j,\ cs_{j,i} \notin \{-\} $$ + +and sorted by first apperance of _non-empty_ element + +$$\forall k > j \in \{1,...,m\},\ x < i \in \{1,...,l\}, cs_{k,x} \in \{-\} \bigg| cs_{j,i} \notin \{-\} \land cs_{j,x} \in \{-\}$$ + +where: + +- $cs_j$​ is called the $j$-th _congeneric sequence_ or $j$-th _row_. +- $cs_{j,i}$​ is called the $i$-th element of $j$-th _congeneric sequence_. +- $l$ is _length_, $l \in N$ +- $m$ is _power_, $m \in N$ + +### from Sequence + +Let $alphabet_p$ is [_Alphabet of Partial Sequence function_](../partials_and_congenerics/alphabet/index.md#mathematical-definition) + +$$alphabet_p : \big\{\{1,...,l\} \longrightarrow X_{-} \big\} \longrightarrow \big\{\{1,...,m\} \longrightarrow X \big\}$$ + +Define + +$$congenerics : \{S_p\} \longrightarrow \{CS\}$$ + +$$congenerics(S_p)(j)(i) = \Bigg\{\begin{array}{l} + S_p(i), & S_p(i)=alphabet_p(S_p)(j) \\ + -, & S_p(i) \in \{-\} \lor S_p(i) \ne alphabet_p(S_p)(j) +\end{array}$$. + +$$\exists congenerics^{-1} : \{CS\} \longrightarrow \{S_p\},$$ + +$$congenerics^{-1}(CS)(i) = \Bigg\{\begin{array}{l} + CS(j)(i), & \exists j \in \{1,...,m\}, CS(j)(i) \notin \{-\} \\ + -, & otherwise +\end{array}$$ diff --git a/docs/fundamentals/index.md b/docs/fundamentals/index.md index 5b67ea5f..ab806b84 100644 --- a/docs/fundamentals/index.md +++ b/docs/fundamentals/index.md @@ -1,3 +1,13 @@ # Fundamentals -Coming soon +Welcome to the Fundamentals section. Here, we introduce the core concepts and mathematical tools that underpin the Formal Order Analysis of sequences and their structure. + +- [**Ideas**](./ideas/index.md): This section explores the foundational ideas, motivations, and principles behind Formal Order Analysis. + +- [**Order and its measures**](./order/index.md): Learn about the concept of an Order in sequences, including how to quantify and characterize order using measures such as arithmetic mean, geometric mean, and related _interval-based_ characteristics. + +- [**Partials and Congenerics**](./partials_and_congenerics/index.md): Discover conceptions of _Partial_ and _Congeneric_ sequences, its Order and other derivatives. + +- [**Congeneric Decomposition**](./congeneric_decomposition/index.md): This section details the process and significance of breaking down sequences into congeneric components, providing a framework and measures for deeper structural analysis. + +Each section builds on the previous, providing a comprehensive foundation for understanding and applying formal order analysis to a wide range of problems. diff --git a/docs/fundamentals/partials_and_congenerics/intervals_chain/congeneric.md b/docs/fundamentals/partials_and_congenerics/intervals_chain/congeneric.md index e1ca3d91..20dd17eb 100644 --- a/docs/fundamentals/partials_and_congenerics/intervals_chain/congeneric.md +++ b/docs/fundamentals/partials_and_congenerics/intervals_chain/congeneric.md @@ -8,7 +8,7 @@ columns 29 i1["1"] i2["2"] i3["3"] i4["4"] i5["5"] i6["6"] i7["7"] i8["8"] i9["9"] i10["10"] i11["11"] i12["12"] i13["13"] i14["14"] i15["15"] i16["16"] i17["17"] i18["18"] i19["19"] i20["20"] -i21["21"] i22["12"] i23["23"] i24["24"] i25["25"] i26["26"] i27["27"] +i21["21"] i22["22"] i23["23"] i24["24"] i25["25"] i26["26"] i27["27"] i28["28"] i29["29"] s1["-"] s2["-"] s3["3"] s4["-"] s5["-"] s6["-"] s7["-"] s8["-"] s9["-"] s10["-"] diff --git a/docs/fundamentals/partials_and_congenerics/intervals_chain/index.md b/docs/fundamentals/partials_and_congenerics/intervals_chain/index.md index d54df1a7..e8e1615e 100644 --- a/docs/fundamentals/partials_and_congenerics/intervals_chain/index.md +++ b/docs/fundamentals/partials_and_congenerics/intervals_chain/index.md @@ -456,6 +456,10 @@ Let $Binding = $ is [_Binding_](../../order/intervals_chain/inde Let $R : \{1,...,l\} \longrightarrow \{1,...,l\} \cup \bot,$ is a corresponding [_references_](../../order/intervals_chain/index.md#define-bindings) +Let $Intervals$ is [_Intervals function_](../../order/intervals_chain/index.md#define-intervals-chain) described as function + +$$Intervals : \big\{Binding\big\} \times \big\{S\} \longrightarrow \big\{ IC \big\}$$ + Then _Iterator_ defined as $Iterator \big\{ S \big\} \longrightarrow \big\{ R \big\},$ ### Define Partial Bindings diff --git a/docs/fundamentals/partials_and_congenerics/order/congeneric.md b/docs/fundamentals/partials_and_congenerics/order/congeneric.md index 4c6101cb..cd808b87 100644 --- a/docs/fundamentals/partials_and_congenerics/order/congeneric.md +++ b/docs/fundamentals/partials_and_congenerics/order/congeneric.md @@ -9,7 +9,7 @@ columns 29 i1["1"] i2["2"] i3["3"] i4["4"] i5["5"] i6["6"] i7["7"] i8["8"] i9["9"] i10["10"] i11["11"] i12["12"] i13["13"] i14["14"] i15["15"] i16["16"] i17["17"] i18["18"] i19["19"] i20["20"] -i21["21"] i22["12"] i23["23"] i24["24"] i25["25"] i26["26"] i27["27"] +i21["21"] i22["22"] i23["23"] i24["24"] i25["25"] i26["26"] i27["27"] i28["28"] i29["29"] s1["-"] s2["-"] s3["1"] s4["-"] s5["-"] s6["-"] s7["-"] s8["-"] s9["-"] s10["-"] diff --git a/docs/fundamentals/partials_and_congenerics/order/index.md b/docs/fundamentals/partials_and_congenerics/order/index.md index df605311..fa591d58 100644 --- a/docs/fundamentals/partials_and_congenerics/order/index.md +++ b/docs/fundamentals/partials_and_congenerics/order/index.md @@ -9,7 +9,7 @@ columns 29 i1["1"] i2["2"] i3["3"] i4["4"] i5["5"] i6["6"] i7["7"] i8["8"] i9["9"] i10["10"] i11["11"] i12["12"] i13["13"] i14["14"] i15["15"] i16["16"] i17["17"] i18["18"] i19["19"] i20["20"] -i21["21"] i22["12"] i23["23"] i24["24"] i25["25"] i26["26"] i27["27"] +i21["21"] i22["22"] i23["23"] i24["24"] i25["25"] i26["26"] i27["27"] i28["28"] i29["29"] s1["1"] s2["2"] s3["3"] s4["4"] s5["5"] s6["5"] s7["1"] s8["6"] s9["4"] s10["2"] diff --git a/docs/fundamentals/partials_and_congenerics/sequence/congeneric.md b/docs/fundamentals/partials_and_congenerics/sequence/congeneric.md index 25862abe..5b15982f 100644 --- a/docs/fundamentals/partials_and_congenerics/sequence/congeneric.md +++ b/docs/fundamentals/partials_and_congenerics/sequence/congeneric.md @@ -10,7 +10,7 @@ columns 29 i1["1"] i2["2"] i3["3"] i4["4"] i5["5"] i6["6"] i7["7"] i8["8"] i9["9"] i10["10"] i11["11"] i12["12"] i13["13"] i14["14"] i15["15"] i16["16"] i17["17"] i18["18"] i19["19"] i20["20"] -i21["21"] i22["12"] i23["23"] i24["24"] i25["25"] i26["26"] i27["27"] +i21["21"] i22["22"] i23["23"] i24["24"] i25["25"] i26["26"] i27["27"] i28["28"] i29["29"] s1["-"] s2["-"] s3["T"] s4["-"] s5["-"] s6["-"] s7["-"] s8["-"] s9["-"] s10["-"] diff --git a/docs/fundamentals/partials_and_congenerics/sequence/index.md b/docs/fundamentals/partials_and_congenerics/sequence/index.md index 576705f3..ce53f9ac 100644 --- a/docs/fundamentals/partials_and_congenerics/sequence/index.md +++ b/docs/fundamentals/partials_and_congenerics/sequence/index.md @@ -10,7 +10,7 @@ columns 29 i1["1"] i2["2"] i3["3"] i4["4"] i5["5"] i6["6"] i7["7"] i8["8"] i9["9"] i10["10"] i11["11"] i12["12"] i13["13"] i14["14"] i15["15"] i16["16"] i17["17"] i18["18"] i19["19"] i20["20"] -i21["21"] i22["12"] i23["23"] i24["24"] i25["25"] i26["26"] i27["27"] +i21["21"] i22["22"] i23["23"] i24["24"] i25["25"] i26["26"] i27["27"] i28["28"] i29["29"] s1["I"] s2["N"] s3["T"] s4["E"] s5["L"] s6["L"] s7["I"] s8["G"] s9["E"] s10["N"] diff --git a/mkdocs.yml b/mkdocs.yml index 25ecc017..6608f606 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -51,33 +51,29 @@ nav: - "Characteristics": fundamentals/partials_and_congenerics/characteristics.md - "Congeneric decomposition": - fundamentals/congeneric_decomposition/index.md - - "Congeneric sequences": fundamentals/congeneric_decomposition/congeneric_sequences.md - - "Congeneric orders": fundamentals/congeneric_decomposition/congeneric_orders.md - - "Congeneric intervals order": fundamentals/congeneric_decomposition/congeneric_intervals_order.md - - "Congeneric intervals distribution": fundamentals/congeneric_decomposition/congeneric_intervals_distribution.md + - "Sequences": fundamentals/congeneric_decomposition/sequences.md + - "Alphabet": fundamentals/congeneric_decomposition/alphabet.md + - "Orders": fundamentals/congeneric_decomposition/orders.md + - "Intervals chains": fundamentals/congeneric_decomposition/intervals_chains.md + - "Intervals distribution": fundamentals/congeneric_decomposition/intervals_distribution.md - "Characteristics": - fundamentals/congeneric_decomposition/characteristics/index.md - - "Arithmetic means": fundamentals/congeneric_decomposition/characteristics/arithmetic_mean.md - - "Average remotenesses": fundamentals/congeneric_decomposition/characteristics/average_remoteness.md - - "Depths": fundamentals/congeneric_decomposition/characteristics/depth.md - "Descriptive informations": fundamentals/congeneric_decomposition/characteristics/descriptive_information.md - - "Geometric means": fundamentals/congeneric_decomposition/characteristics/geometric_mean.md - "Identifying information": fundamentals/congeneric_decomposition/characteristics/identifying_information.md - - "Periodicity": fundamentals/congeneric_decomposition/characteristics/periodicity.md + - "Regularity": fundamentals/congeneric_decomposition/characteristics/regularity.md - "Uniformity": fundamentals/congeneric_decomposition/characteristics/uniformity.md - - "Volume": fundamentals/congeneric_decomposition/characteristics/volume.md - - "Connections to other mathfields": - - fundamentals/connections_to_other_mathfields/index.md - - "Information theory": fundamentals/connections_to_other_mathfields/information_theory.md - - "Probability theory": fundamentals/connections_to_other_mathfields/probability_theory.md - - "Statistics": fundamentals/connections_to_other_mathfields/statistics.md - - "Combinatorics": fundamentals/connections_to_other_mathfields/combinatorics.md - - "Applications": - - fundamentals/applications/index.md - - "Text mining": fundamentals/applications/text_mining.md - - "Bioinformatics": fundamentals/applications/bioinformatics.md - - "Music analysis": fundamentals/applications/music_analysis.md - - "Other applications": fundamentals/applications/other_applications.md + # - "Connections to other mathfields": + # - fundamentals/connections_to_other_mathfields/index.md + # - "Information theory": fundamentals/connections_to_other_mathfields/information_theory.md + # - "Probability theory": fundamentals/connections_to_other_mathfields/probability_theory.md + # - "Statistics": fundamentals/connections_to_other_mathfields/statistics.md + # - "Combinatorics": fundamentals/connections_to_other_mathfields/combinatorics.md + # - "Applications": + # - fundamentals/applications/index.md + # - "Text mining": fundamentals/applications/text_mining.md + # - "Bioinformatics": fundamentals/applications/bioinformatics.md + # - "Music analysis": fundamentals/applications/music_analysis.md + # - "Other applications": fundamentals/applications/other_applications.md - "References": - "foapy.alphabet": references/alphabet.md - "foapy.order": references/order.md From ef84278e3fc81e14563b227a8e446074dd40c383 Mon Sep 17 00:00:00 2001 From: Igor Rodionov Date: Mon, 11 Aug 2025 03:13:02 +0200 Subject: [PATCH 34/35] Update initial README --- README.md | 43 +++++++++++++++++++++++++------------------ 1 file changed, 25 insertions(+), 18 deletions(-) diff --git a/README.md b/README.md index bfded412..1fb69753 100644 --- a/README.md +++ b/README.md @@ -1,27 +1,34 @@ - +**foapy** is a Python library for Formal Order Analysis (FOA), providing a comprehensive toolkit for analyzing and characterizing sequences, orders, and their structural properties. The library is designed for researchers, data scientists, and developers interested in symbolic sequence analysis, combinatorics, information theory, and related fields. -[![Project generated with PyScaffold](https://img.shields.io/badge/-PyScaffold-005CA0?logo=pyscaffold)](https://pyscaffold.org/) +## Features -# foapy +- **Alphabets and Orders:** Tools to define and manipulate alphabets, generate and analyze orders, and extract structural information from sequences. +- **Intervals and Chains:** Compute intervals, interval chains, and distributions for sequences, supporting both basic and advanced FOA concepts. +- **Congeneric Decomposition:** Decompose sequences into congeneric components, enabling detailed structural and informational analysis. +- **Mathematical Characteristics:** Calculate a wide range of characteristics, including arithmetic mean, geometric mean, volume, average remoteness, depth, descriptive and identifying information, regularity, and uniformity. +- **Extensive Documentation:** In-depth explanations of mathematical foundations, algorithms, and usage examples. +- **Test Suite:** Comprehensive tests to ensure correctness and reliability. -> Formal order analysis library +## Project Structure -A longer description of your project goes here... +- **Source Code:** [`./src`](./src) + Contains the implementation of all FOA algorithms, data structures, and characteristics. +- **Documentation:** [`./docs`](./docs) + Includes detailed guides, mathematical background, API references, and examples. The documentation is written in Markdown and can be built as a website using MkDocs. +- **Tests:** [`./test`](./test) + Contains unit tests and example-based tests to verify the correctness of the library. +## Documentation - +The documentation in [`./docs`](./docs) covers: -## Note +- **Fundamentals:** Core concepts of formal order analysis, including alphabets, sequences, orders, intervals, and their mathematical properties. +- **Order and Measures:** Detailed descriptions of order-related structures and their characteristics. +- **Congeneric Decomposition:** Step-by-step guides to decomposing sequences and interpreting the results. +- **Mathematical Definitions:** Formal definitions and derivations of all implemented characteristics. +- **API Reference:** Usage and parameter details for all public functions and classes. +- **Development and Benchmarks:** Information on contributing, code coverage, and performance benchmarks. -This project has been set up using PyScaffold 4.5. For details and usage -information on PyScaffold see https://pyscaffold.org/. +To view the documentation as a website, install [MkDocs](https://www.mkdocs.org/) and run: From c7bc03fc4f3d5fc77c780eaba46b14523015e9fa Mon Sep 17 00:00:00 2001 From: Igor Rodionov Date: Mon, 11 Aug 2025 03:19:14 +0200 Subject: [PATCH 35/35] Update initial README --- README.md | 124 +++++++++++++++++++++++++++++++++++++++++++++--------- 1 file changed, 105 insertions(+), 19 deletions(-) diff --git a/README.md b/README.md index 1fb69753..a88f7b49 100644 --- a/README.md +++ b/README.md @@ -1,34 +1,120 @@ # foapy -**foapy** is a Python library for Formal Order Analysis (FOA), providing a comprehensive toolkit for analyzing and characterizing sequences, orders, and their structural properties. The library is designed for researchers, data scientists, and developers interested in symbolic sequence analysis, combinatorics, information theory, and related fields. +Python library for Formal Order Analysis (FOA) of symbolic sequences. + +## What is FOA? + +Formal Order Analysis (FOA) studies the structure of symbolic sequences by: + +- Mapping a sequence to its order and alphabet (the set of unique symbols in order of first appearance). +- Extracting intervals between repeated occurrences of the same symbol under different boundary modes. +- Quantifying structure with characteristics (e.g., arithmetic/geometric means, volume, average remoteness, depth, descriptive/identifying information, regularity, uniformity). + +This enables robust analysis for text, biological sequences, musical motifs, logs, and any categorical time series. ## Features -- **Alphabets and Orders:** Tools to define and manipulate alphabets, generate and analyze orders, and extract structural information from sequences. -- **Intervals and Chains:** Compute intervals, interval chains, and distributions for sequences, supporting both basic and advanced FOA concepts. -- **Congeneric Decomposition:** Decompose sequences into congeneric components, enabling detailed structural and informational analysis. -- **Mathematical Characteristics:** Calculate a wide range of characteristics, including arithmetic mean, geometric mean, volume, average remoteness, depth, descriptive and identifying information, regularity, and uniformity. -- **Extensive Documentation:** In-depth explanations of mathematical foundations, algorithms, and usage examples. -- **Test Suite:** Comprehensive tests to ensure correctness and reliability. +- **Alphabets and Orders:** Define alphabets and compute orders of sequences. +- **Intervals and Chains:** Extract intervals for multiple binding and boundary modes. +- **Congeneric Decomposition:** Decompose sequences into congeneric components. +- **Mathematical Characteristics:** Arithmetic mean, geometric mean, volume, average remoteness, depth, descriptive and identifying information, regularity, uniformity. +- **Masked-array Support:** FOA on partially observed sequences via `foapy.ma`. +- **Extensive Documentation:** Theory, algorithms, and examples. + +## Installation + +- From PyPI: + +```bash +pip install foapy +``` + +- From source (with tox workflows): + +```bash +git clone https://github.com/intervals-mining-lab/foapy.git +cd foapy +python -m pip install --upgrade pip +python -m pip install tox + +# Run tests (isolated env) +tox -e default + +# Build distribution artifacts (sdist and wheel) +tox -e build + +# Optionally clean build artifacts +tox -e clean +``` + +## Quick start + +Compute order, intervals, and a characteristic: + +```python +import foapy + +# 1) Order and alphabet +source = ['a', 'b', 'a', 'c', 'd'] +order = foapy.order(source) +print(order) # [0 1 0 2 3] + +order_arr, alphabet = foapy.order(source, True) +print(order_arr, alphabet) # [0 1 0 2 3] ['a' 'b' 'c' 'd'] + +# 2) Intervals (binding to start, normal mode) +from foapy import binding, mode +intervals = foapy.intervals(['a', 'b', 'a', 'c', 'a', 'd'], binding.start, mode.normal) +print(intervals) # [1 2 2 3 2 5] + +# 3) A characteristic (volume = product of intervals) +val = foapy.characteristics.volume(intervals) +print(val) # 192 +``` + +Masked arrays (optional): + +```python +import numpy as np +import numpy.ma as ma +import foapy + +seq = ma.masked_array(['a', 'b', 'a', 'c', 'd'], mask=[0, 1, 0, 0, 0]) +order_ma = foapy.ma.order(seq) +intervals_grouped = foapy.ma.intervals(order_ma, foapy.binding.start, foapy.mode.normal) +u = foapy.characteristics.uniformity(intervals_grouped) +print(u) +``` ## Project Structure - **Source Code:** [`./src`](./src) - Contains the implementation of all FOA algorithms, data structures, and characteristics. - **Documentation:** [`./docs`](./docs) - Includes detailed guides, mathematical background, API references, and examples. The documentation is written in Markdown and can be built as a website using MkDocs. -- **Tests:** [`./test`](./test) - Contains unit tests and example-based tests to verify the correctness of the library. +- **Tests:** [`./tests`](./tests) ## Documentation -The documentation in [`./docs`](./docs) covers: +Online documentation: [intervals-mining-lab.github.io/foapy](https://intervals-mining-lab.github.io/foapy). + +The documentation in [`./docs`](./docs) covers fundamentals, algorithms, characteristics, applications, and development notes. + +Build and serve the docs locally (via tox): + +```bash +# Build docs into docs/_build +tox -e docs + +# Serve docs with live-reload for development +tox -e docsserve +``` + +## Testing + +Run the test suite (via tox): -- **Fundamentals:** Core concepts of formal order analysis, including alphabets, sequences, orders, intervals, and their mathematical properties. -- **Order and Measures:** Detailed descriptions of order-related structures and their characteristics. -- **Congeneric Decomposition:** Step-by-step guides to decomposing sequences and interpreting the results. -- **Mathematical Definitions:** Formal definitions and derivations of all implemented characteristics. -- **API Reference:** Usage and parameter details for all public functions and classes. -- **Development and Benchmarks:** Information on contributing, code coverage, and performance benchmarks. +```bash +tox -e default -To view the documentation as a website, install [MkDocs](https://www.mkdocs.org/) and run: +# Pass arguments to pytest after --, e.g. run a subset: +tox -e default -- -k order -q +```