由买买提看人间百态

boards

本页内容为未名空间相应帖子的节选和存档,一周内的贴子最多显示50字,超过一周显示500字 访问原贴
Science版 - Re: automata question.高手救命
相关主题
Re: Has anyone read A New Kind of Science?粤语浅谈
Is the world deterministic?Ask an interveiw question: finding phone number
两将军问题$8000的最后一天房子被抢了@@@
“决定性”和“非决定性”该怎么翻译??how to tell something is copolymer
Re: what are the english words for these symbols?请教Reapeated measure mixed model
Re: 请教在Matlab中有没有求矢量散度和旋度的函数面试就是面试问题,跟实际问题差太远
Re: Symbol function/eigenvalueA家面试题
mathematica 和 C/C++的混合编程 -observer这2个laptops哪一个更值些?
相关话题的讨论汇总
话题: symbol话题: automata话题: pda话题: what
进入Science版参与讨论
1 (共1页)
A***e
发帖数: 130
1
yes, non-deterministic
roughly to say,
use separate path, each compare the i-th symbol in A and B, where i=1, ... |A|
if any pair is different, output "yes".
Because i is finite, the above automata (actually a PDA) works.
c*****t
发帖数: 1879
2
A bit strange how your i is defined. What did you mean by finite?
I remembered that I posted a solution in this board for L != ww by giving a
formula. Couldn't find it anymore :(
It was something like:
L = AB | BA | A | B
A = aAa | aAb | bAa | bAb | a
B = aBb | aBb | bBa | bBb | b
The trick was that A and B had different centers.
I guess that for this problem, should be nearly the same.
Or, one could argue that given L != ww is in CFG, one could always
build a stack machi

【在 A***e 的大作中提到】
: yes, non-deterministic
: roughly to say,
: use separate path, each compare the i-th symbol in A and B, where i=1, ... |A|
: if any pair is different, output "yes".
: Because i is finite, the above automata (actually a PDA) works.

A***e
发帖数: 130
3
The main point is the non-deterministic: we can construct
the following PDA:
for each input symbol, depending on what it is and what's the current state
of the PDA, we can do the following actions (with the help of two flags:
A: having passed symbol c or not, and B: having passed the particular symbol for
comparison or not):
1) if it's not c, and the current state has neither flag A nor B set then:
(a) push it onto the stack
-or-
(b) store the symbol into the current state a

【在 c*****t 的大作中提到】
: A bit strange how your i is defined. What did you mean by finite?
: I remembered that I posted a solution in this board for L != ww by giving a
: formula. Couldn't find it anymore :(
: It was something like:
: L = AB | BA | A | B
: A = aAa | aAb | bAa | bAb | a
: B = aBb | aBb | bBa | bBb | b
: The trick was that A and B had different centers.
: I guess that for this problem, should be nearly the same.
: Or, one could argue that given L != ww is in CFG, one could always

A***e
发帖数: 130
4

hmm, by the meaning of "non-deterministic", each sequence of
choices of a/b in case1 (i.e., one path) will only compare *one* symbol in A
and B., and there are multiple paths. In the example you gave, 1100c1100,
there are 4 paths, 1xxxc1, #1xxc#1, ##0xc##0, and ###0c###0, all of them
do not accept. 'x' means taking no action at all, # means that the symbol
will be pushed onto the stack but what it actually is does not matter, only
the it's count matters.
So, there is no need to reverse, and act

【在 c*****t 的大作中提到】
: A bit strange how your i is defined. What did you mean by finite?
: I remembered that I posted a solution in this board for L != ww by giving a
: formula. Couldn't find it anymore :(
: It was something like:
: L = AB | BA | A | B
: A = aAa | aAb | bAa | bAb | a
: B = aBb | aBb | bBa | bBb | b
: The trick was that A and B had different centers.
: I guess that for this problem, should be nearly the same.
: Or, one could argue that given L != ww is in CFG, one could always

c*****t
发帖数: 1879
5
I think that I got what you were saying and it was indeed correct.
Apparently, I didn't notice that you pop all the symbols until the
very last token (there are some technicality there, but definitely
doable) then do the comparison. Basically one comparison for each
non-deterministic path.
I think that it will be very difficult if not impossible to come up
with a CFG for this grammar.

【在 A***e 的大作中提到】
:
: hmm, by the meaning of "non-deterministic", each sequence of
: choices of a/b in case1 (i.e., one path) will only compare *one* symbol in A
: and B., and there are multiple paths. In the example you gave, 1100c1100,
: there are 4 paths, 1xxxc1, #1xxc#1, ##0xc##0, and ###0c###0, all of them
: do not accept. 'x' means taking no action at all, # means that the symbol
: will be pushed onto the stack but what it actually is does not matter, only
: the it's count matters.
: So, there is no need to reverse, and act

b***e
发帖数: 1419
6

A -> 0 | 1 -- alphabet
B -> c | ABA -- balanced string
U -> B(A+) | (A+)B -- unbalanced string
X -> 0 | AXA
X1 -> Xc | A(X1)A
X2 -> cX | A(X2)A
Y -> 1 | AYA
Y1 -> Yc | A(Y1)A
Y2 -> cY | A(Y2)A
S -> U | X(Y2) | (Y1)X | (X1)Y | Y(X2)

【在 c*****t 的大作中提到】
: I think that I got what you were saying and it was indeed correct.
: Apparently, I didn't notice that you pop all the symbols until the
: very last token (there are some technicality there, but definitely
: doable) then do the comparison. Basically one comparison for each
: non-deterministic path.
: I think that it will be very difficult if not impossible to come up
: with a CFG for this grammar.

1 (共1页)
进入Science版参与讨论
相关主题
这2个laptops哪一个更值些?Re: what are the english words for these symbols?
这个dell 15R算是deal么?Re: 请教在Matlab中有没有求矢量散度和旋度的函数
赌1千伪币,一星期内标普指数最少会碰1770Re: Symbol function/eigenvalue
NYSE:CFG IPO 23-25mathematica 和 C/C++的混合编程 -observer
Re: Has anyone read A New Kind of Science?粤语浅谈
Is the world deterministic?Ask an interveiw question: finding phone number
两将军问题$8000的最后一天房子被抢了@@@
“决定性”和“非决定性”该怎么翻译??how to tell something is copolymer
相关话题的讨论汇总
话题: symbol话题: automata话题: pda话题: what