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
1
vote
2 answers

Complement of non-deterministic context-free language

The complement of a context-free language is not always context-free. It is not allowed to just swap the final and non-final states of an NPDA and assume that it produces the complement of the language. Could someone give an example where it goes…
1
vote
1 answer

how to do global sorting without a unique key in Presto

In my case, I have some hive tables, the partition column(dt) is the only column that every table contains. I execute the sql below in hive SELECT * FROM ( SELECT row_number() over(ORDER BY T.dt) as row_num,T.* FROM (select * from ods.test_table…
1
vote
0 answers

Non-deterministic crash of deterministic program, when inner functions are present

I have tested the following python script on 2 Windows machines, and onlinegdb's python compiler. On the Windows machines, this code when run as it is, just exits midway, non-deterministically, with no error message or warning. I tested with python…
1
vote
2 answers

Automatically detect non-deterministic behaviour in Python

This may be impossible, but I am just wondering if there are any tools to help detect non-deterministic behaviour when I run a Python script. Some fancy options in a debugger perhaps? I guess I am imagining that theoretically it might be possible to…
Ben Farmer
  • 2,387
  • 1
  • 25
  • 44
1
vote
0 answers

SQLSVR - not able to create index with computed GETDATE column

What I want to achieve: To create an index with an existing date column data converted into UTC timing (Query is written below) Issue: There's a column in table with local server date values, I need to convert them into UTC date value and then…
1
vote
1 answer

XGBRegressor: how to fix exploding train/val loss (and effectless random_state)?

I used XGBRegressor to fit a small dataset, with (data_size, feature_size) = (156, 328). Although random_state is given, the train/val history can not be reproduced each time I executed the program, sometimes the training process was fine, sometimes…
1
vote
3 answers

How count Dijkstra guards sort executions in Prolog

I do not find a Prolog cut in Dijsktras "if fi", since he says "otherwise an arbitrary guarded list with a true guard will be selected for execution.". So his construct, does not choose the first match, as a Prolog cut would do: if Cond1 ->…
user502187
1
vote
1 answer

deterministic dithering with libsoxr

I have an issue with some unit test code which is giving different results for every execution. I tracked it back to libsoxr (0.1.3) and discovered that is its down to the dithering option: That is, if soxr_create() is invoked with: soxr_io_spec_t…
Bruce Adams
  • 4,953
  • 4
  • 48
  • 111
1
vote
1 answer

GluonTS DeepAR prediction non deterministic

I'm working on DeepAR using GluonTS. After I trained a model using the proper method, I got a predictor that i named predictor. Then, I used this to perform a prediction like in this case: predictor.predict( ListDataset([{"start": ..., "target":…
Dan
  • 43
  • 7
1
vote
3 answers

What's the proper way using GTest to repeat a multi-threaded test multiple times?

Using Google Test, I want to test the behaviour of a Server.AcceptRequest method: class Server { public: // Clients can call this method, want to test that it works Result AcceptRequest(const Request& request) { queue_.Add(request); …
mercury0114
  • 1,341
  • 2
  • 15
  • 29
1
vote
1 answer

Design the NDPA for the following grammar (Pushdown Automata)

Im trying to design the NDPA for the following grammar. I'm confused. Can you help me? ∑ = {a,b} G = (V,∑,R,S) V = {S,T,X} S -> aTXb T -> XTS|ε X -> a|b
VolkanK
  • 11
  • 2
1
vote
2 answers

Order-independent floating point summation

I know that floating point addition is not associative: (a + b) + c in general does not equal a + (b + c). So this algorithm for sum can give a different result depending on the order of the input: float naive_sum(float[] input) { float…
dpercy
  • 459
  • 6
  • 13
1
vote
1 answer

Azure Durable Functions: am i using `!orchestrationContext.IsReplaying` correctly?

i see in Microsoft's example of fan-out that there is no concern for 'defending' against replay but i definitely need if (!orchestrationContext.IsReplaying) here: [FunctionName(FUNC_NAME_ORCH)] public static async Task
1
vote
3 answers

Same program, compiled with same flags, that reads in a text file gets different results on different systems

I have a bit of a head scratcher here. I have a code snippet that reads certain columns from a text file and saves them in a vector. I have compiled this code on two different machines, using as far as I can tell the same compiler and the same…
gabe
  • 193
  • 1
  • 10
1
vote
0 answers

How to prove Shortest Common Superstring is NP-Hard

After some research and many youtube videos I have learnt that to prove a problem is NP-Hard; you would need to reduce that problem to known NP-Hard problems such as Subset Sum Problem, Halting Problem, Satisfiability Problem or Traveling Salesman…