Differences
This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision | ||
lfa:2025:lab01 [2025/10/05 23:39] tpruteanu |
lfa:2025:lab01 [2025/10/07 12:02] (current) tpruteanu |
||
---|---|---|---|
Line 37: | Line 37: | ||
**2.1.3.** The language of binary words which contain **exactly** two ones. | **2.1.3.** The language of binary words which contain **exactly** two ones. | ||
- | |||
/*<hidden> | /*<hidden> | ||
Line 50: | Line 49: | ||
**2.1.4.** (*) The language of words which encode binary numbers divisible by 3. | **2.1.4.** (*) The language of words which encode binary numbers divisible by 3. | ||
- | **2.1.5.** (* *) The language of words which encode binary numbers divisible by 3, represent in reverse order (the least significant digit is first). | + | **2.1.5.** (* *) The language of words which encode binary numbers divisible by 3, represented in reverse order (the least significant digit is first). |
**2.1.6.** (*) The language of quaternary words (base 4), that follow the rule that every zero is immediately followed by a sequence of at least 2 consecutive threes and every one is immediately followed by a sequence of at most 2 consecutive twos. | **2.1.6.** (*) The language of quaternary words (base 4), that follow the rule that every zero is immediately followed by a sequence of at least 2 consecutive threes and every one is immediately followed by a sequence of at most 2 consecutive twos. | ||
- | **2.1.7.** The set of all binary strings having the substring 00101. | + | **2.1.7.** The language of all binary words having the substring 00101. |
/*<hidden> | /*<hidden> | ||
Line 61: | Line 60: | ||
* Analyze how each incoming character changes the current available sequence. For example, if we are in state **E** and we read character **1** we reach a final state, but if we read **0** we go back to state **C** since the available seq will be **00** | * Analyze how each incoming character changes the current available sequence. For example, if we are in state **E** and we read character **1** we reach a final state, but if we read **0** we go back to state **C** since the available seq will be **00** | ||
</hidden>*/ | </hidden>*/ | ||
+ | |||
+ | **2.1.8.** The language of binary words that start and end with different digits. | ||
/*<hidden> | /*<hidden> | ||
Line 78: | Line 79: | ||
**2.2.1** | **2.2.1** | ||
+ | |||
+ | {{:lfa:2024:lab1-2_2_2.png?300|}} | ||
+ | /* Cel puțin un grup de: 0 urmat de un număr impar de 1-uri urmat de un număr par de 0-uri */ | ||
+ | |||
+ | **2.2.2** | ||
{{:lfa:2024:lab1-2_2_1.png?500|}} | {{:lfa:2024:lab1-2_2_1.png?500|}} | ||
/* Cuvinte nevide în care după un grup de 0-uri consecutive urmează fie nimic, fie un număr impar de 1-uri consecutive, | /* Cuvinte nevide în care după un grup de 0-uri consecutive urmează fie nimic, fie un număr impar de 1-uri consecutive, | ||
și după un grup consecutiv de 1-uri urmează fie nimic, fie un număr par de 0-uri consecutive */ | și după un grup consecutiv de 1-uri urmează fie nimic, fie un număr par de 0-uri consecutive */ | ||
- | |||
- | **2.2.2** | ||
- | |||
- | {{:lfa:2024:lab1-2_2_2.png?300|}} | ||
- | /* Cel puțin un grup de: 0 urmat de un număr impar de 1-uri urmat de un număr par de 0-uri */ | ||
**2.2.3** | **2.2.3** | ||
Line 110: | Line 111: | ||
iar dacă începe cu b. prima secvență este de al doilea tip */ | iar dacă începe cu b. prima secvență este de al doilea tip */ | ||
+ | |||
---- | ---- | ||
+ | **2.3.1** What happens if we switch all final states to non-final states and vice-versa in a DFA? | ||
+ | |||
+ | **2.3.2** Prove that if L(M) is infinite, there has to be some cycle in the states graph, such that there is a path from the initial state to the cycle, and from the cycle to a final state. | ||
+ | |||
+ | **2.3.3** If no such cycle described above exist, L(M) is finite. | ||
+ | |||
+ | **2.3.4** Show that if you can construct a DFA to accept L, than you can also construct a DFA to accept $ L \cup \{a\}, \forall a \in \Sigma $. |