## Provide a polynomial time algorithm that decides whether or not the language recognized by some input DFA consists entirely of palindromes

Everything needed to know is in the question statement. I believe that the DFA has to be acyclic (meaning its language is finite), which can be checked in polynomial time. However, finding all paths from the start state to an accept state can run in exponential time in worst-case.

## Is there a way to determine whether a list of integers can be a prefix function?

(0,0,0,1,2,3,4,5,6,7,8,9,10)

or

(0,1,0,1,0,1,2,3,0,1,0,0,1)

Could you use, for example, the KMP algorithm to deduce the validity of the above lists as prefix functions? I know there is a way to find whether a substring exists in a string using KMP, but is there a way to do it the other way around, starting at the apparent prefix function and ascertaining that it is indeed a possible prefix function, without knowing the string/substring itself at the start?

## checking whether turing machine passes at least k>2 states before accepting a word

$$L=\{|\exists\,\,w\in L(M)\,\,such\,\,that\,\,M\,\,passes\,\,at\,\,least\,\,k>2\,\,distinct\,\,states\,\,before\,\,accepting\,\,w\}$$

I try to think of reduction to prove that this language is neither RE nor coRE. How to approach this problem? Is there a hint, or intuition?

I usually check whether Rice can be used, but the question here is not about the language itself

## Given an algorithm, decide whether it runs in polynomial time?

This problem is not decidable (reducible to halting problem) but is semi-decidable and therefor verifiable (as those two definitions are equivalent: How to prove semi-decidable = verifiable?).

However, is this problem poly-time verifiable? A decision problem 𝑄 is in poly time verifiable iff

there is an algorithm 𝑉 called verifier such that V runs in $$O(x^{c})$$ for some constant c for all inputs 𝑥,

if 𝑄(𝑥)=𝑌𝐸𝑆 then there is a string 𝑦 such that 𝑉(𝑥,𝑦)=𝑌𝐸𝑆, if 𝑄(𝑥)=𝑁𝑂 then for all strings 𝑦, 𝑉(𝑥,𝑦)=𝑁𝑂.

Example: for an enumeration of P (such as this): How does an enumerator for machines for languages work? for each string $$p$$ in the enumeration, does there exist some other string (certificate) $$c$$ that allows you to verify $$p$$ is a member of the enumeration in poly time?

## How do ISPs detect whether a phone uses tethering?

I’m trying to figure out how ISPs detect whether a phone uses tethering beyond checking whether the TTL is set to a particular value.

## Determine whether given f is shortest path function

I have the following question: Let $$G = (V,E)$$ be a directed graph with a weight function $$w:E\rightarrow \mathbb{R}^+$$, and let $$s \in V$$ be a vertex such that there is a path from $$v$$ to every other vertex, i.e $$0\leq dist(s,v) < \infty$$. Let $$f\colon V \to \mathbb R$$ a given function. Describe an algorithm that runs in $$O(|V| + |E|)$$ that determines wethter this given $$f$$ is the shortest path function from $$s$$, i.e $$\forall v \in V :f(v)=dist(s,v)$$.

What I thought about was to check for every $$v \in V$$ whether $$f$$ fulfill the two following demands:

1. $$f(s)=0$$
2. $$f(v) \leq f(u) + w(uv)$$ for all $$u \in V$$ and $$uv \in E$$

This runs in the proper complexity. I thought to prove it by showing that $$f(v) \leq dist(s,v) \land f(v) \geq dist(u,v) \Rightarrow f(v) = dist(f,v)$$

I proved that $$f(v) \leq dist(s,v)$$, but I am stuck at proving that $$f(v) \geq dist(s,v)$$.

## Decide whether two strings $x, y$ can be split into substrings $a,b,c$ such that $x=abc$ and $y=cba$

What is the fastest algorithm for the following problem?

Given two strings $$x, y \in \Sigma^*$$ as input, decide whether there exists strings $$a, b, c \in \Sigma^*$$, such that $$x=abc$$ and $$y=cba$$.

By calculating all the length of the longest common prefix of $$s = x y$$ and all suffixes of $$s$$, we can compute all candidates for $$a$$ in $$O(n)$$ time.

For each candidate of $$a$$ with length $$k$$, we now just need to check whether $$x_k, x_{k + 1}, \ldots, x_{n}$$ is a rotation of $$y_0, y_1, \ldots, y_{n – k}$$. This can of course be done in $$O(n)$$.

However checking the rotations naively results in a worst-case $$O(n^2)$$ algorithm.

It seems that using the result from either https://arxiv.org/pdf/1601.08051.pdf or https://arxiv.org/pdf/1311.6235.pdf would make the algorithm run in expected $$O(n)$$ time.

Is there a simpler way of speeding up the rotation checking, where it is still faster than $$O(n^2)$$? Is there a way of making it deterministic, so that it still runs in $$O(n)$$ time?

## whether the Regular-TM is recognizable or unrecognizable

Using reduction from known problems, determine whether the Regular-TM is recognizable or unrecognizable.

## Deciding on whether to learn Rust or OpenGL next

I’m currently a student studying Computer Science. I love to learn new things in order to further enhance my skills in the things I find useful. Part of me wants to learn OpenGL so I can get a better understanding of graphics programming, and to apply it with Unity game making (working on my very first game). However, I am also intrigued in what I read about Rust and too also gain an additional programming language that I can add to my arsenal. I’m stuck and don’t know which would be more useful in the long run. I would appropriate all the help I can get. Thank you!

## Consider the language L = {hM, wi | M on input w moves its head left at least once, during computation on w}. Prove whether L is decidable or not

I feel like this is a decidable language. But I dont know the algorithm to prove that it is decidable. any help would be appreciated