Christian Sievers

 The Nineteenth Byte

The Nineteenth Byte: General discussion for codegolf.stackexc...
May 1, 2020 13:21
colno in 1:17 ?
May 1, 2020 13:10
That seems fine
May 1, 2020 13:06
How is the matrix computed? How is the automaton computed?
May 1, 2020 12:58
How do you compute M*v? Do you use sparse matrices?
May 1, 2020 12:48
I'm not sure I need it, what is the problem?
May 1, 2020 12:44
Okay
May 1, 2020 12:27
@Anush Hi!
Apr 30, 2020 17:04
Good luck!
Apr 30, 2020 17:00
oh, I think that should be [[2,2],[0,2]]
Apr 30, 2020 16:54
what are you trying? This should be correct
Apr 30, 2020 16:53
yes. And the sparse representation doesn't directly allow 2 as entry, so has repetitions
Apr 30, 2020 16:52
both is possible, one just has to adapt the rest of the computation
Apr 30, 2020 16:51
(or from j to i, I never remember)
Apr 30, 2020 16:50
i-j-entry: how many ways to get from state i to j
Apr 30, 2020 16:49
This seems to be the transition table
Apr 30, 2020 16:41
How does memory usage compare to the GAP code?
Apr 30, 2020 16:41
I think they prefer to stay GAP-only. They have used code in other languages before, but this seems far outside its usual realm. They still might like to know about it, it's always good to have options.
Apr 30, 2020 16:35
How much memory did it take?
Apr 30, 2020 16:34
Yeah, it is amazing!
Apr 30, 2020 16:31
Yes. And taking v[initstate] is a short way to premultiply init, i.e. the 0-1 vector which identifies the initial state
Apr 30, 2020 16:25
The List/Sum thing is sparse matrix / vector multiplication
Apr 30, 2020 16:18
And List(l,x->f(x) returns a list of all the values of f(x)
Apr 30, 2020 16:17
@Anush Sum(l,x->f(x)) sums all the values of f(x) with x in l
Apr 24, 2020 11:16
@Anush i've seen your answer here
Apr 24, 2020 09:50
@Anush I see. Up to what length?
Apr 24, 2020 09:42
@Bubbler I guess you what to see this
Apr 24, 2020 09:37
@Anush What do you mean by "full answer"?
Apr 23, 2020 14:40
they'd have to transform the input
Apr 23, 2020 14:37
("this"=your suggestion)
Apr 23, 2020 14:35
This looks more like vectorisation than threads
Apr 23, 2020 14:34
Ah yes, that's right. I was thinking about 4 long running threads that would need to communicate about the reachable states they have found.
Apr 23, 2020 14:20
I don't think such a parallelisation could work in any reasonable way.
Apr 23, 2020 14:05
How long did it take?
Apr 23, 2020 13:57
@Anush Wow! Now what are you gonna do with it?
Apr 21, 2020 11:33
I know Sevi. Haven't thought about her for a long time.
Apr 21, 2020 11:25
Using gap format of course automatically gives consecutive state numbers.
Apr 21, 2020 11:24
@Anush You keep mentioning this Seviers person. I'd really like to get to know them.
Apr 21, 2020 11:17
I don't think it helps testing. It avoids just encoding the subset as number-as-bitset, but maybe that isn't a bad thing. I guess doing that helps less than I first thought.
Apr 21, 2020 11:00
@Anush What I would call "the subset construction" always has 2^n states, and is fast to compute wrt the size of the output. I guess you want the reachable part of it, or maybe any DFA that accepts the same language? In the first case, you can check correctness as suggested by @Bubbler. Also worth considering: are the states required to be numbers? Consecutive ones?
Apr 20, 2020 16:00
In other word: the automaton has read more of the left string than the first machine or the pseudocode algorithm would have read from it, so what was read too early is memorized in the state
Apr 20, 2020 15:54
(unless I also mixed it up in other places. I do get confused which I called L and which I called R)
Apr 20, 2020 15:52
less
Apr 20, 2020 15:49
About L_{c,w}, c is the current edit distance of the right word read so far, and the left word without the letters of w. It corresponds to a situation when the left reading head is behind the right one. It's exactly the same c as in the pseudocode
Apr 20, 2020 15:42
At the end, the reading head has passed the word and is behind it
Apr 20, 2020 15:38
I'm not sure what your question is. But note that head has two meanings here: head of a list: first element. And the reading head of a machine that operates with tapes.
Apr 20, 2020 15:31
@Anush tail(l)=bcd, behind the word: after d (if we agree to start at a), it's when we have worked through all the input
Apr 20, 2020 14:07
@Anush Checking that automata accept the same language is possible. I wonder if there would be any interesting answers that don't just call a library, especially if you make it a fastest-code challenge
Apr 20, 2020 11:46
@Anush Sure
Apr 20, 2020 11:18
@Anush Fixed.
Apr 20, 2020 11:09
@Anush I don't know what more to say than I did in my math.SE answer (except there is a bug in the pseudocode). NFA to DFA conversion is not needed for understanding the NFA.