formal languages – Is the empty string and some words of even length are elements of this set?

$L = {w in {a,b}^*| text{the first, the middle, and the last characters of $w$ are identical}}$.

I have my answers, but I need confirmation:

Is the empty string $epsilon in L$? Yes. Reason: there is no first, middle, or last character to break the rule.

Words of even length, assuming the first and last characters of them are identical, again, must be in $L$, as there is no middle character to break the rule in such words.

This is in the context of theory of computation by the way.

formal languages – Shortest unambiguous representation of a graph over an alphabet

I just started reading a book on theoretical computer science and here are a couple of beginner questions about graphs, which I am struggling to answer:

Given the graph with the matrix representation
what is its shortest possible unambiguous representation over the boolean alphabet? How about over any alphabet?

Thank you :]

dnd 5e – How useful are the exotic languages?

Ultimately it will be campaign-dependent; ask your GM for guidance

I suggest that you speak with your GM about what language options will actually be useful (or even available) for the campaign. You can either choose a useful language from that or you could choose a language you want and then work with the GM to make that language useful in the campaign.

Most GMs I have had have detailed what languages will be prevalent in their campaigns to prevent the PCs from choosing a language only for it to be utterly useless all campaign long and the ones that did not do this helped to make my various character and background decisions matter in the campaign, be those languages, skills, or something else entirely.

Here are some useless totals

DnD Beyond allows you to search through monsters and one of the search settings there (under “show advanced filters”) is to sort by languages; using this we can conclude the following (note that 29 monsters know all languages and are included in each one of these totals):

  • 222 know Draconic
  • 164 creatures know Abyssal
  • 147 know Undercommon
  • 133 know Infernal
  • 75 know Sylvan
  • 73 know Deep Speech
  • 42 creatures know Celestial
  • 51 know Primordial which has four mutually intelligible dialects:
    • 64 know Terran
    • 53 know Ignan
    • 57 know Auran
    • 73 know Aquan

Note that this search is not perfect, in fact, far from it; many creatures have variants that are counted as separate monsters (dragons have multiple colors/metals, demons have summoner variants…), nothing is said about the distribution of these monsters (their average CR, or anything similar), overlapping languages are unaddressed (monsters that know multiple languages, especially including common), and a given language’s chance of making an appearance in a campaign is known only to your GM.

Finding a finite automata that accepts a language that is the combination of two other languages with their own automata

I’m told that we have two DFA one A and one B both on alphabet $sum$.

I’m then told to define a DFA (5-tuple representation) with this condition {w | w = $a_i b_i$$a_k b_k$ and all the $a in A$ and all the $b in B$}

Also 1 $leq$ i $leq$ k and $a_i in sum$ and $b_i in sum$.

However I simply do not understand how I’m supposed to do this. Simply put my confusion is what $w = a_i b_i$ mean. Is it concatenation? Does it mean that the word $w$ is the concatenation of a with b?

formal languages – PDA with more than one initial state

PDAs that are allowed to have more than one initial state (let’s call them PDAIs) are computationally equivalent to conventional PDAs:

  • Trivially, every conventional PDA can be considered as a PDAI that happens to have one initial state.
  • Every PDAI can be converted to an equivalent PDA with the process you describe.

So yes, PDAIs accept exactly the context free languages.

How to enumerate an enumerable set of languages?

For some enumerable collection of languages, what are the different ways you can enumerate them? For example, you can enumerate them by the machines that compute them–how do you do this? What are some other ways? Thank you!

formal languages – w is a member of L iff w is a member of L?

A word w is a member of a language L iff it is a member of the language L, ie. the condition of w’s membership to L is that it be a member of L. This is the definition of the language.

Without ahead of time specifically declaring a list of words which are in L–that would then be in L by definition–is this language decidable? Or, do we end up (as suspected), for any machine that decides L, and on any input, in an infinite loop due to the self-reference: we go to check if w is in L and then see that we need to check if w is in L and then see that we need to check if w is in L…ad inf and this language is undecidable?

PS. Is there a name for a language that refers to itself in its definition?

Thank you!

formal languages – How to say if this grammar is LL(1)?

I need some help with understanding if a grammar is $LL(1)$ or not.

S rightarrow AB\
A rightarrow a mid varepsilon \
B rightarrow bCd\
C rightarrow c mid varepsilon

I have computed the first and follow sets and I’ve tried to use $LL(1)$ definition, but I don’t know how to answer it.

Thanks in advance.

Languages A, B ∈ NP-complete such that A⋃B = Σ*

I’m pretty new to complexity theory and it seems like I stuck with this problem. We should find language $B$ such that it accepts any words rejected by $A$ but in that case, it seems that $B$ is a complement of $A$ and therefore $B$ belongs to $coNPC$. What is my mistake? Thank you!

programming languages ​​- Write a MIPS program to convert a 32 bit / magnitude binary sign to complementary numbers of 2 s?

So i have been working on this and this is what i have gotten so far please help me if i did it wrong or I can fix something here Thanks.

$ LC0:
.ascii "Enter the binary value% d bit: 000"
.ascii "Original binary =% s 012 000"
$ LC2:
.ascii "Ones complement =% s 012 000"
.ascii "Two's complement =% s 012 000"
addiu $ sp, $sp, -144
sw $ 31,140 ($sp)
li $ 5.32 # 0x20
him $
4,% hi ($ LC0)
addiu $
4,$ 4,% lo ($LC0)
jal printf

    addiu   $4,$sp,24
    jal     gets

    addiu   $3,$sp,24
    addiu   $2,$sp,60
    addiu   $5,$sp,92
    li      $6,49                 # 0x31
    li      $7,48                 # 0x30
    li      $9,49                 # 0x31
    li      $8,48                 # 0x30

$ L4:
lb $
4.0 ($ 3)
good $
4,$ 6, $L2

    b       $L3
    sb      $8,0($2)

$ L2:
good $
4,$ 7, $L3

    sb      $9,0($2)

$ L3:
addiu $
2,$ 2.1
good $
2,$ 5, $L4
addiu $ 3, $3.1

    sb      $0,92($sp)
    addiu   $4,$sp,91
    addiu   $2,$sp,127
    addiu   $5,$sp,95
    li      $8,1                        # 0x1
    li      $6,49                 # 0x31
    li      $7,48                 # 0x30
    li      $9,1                        # 0x1
    li      $11,49                  # 0x31
    li      $10,48                  # 0x30

$ L8:
lb $
3.0 ($ 4)
good $
3,$ 6, $L5

    bne     $8,$9,$L6

    b       $L7
    sb      $10,0($2)

$ L5:
good $
3,$ 7, $L6

    bne     $8,$9,$L6

    sb      $11,0($2)
    b       $L7
    move    $8,$0

$ L6:
sb $
3.0 ($ 2)
addiu $ 2, $2, -1
good $ 2, $5,$ L8
addiu $
$ 4, 4, -1

    sb      $0,128($sp)
    addiu   $5,$sp,24
    lui     $4,%hi($LC1)
    addiu   $4,$4,%lo($LC1)
    jal     printf

    addiu   $5,$sp,60
    lui     $4,%hi($LC2)
    addiu   $4,$4,%lo($LC2)
    jal     printf

    addiu   $5,$sp,96
    lui     $4,%hi($LC3)
    addiu   $4,$4,%lo($LC3)
    jal     printf

    move    $2,$0
    lw      $31,140($sp)
    j       $31
    addiu   $sp,$sp,144