Questions tagged [non-deterministic]

Nondeterminism refers either to a computing system where the result may be one of many specified results or to a theoretical construct in which a computing system is allowed to try many options in parallel to search for a result.

Nondeterminism has several meanings in computing. In theoretical CS, nondeterministic computations are computations that have multiple options specified at various points and allows the computing machine to choose any of them. In programming, a nondeterministic computation is one where the result may vary from run to run due to factors such as thread timing or values from external devices.

238 questions
4
votes
1 answer

Time complexity of a Turing machine for repeat strings

I'm trying to figure out the time-complexity of a turing machine that accepts repeat strings (ww) in three cases: a 1-tape deterministic machine, a 2-tape deterministic machine, and 1-tape nondeterministic machine. Right now my thoughts are that…
4
votes
1 answer

How can I build a nondeterministic state monad in Haskell?

I want to build a nondeterministic state monad in Haskell. This will allow me to generate all the elements in my search space using the built up state to prune bad locations. Suppose I have the following (pseudo-)code: primitives :: [State Int…
Eyal
  • 1,094
  • 10
  • 16
3
votes
1 answer

An attempt at non-deterministic finite state machine (C++), is a static std::map a good idea?

I need to implement a non-deterministic FSM, so I came up with the idea of defining an FSM class that holds states and transitions (that may or may not depend on the states of other FSMs, but must depend on events/input) for each object and adding a…
albizgil
  • 103
  • 6
3
votes
1 answer

Is there a way to save execution of ruby code to debug it using step by step replay later?

I have a rarely reproduced bug in ruby code. By running my test suite constantly I get it once every 10-15 minutes. What I want to do is to have the execution recorded step by step and once it fails, go ahead and debug what happened. I know about…
unkulunkulu
  • 11,576
  • 2
  • 31
  • 49
3
votes
1 answer

Is UUID's hashValue non-deterministic?

Given what I think is an identical Swift UUID, I get different hashValues for it on subsequent runs of the code. Within a single run it's consistent. eg: func UUIDTest() { let uuid = UUID(uuidString: "00000000-0000-0000-0000-000000000001") …
orion elenzil
  • 4,484
  • 3
  • 37
  • 49
3
votes
3 answers

Why does SQL 2005 say this UDF is non-deterministic?

I have the following function: SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO ALTER FUNCTION [dbo].[IP4toBIGINT]( @ip4 varchar(15) ) RETURNS bigint WITH SCHEMABINDING AS BEGIN -- oc3 oc2 oc1 oc0 -- 255.255.255.255 -- Declared…
Serguei
  • 2,910
  • 3
  • 24
  • 34
3
votes
1 answer

Spark SVD is not reproducible

I am using method computeSVD from Spark class IndexedRowMatrix (in Scala). I have noticed it has no setSeed() method. I am getting slightly different results for multiple runs on the same input matrix, possibly due to the internal algorithm used by…
3
votes
2 answers

How does this Prolog code really work - Shuffle two Lists

I have the following code, working, that shuffles two lists: shuffle([], [], []). shuffle([X|Xs], Ys, [X|Zs]):- shuffle(Xs, Ys, Zs). shuffle(Xs, [Y|Ys], [Y|Zs]):- shuffle(Xs, Ys, Zs). I understand each part separately. The first…
Assaf
  • 1,112
  • 4
  • 14
  • 35
3
votes
1 answer

Execute two fs2 tasks concurrently (non-determenistically)

With Scalaz Task I make this with scalaz.Nondeterminism.both: Nondeterminism[Task] .both( Task.now("Hello"), Task.now("world") ) or with Nondeterminism[Task].gatherUnordered(). How can I do the same thing with fs2 0.9.x version tasks?
mixel
  • 25,177
  • 13
  • 126
  • 165
3
votes
2 answers

How do disk controllers handle concurrent writes to same sector in absence of write barriers?

When I open a file with O_DIRECT|O_ASYNC and do two concurrent writes to the same disk sector, without a fsync or fdatasync in between, does the linux disk subsystem or the Hardware disk controllers offer any guarantee that the final data on that…
3
votes
1 answer

Non-Deterministic Merge Sort Doesn't Order Permutations Lexicographically

I've been trying to reproduce an aside mentioned in All Sorts of Permutations (Functional Pearl) by Christiansen, Danilenko and Dylus, a paper for the upcoming ICFP 2016. Section 8 (“Final Remarks”) claims that by choosing a particular…
R B
  • 1,109
  • 9
  • 13
3
votes
1 answer

DBSCAN clustering - what happens when border point of one cluster is considered to be core point of another cluster

I would like to know your opinion about dbscan clustering, I am trying to implement algorithm as published here. In my opinion there is possibility for one point from border of some cluster to be an core point of another one as shown in picture: . I…
ILikeMatDotH
  • 43
  • 1
  • 9
3
votes
0 answers

How to remember NFA's choice on a certain computation?

I'm working on solving the question answered at this page but with different values at the table, my alphabet is {a,b,c} Words that have the same right- and left-associative product Currently I'm in the stage where I have drawn the DFA of the…
3
votes
0 answers

Non-deterministic Math.pow(x, 2) [Scala]

In my code I started noticing that the same initial conditions would output different results. After hours of hunting, I found where the bug occurs. I have a simple function, which takes a few parameters, one of which is v. v is a double. One of the…
Anton
  • 2,282
  • 26
  • 43
3
votes
1 answer

How to run MCTS on a highly non-deterministic system?

I'm trying to implement a MCTS algorithm for the AI of a small game. The game is a rpg-simulation. The AI should decides what moves to play in battle. It's a turn base battle (FF6-7 style). There is no movement involved. I won't go into details but…