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.

programming languages – How to prove that replacing a character in a string in both C and JavaScript is equivalent?

I would like to try some different proofs, specifically in proving equivalence of the implementation of some feature in two different programming languages (C and JS in this question).

This is about proving that replacing one character in a string is equivalent in C and JS.

In JS, for example, strings are immutable, while in C, strings are mutable. So in JS you might have to do this:

``````functioni replaceAt(string, index, replacement) {
return string.substr(0, index) + replacement + string.substr(index + replacement.length)
}
``````

While in C you might just do something like this:

``````#include<stdio.h>

int
main() {
char string(11) = "hello world";
string(1) = 'i';
printf("%s", string);
return 0;
}
``````

Basically, I am trying to come up with an example where, the perceived effect or desired outcome is for all intents and purposes the same. That is, the end result is that the character was replaced at a specific position (the same position in each language). Even though in one language the string was mutable, while in the other, it was immutable. What needs to be taken into account here to make a proof saying these are equivalent? How do we capture the notion of “partial equivalence” or “perceived equivalence”? (By that I mean, the outcome is roughly the same, so we want to make a proof statement that these are the same with regard to some spec).

terminal – What are the reasons behing Apple deprecating scripting languages on macOS?

It has been announced for some time that UNIX scripting languages will be deprecated.
That being said, it’s true that versions that ship with macOS Catalina are indeed old (python 2 is not supported anymore, for example).

However I don’t quite understand why these run times are not simply updated, instead?

dnd 5e – How useful are the exotic languages?

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.

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.

Ways to enumerate an enumerable set of languages?

Given some computably 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 is this done? What are some other methods?

programming languages – Suitable way to round results returned by any function of a class

Assume there is a abstract class Shape. The class has two functions area() and perimeter().

Let’s say Circle and Square inherit from Shape and override these methods. Obviously the results are going to be fractional.

What is the best way to set a precision value for the results. Say the user says PRECISION=2 or PRECISION=3 and the results returned by the functions of Circle and Square class are returned accordingly. Where should I define this functionality? I was wondering how do libraries like numpy handle this situation.

One approach can be to add an optional parameter to these functions and round the results accordingly.

``````getArea(radius, prec=2) {

}
$$```$$
``````

programming languages – How to develop my own software product?

I want to develop my own software in financial systems. This is my first time of thinking of that. I want to know step by step how I can start and which programming language should I use. I am a communication and electronic engineer. I learned C, C++, matlab, assembly, arduino C, VHDL and Python.
How can I start doing that?

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.

begin{align} S rightarrow AB\ A rightarrow a mid varepsilon \ B rightarrow bCd\ C rightarrow c mid varepsilon end{align}

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.

The union doesn’t have to be without overlap. As an example, take NP-complete language $$X$$ over the binary alphabet and form:
$$A =X cup 0Sigma^*$$
$$B =X cup 1Sigma^*$$
Note that $$A$$ and $$B$$ are still NP-complete, but their union is $$Sigma^*$$.