single and double sided infinite tapes turing machine - automation

My question is do we have infinite null values at both end of the tape of a turing machine or we can have a single sided infinite nulls as well.
Also if both of them are valid, do we have to make ANY changes to the turing machine of a single sided infinite null tape, such that it will work for a tape with nulls at both ends? and other way around as well.

Related

Building decider and not a decider Turing machines

How to make a Turing machine graph which recognizes all words with an even number of a's but which is not a decider and nothing else. Also, how to make a decider Turing machine graph for the same language.
The language of all words with an even number of a's is a regular language, so a simple two-state DFA will accept the language. The same machine is a two-state decider TM that happens not to use the tape for anything except reading input.
To turn such a decider into a recognizer-non-decider (since all deciders are recognizers, too) we must make the TM explicitly recognize strings with an odd number of a's and, rather than simply halt-reject, go into an infinite loop. This can easily be done with a single state.

Precision in Game Engine Physics (eg TrackMania "Press Forward Maps")

For some time now, I've been thinking about how games calculate physics. Take as an example the game TrackMania. There are special routes where you only have to accelerate from the beginning to get to the finish. As an example, I take the following YouTube video (https://www.youtube.com/watch?v=uK7Y7zyP_SY). Unfortunately, I'm not a specialist in game development, but I know roughly how an engine works.
Most engines use a game loop, which means they use the delta value between the last call and the current call. This delta value is used to move objects, detect collisions and so on. The higher the delta value, the farther the object must have moved. The principle works fine with many games, but not with TrackMania.
A PC that can only display 25 FPS would calculate the physics differently than a PC with 120 FPS, because the collision detection is more accurate (impact is detected earlier, speed adjusted accordingly, ...). Now you can assume that the delta value is always the same (as with Super Mario Maker, at least that's my assumption), then this would work. But that would cause problems similar to old games (https://superuser.com/questions/630769/why-do-some-old-games-run-much-to-quickly-on-modern-hardware/).
Now my question, why do such maps work on every PC and why is the physics always exactly the same? Did I miss any aspect of game development / engine development?
The answer is simple, first the physic of the game is predictable, based on the input the result will always be the same.
Then the physic loop is not the same as the render, the game ensure the physic loop will be call with exactly the same period every time during the whole execution. So, yes a delta is needed for the render part, but the physic as a constant time in ms between each iteration.
One last think : you wont find "Press Forward" maps on the multiplayer, these kind of maps will not work correctly, this is directly linked to specificities in the physic to avoid TAS (Tool Assisted Speedrun).

Alternating Generations GA? To keep evaluators running

What I want?
I Want to be able to generate population for generation N+2, from ranked population of generation N; while the generation N+1 is still in evaluation. Once the generation N+1 finishes evaluation it will be used to generate generation N+3 (and at that point generation N+2 evaluation will be already running).
Why do I want that?
To better utilize computing resources. My evaluation threads can then run continuously with minimum synchronization and waiting. For a fast evaluation and small generations a single generation can be finished in a very quick time and evaluation thread would then need to wait for next generation; instead it can already work on something else.
Alternative thought
Alternative is to have 2 independent GAs run and generate generations while taking rounds in access to evaluation threads.
This is utilizing resources better, however it's obviously not allways what we want to do (digging two holes instead digging a single hole doesn't allways mean I can find oil faster)

Can negamax use an asymmetric evaluation function?

TLDR: I have an asymmetric evaluation function for an implementation of negamax - is that acceptable? Or do I need to make it symmetric?
Longer:
I'm writing a game AI (for the chess-like board game "Hive") that was using minimax with alpha-beta pruning and an asymmetric evaluation function.
But I was having trouble adding transposition tables correctly, and was losing confidence in my minimax implementation, so I decided to switch to negamax using the pseudo-code here: https://en.wikipedia.org/wiki/Negamax#Negamax_with_alpha_beta_pruning_and_transposition_tables
I've got everything "working" and AFAIK accurately following the pseudo-code, but my AI is now making some wildly different moves than before and games that usually ended after 10-15 turns now take 30+, and I'm not convinced the AI is actually playing better than it was before. I'm worried that having an asymmetric evaluation function means I'm scoring nodes differently than before (because of the negamax flip-flopping).
I don't want to change to a symmetric function unless I really have to - I've been trying to produce an optimal function experimentally (AI vs AI battles) and have put in hundreds if not thousands of compute hours into producing a strong evaluation function.
Negamax support asymmetric evaluation functions but it does not lead to optimal play (assuming you have no knowlege about your opponent).
I don't know enough about Hive, but in computer chess it is, in general, a bug to have an asymmetric evaluation function. The reasons behind it should be the same for chess and Hive.
For instance, take the starting position (in chess). White is next to move and let us assume your evaluation function gives the position a score of +0.08.
Now change the position, so black is first to move. Everything is the same, only that the roles of white and black has been changed. Under the assumption, that +0.08 was the optimal score for the white position, why should the position for black not also be evaluated as +0.08?
The same argument goes for any position. If you reverse everything, there is no good reason for playing the position differently.
There is only one exception to this rule. If one opponent is clearly stronger than the other, there are arguments for an asymmetric evaluation. For instance, take a completely drawn position like this:
FEN: 4k3/8/8/p1p1p1p1/PpPpPpPp/1P1P1P1P/8/4K3 b - - 0 1
This position could safely be evaluated as 0. Now imaging the starting position but white starts without one knight. This should be a strong advantage for black.
Let us assume you are Magnus Carlsen and you are playing against on opponent who does not even know the chess rules. Which position would you prefer? Here, I would argue that an asymmetric evaluation could make sense (e.g., evaluate a likely draw similar to a loss). Carlsen should avoid the drawn position, while the beginner should prefer it.
The chances that the beginner can hold its own against the world champion, even at one knight odds, are practically zero. On the other hand, in the drawn position, the skill advantage does not matter, as no order of moves can result in a win or loss.
In computer chess, Rebel had a function to prefer tactical positions when playing against humans (see ANTI GRANDMASTER PLAY). There is also the common concept of "contempt", which is the score that engines give for a remis.
But note that in both my examples, this is not optimal play. Magnus Carlsen would not choose the position without the knight when playing a strong (or unknown) opponent. Also Rebel would not use the anti-human strategy against other machines, which also excel in tactical battles. (Even though, depending on the position, Rebel 10 did use ANTI GRANDMASTER PLAY against computers.)

How to represent a coffee machine using DFA?

I want to know how to represent a coffee machine using a Deterministic finite automata?
I've tried a lot to do this job.
I represented each and every processes as a set,by putting one to one correspondence with Natural numbers.
But I still don't know how to represent it using DFA.
First, try to imagine the states your automaton can be in. Something like:
Off, Ready, Working
Afterwards imagine the buttons or inputs you have to perform to switch between these states. Do not forget to define every input on every state. If you leave out several transitions, the automaton is not deterministic therefore is an NFA. Transitions could be:
0 for power off/on
1 for start/stop working
Off -0-> Ready
Ready -1-> Working
Ready -0-> Off
Working -1-> Ready (4 for the actual working process)
Off -1-> Off
Working -0-> Working (nothing happens in this cases)
Just connect the states with the given transitions, and voilá!