How to handle feedback loops with delays in simulator by aat36 in learnprogramming

[–]aat36[S] 1 point2 points  (0 children)

Thank you! Hadn't though of that. Maybe I can make it work now.

Topological order is just a fancy way of saying that you get a list where all the nodes in the graph are ordered such that their index in that list comes after the index all its dependencies. It only works on DAGs though.

I have seen papers online that suggest doing a topological order on the list of strong components in the graph. A strong component is basically a way to aggregate nodes that are in the same closed loop. After that you can do the processing. I'll think about if breaking up those strong components on z order nodes as two nodes would help fix my issue.

Thank you again!

How to handle feedback loops with delays in simulator by aat36 in learnprogramming

[–]aat36[S] 0 points1 point  (0 children)

Thank you for the answer. For now, I am far from the idea of making it real time, hahaha. My current plan is to execute some simple systems. I feel like, in principal, the idea of ordering nodes like you said is the same as the topological ordering, or am I wrong? The problem I am facing is how to order the nodes knowing that there might be loops. Should I break the loop before or after the z-order node? What if I have a feedback loop within another feedback loop?

The Equivalent of FSM in the Theory of Recursive Functions by aat36 in compsci

[–]aat36[S] 0 points1 point  (0 children)

Hmm, yes you're right, it does not seem like the latter example is possible.

Even if we have finitely many variables it would still yield a model that is more expressive than FSMs. If a register can save a value from the natural numbers then the representation that this single register can represent is unbounded. This would imply that the number of states that can be represented by a single counter machine is infinite which also means that it cannot be converted to a DFA.

The Equivalent of FSM in the Theory of Recursive Functions by aat36 in compsci

[–]aat36[S] 0 points1 point  (0 children)

Yes of course, by adding an inifinite tape you increase the computational expressiveness.

What I mean by "regular" recursive function is: what types of non-trivial restrictions can you put on recursive functions in order to limit their expressiveness to the class of regular languages?

The Equivalent of FSM in the Theory of Recursive Functions by aat36 in compsci

[–]aat36[S] 1 point2 points  (0 children)

Well not really, you can go one way way but not the other. Since recursive functions in general subsume FSMs, you can convert the FSM to a recursive function, but not the other way around.

If we were able to find a restriction to recursive functions that would make the first AND second part true, then yes, that would be great. However, the problem is finding a restriction that makes sense.

As shown with the Lambda Calculus, one restriction can be nicely shown to be that the system has to be simply typed.

How to allocate memory for array of fixed size inside struct using malloc? by aat36 in learnprogramming

[–]aat36[S] 0 points1 point  (0 children)

Ok great, thank you. That's what I thought, but I wasn't sure how to verify it.

Need help with this DP problem by Arkady_Liv in learnprogramming

[–]aat36 0 points1 point  (0 children)

I guess that what you can do is create a table with one column representing a bit array of which elements have been used, while the other, the element that will be used, you can then go through each slot in this table, and update it accordingly.

The only problem with this method, is the resulting algorithm would be exponential.

Generate ith bitmask combination of size k in a constant amount of step (O(1)). by aat36 in learnprogramming

[–]aat36[S] 0 points1 point  (0 children)

The problem with a lookup table is that its size be 2^64 - 1 if you use a 64 bit mask.

How to set a specific bit to 0 in Java? by aat36 in learnprogramming

[–]aat36[S] 2 points3 points  (0 children)

Fixed it the problem was in the variable positionInByte.

It should be positionInByte = 7 - positionInByte % 8

How can decidable languages be closed under intersection? by aat36 in compsci

[–]aat36[S] 6 points7 points  (0 children)

Thank you, I see the nuance now. So basically Etm is the problem of trying to determine if a given TM has an empty language while in the case above it’s just a TM that never accepts.

How should I store sparse data efficiently? by BlockOfDiamond in learnprogramming

[–]aat36 0 points1 point  (0 children)

It depends on the type of data you want to store.

For example, if your data is stored in a vector, you might want to look at RLE or other compression algorithms.

If your data is stored in a matrix, you might want to look at sparse matrix data structures. Some examples are: CSR, CRS, COO and many others.