Are there any enumerations of (machines for) languages in P such that all the machines can be simulated efficiently on any input?

From Computational Complexity A Modern Approach: Efficient Universal Turing Machine Theorem: There exists a TM U such that for every x, α ∈ {0, 1}∗, U(x, α) = Mα(x), where Mα denotes the TM represented by α. Furthermore, if Mα halts on input x within T steps then U(x,α) halts within CT log T steps, where C is a number independent of |x| and depending only on Mα’s alphabet size, number of tapes, and number of states.

From Kozen INDEXINGS OF SUBRECURSIVE CLASSES: "the class of polynomial time computable functions is often indexed by Turing machines with polynomial time counters…. The collection of all (encodings over (0, 1)) of such machines provides an indexing of PTIME…we have Theorem: No universal simulator for this indexing can run in polynomial space."

He then goes on to say: "can it be proved that gr U for any indexing of PTIME requires more than polynomial space to compute? We have proved this for a wide class of indexings, namely counter indexings satisfying the succinct composition property."

  • gr U is the graph of the universal function U and (barring details) represents the minimum power necessary to simulate P uniformly.

  • And the counter indexing (or polynomial time counters) he is referring to is specified in the answer here: How does an enumerator for machines for languages work?

I’m wondering how theorem for efficient universal Turing machine relates to Kozen’s result, that for certain types of enumerations of P, there is no machine that can efficiently simulate the machines enumerated. What causes simulation to be difficult and can it be circumvented–namely: does there exist an enumeration of P that describes the (machines for) languages in P in such a way that allows them to be efficiently simulated (with no more than poly overhead) on any input–or as Kozen puts it "allow(s) easy construction of programs from specifications"?

My guess is that part of the reason for the difficulty is because the efficient simulation theorem only says that there exists a machine that can efficiently simulate any single TM, but not a whole class of them… and when you start having to simulate more than one TM you loose the ability to optimize your simulator’s design to solve any particular language (run any particular machine) and have to design the simulator with the various machines you need to simulate in mind (and the more different those machines are the larger your overhead gets).

PS. A possible example could be in implicit complexity theory… where they construct languages that are complete for certain complexity classes. A language that is complete for P doesn’t seem to have trouble running its programs (which represent the languages in P)? But, if there are examples here, how do they overcome the difficulty Kozen is referring to, as they are programming systems and thus enumerations / indexings?

Just as a related aside… I think I have a proof that for a language Lp 1. and 2. cannot be true at the same time:

  1. An enumeration of P, call it language Lp (whose members are the strings in the enumeration) is decidable in poly time.

  2. All the P machines / languages represented by strings in Lp can be efficiently simulated by a universal simulator for P on any input.

It makes sense that there would be a relationship between the way the machines are encoded and the overhead for their simulation and 1. can be made to be true so that leaves 2. and brings us to the question being asked… Is it possible that 2. is always false–meaning for ANY enumeration/ encoding of P (any language Lp) simulation of those machines is not efficient for any universal simulator for P.

Here’s a rough sketch for anyone interested:

Take L:= {w∈L iff w∈Lp and W(w)=0}

So, one way to do this is our diagonal function maps w–>the language in P that w encodes (if w encodes a machine for a language in P (if w is a member of Lp)) and if it does not then it maps to the language containing all words. The existance of a map between a w and a language translates to w∈L iff w ‘is not a member’ of the language it is mapped to.

Since all w’s that aren’t encodings of P machines (members of Lp) are mapped to the language containing all words–they are members of L iff they are not members of this language. This is always false, so all words that are not members of Lp are not members of L.

This leaves only words of Lp as candidates for members of L. But for w to be a member of L not only does it need to be a member of Lp–the machine that w encodes, W, needs to evaluate to 0 on w. W(w)= 0 and w∈Lp <–> w∈L.

L is not in P. If L were in P then for some w, w would encode a machine for L, Wl. and for that w∈L iff Wl(w) = 0, ie. w∈L iff w is not in L.

Now, let’s employ the assumption that 1. Lp is poly decidable. As well as the assumption 2. that any machine specified by Lp can be simulated with no more than poly overhead by a universal simulator.

Then we can devise an algorithm, namely: given w, decide w∈Lp. If w∈Lp then run W(w). If w(w)=0 –> w∈L.

By the above algorithm, under these the assumptions 1. and 2. L would be in P–which is a contradiction to the previous proof by contradiction. I think the previous proof is correct and conclude that neither 1. nor 2. can be true at the same time.

All problems about Turing machines that involve only the language that the TM accepts are undecidable

I came across the below statement in the classic text “Introduction to Automata Theory, Languages, and Computation” by Hopcroft, Ullman, Motwani.

All problems about Turing machines that involve only the language that the TM accepts are undecidable

They say that the above theorem is per Rice theorem which states that:

“Every nontrivial property of the RE languages is undecidable.”

How are these two statements equivalent? The former deals only problems while the later deals with non trivial property.

Job scheduling with multiple machines

I have the following question for an assignment and I’m really lost:

Let S = {1, 2, . . . , m} be a set of m machines, and let J = {J1, . . . , Jn} be a set of n jobs each of which has to be done by one of the machines. No more than one machine can work on the same job, and a machine cannot work on more than one job. Moreover, with each job Jk is associated a contiguous interval [lk, rk] of integers, 1 ≤ lk ≤ rk ≤ m, whose significance is that only machines i for which lk ≤ i ≤ rk can work on job Jk. Give an O(mn) time algorithm for assigning machines to jobs so as to maximize the number of busy machines (which is the same as the number of jobs being done). There is no need to prove the correctness of your algorithm.

Help with finding a flaw in argument simulating large Turing machines with smaller ones

I have an argument which, if it goes through, just about proves that either:

  • Programming languages are more powerful than Turing machines
  • The busy beaver function ($ BB()$ ) on Turing machines is computable

Now, I understand that it’s vastly more likely that my argument has some flaw that I can’t find. But it’s more interesting to me how I’m wrong, rather than whether I’m wrong.


Throughout, I use $ \mathbb{S}(x)$ to mean either the number of states that Turing machine $ x$ has or the number of states required by a Turing machine to write $ x$ to the tape.

Construct a Turing machine $ M_1$ as which takes as arguments (on the tape) $ n, k$ , simulates all Turing machines with $ n$ states until $ k$ of them halt, and then halts itself. This is easy to write in a programming language, as demonstrated by the following Python snippet:

def M1(n, k):     all_machines = generate_turing_machines(n)     is_halted = [0] * len(generate_turing_machines)     while sum(is_halted) < k:         for (i, machine) in enumerate(all_machines):             machine.step()             if machine.is_halted():                 is_halted[i] = 1 

Now, let $ \mathbb{S}(M_1) = m_1$ be the number of states required by $ M_1$ . Fix $ n$ much greater than $ m_1$ . Let $ k_1$ be the largest number such that $ M_1(n, k_1)$ halts and $ k_0$ be the smallest number such that when $ M_1(n, k_0)$ halts, $ k_1$ simulated Turing machines have halted (as all equivalent machines will halt on the same step). Choose $ k$ with $ k_0\leq k\leq k_1$ . This means that $ M_1(n,k)$ halts in about $ BB(n)$ steps.

Construct $ M_2$ which is the same as $ M_1$ except the first thing it does is write $ n$ and $ k$ to the tape. Let $ \mathbb{S}(M_2)=m_2$ . Then $ m_1+\mathbb{S}(n)+\mathbb{S}(k)+C=m_2$ for some small $ C$ (which is probably constant and likely $ 0$ ).

Now, $ \mathbb{S}(n)$ is at most $ O(log(n))$ . $ k$ is about $ n^n$ , so $ \mathbb{S}(k)$ is at most $ O(n)$ . That puts $ m_2$ just slightly larger than $ n$ . But here we have a problem: if $ k$ is even slightly easier to write to the tape, then $ m_2$ would be slightly smaller than $ n$ . That would mean $ BB(m_2)>BB(n)$ and $ m_2<n$ , a clear contradiction.

In my mind, these are the possible resolutions:

  • $ M_1$ is impossible to create as a Turing machine, meaning that Python is more powerful than Turing machines are.
  • There is some transfinite extension to Turing machines which is not much more powerful than Turing machines in general, and $ M_1$ can be written in this extension. In other words, $ M_1$ is the limit of a set of machines $ M_{1,N}$ , each of which can handle any $ n<N$ . This would probably entail the busy beaver function being computable.
  • There is a large set of numbers which cannot be written by a Turing machine in much fewer than $ log(k)=n$ states (we need $ \mathbb{S}(k)<n-log(n)$ ). It seems impossible to me that no candidate for $ (n, k)$ could be sufficiently compressed.

Where is the error in this logic?

How to approach weighted job/interval scheduling problem with 2 machines (dynamic programming)

Given N jobs where every job is represented by the following: Start Time, Finish Time and Value Associated (>= 0) and two machines that can do the jobs,

The goal is to find the maximum value subset of the jobs such that no two jobs in the subset overlap.

How should I approach this? I could only think of using the solution for a single machine and then doing it again for the second machine…

How to detect use of personal NAS devices from corporate machines?

We have an issue where people are taking laptops home and connecting them to their personal home networks in order to backup corporate data to their private NAS devices. From a DLP standpoint we have trouble reconciling this activity because the activity destination is typically a private IP, something like, which is also being used within the corporate network for various labs and testing environments. Short of major policy changes about IP ranges in use and things like that, are there any creative ways to determine the difference between a personal NAS device on a home network vs a corporate-issued one being used from within the corporate network?

We tried frequency analysis of similar activities, but again many generic private IP’s are being reused across both corporate and personal environments. I thought about tracking against the ‘name’ of the network to which the user is connected, but haven’t had a ton of luck with that information being readily available in the logs I have. I’ve been tasked with trying to explore this from an incident response/SOC standpoint, so my available logs are more so correlated with IDS/IPS, mcafee, CIRT, and DLP-type solutions, rather than something like OS event logs.

Character development question for a god of Knowledge and Machines: How to make a god an interesting character?


We are playing a custom system, and in the system we are all gods that create a universe, having mortals with a primary planet. The mortals are in the early iron age.

There is a rotating GM, but one main GM that has the final say. During the session, players are encouraged to take creative powers to add to the world, so decisions about what is going on are somewhat handled by players, but again final say goes to the current GM.


There are many gods, some npc, some pc.

Each god has 2+ attributes, e.g: Fire and Honor, or Transformation and Storytelling. There are five PCs and one rotating GM. As gods level up, they may take on new attributes.

Each god has a realm, and the realms can be though of as part of the character. The gods can also create things and control them, for instance, my god has an elevator which “takes you where you want to go, unless it thinks there’s somewhere else you should be”. So, if the PCs use my elevator, I can choose to send them somewhere besides where they want to go.


The threats that come up in session tend to be concerning other NPC gods, and maybe to a much milder degree PC gods. An example threat might be a trickster god stealing the aurora and requiring someone a mortal to purchase it back from him, or the god of the mortal world being in pain from the mortals digging into it, and our party has to find a way to solve the issue.

My Character

My god is the god of Knowledge and Machines. He’s similar to Will Rogers in manner, knows godly amounts of knowledge, uses machines to benefit mortals. He has buddhist master levels of patience. Nothing much threatens him really.

My character’s backstory

My character came about when the king of the gods wanted to know the answer to a riddle, and created my character.

My character helped create the planet the mortals live on. He has a realm that appears to be a serene countryside, but is really made up of machines.

Eventually, the king of the gods basically disintegrated, and my god was exposed to the timeline of a previous incarnation of the universe, before my god existed. This caused his mind to fragment into two realities and started “corrupting” him. This is where I have a few ideas, but I’m not sure how to execute them.


The threats that come up in session tend to be concerning other NPC gods, and maybe to a much milder degree PC gods. An example threat might be a trickster god stealing the aurora and requiring someone a mortal to purchase it back from him, or the god of the mortal world being in pain from the mortals digging into it, and our party has to find a way to solve the issue.


So, I guess I don’t know where to go with my character. There’s no real change to be had as a normal healthy god, so I introduced the corrupted aspect. I’m trying to

  • How should I interact with the other god PCs in interesting ways without antagonizing them as a corrupted god?
  • How can I redeem my god and bring him back to a non-corrupt state, but still leave room for growth? His original “healthy” form was too perfect and didn’t have room for growth. His corrupted form is more interesting, but I feel like it can be too antagonistic.
  • How can I get my god to take action? In the past he tended to be fairly passive, because he values allowing others to find their own meaning and not interfering with their quest to find meaning, even if that meant allowing them to destroy or steal something he owns. Now that he’s corrupted, I’m having him get upset about things being “not perfect”, and trying to “fix” them, or even just outright destroy them.

simple question about epsilon and estimation turing machines

i am getting really confused by it. i got to a point i had to calculate the lim when $ n \rightarrow \infty$ for an optimization problem, and i got to the point that i had to calculate a fairly simple limit: $ lim_{n \rightarrow \infty} {3-\frac{7}{n}}$ .

now i used $ 3 – \epsilon$ and i am trying to show that there can’t be any $ \epsilon>0$ so that the estimation of the algorithm is $ 3-\epsilon$ , because there exists a “bigger estimation” – and this is the part i am not sure about, what is the correct direction of the inequality? $ 3-\frac{7}{n} > 3 – \epsilon$ or the opposite? i am trying to show that the estimation ration is close to 3.

i think that what i wrote is the correct way, but not sure. would appreciate knowing what is correct in this case. thanks.

How did Vice detect voting machines connected to the internet? [closed]

What method would you use to determine if a machine is a voting machine? do they give off a unique signature? Did someone give them a list of all IP addresses associated with voting machines and they pinged them to see if they were online?

the article is very scarse on details, yet it referneces a group of security experts