Can someone explain this conclusion for Finite State Machines?
Clash Royale CLAN TAG#URR8PPP
up vote
1
down vote
favorite
PS It isn't a homework problem..
(But the results seems to be working for me when I checked manually a couple of values of m and n)
Let's say I have two FSM's(calling them A and B)
- A is the the machine for checking divisibility by any +ve number (calling it m)
- B is the the machine for checking divisibility by any +ve number (calling it n)
(m and n aren't equal)
Now we have a third machine (C) for which we need to find the number of states it will have if the goal of that machine is A machine(FSM) which will accept Divisibility of both $n$ and $m$)
So here are the claims for the count of states for $C$,
if $GCD (m,n)$ equivalent to $1$, then the number of states in C is $m*n$
if $GCD (m,n)$ isn't equivalent to $1$, then number of states in C is $LCM(m,n)$
(EDIT - Both are technically the same thing, check the comments and the answer)
Now I have checked the results for few m and m manually and they seem to be correct for them..
But why it's so?(I know that A and B will have m and n as count of states respectively for minimal DFA)
automata finite-automata
add a comment |Â
up vote
1
down vote
favorite
PS It isn't a homework problem..
(But the results seems to be working for me when I checked manually a couple of values of m and n)
Let's say I have two FSM's(calling them A and B)
- A is the the machine for checking divisibility by any +ve number (calling it m)
- B is the the machine for checking divisibility by any +ve number (calling it n)
(m and n aren't equal)
Now we have a third machine (C) for which we need to find the number of states it will have if the goal of that machine is A machine(FSM) which will accept Divisibility of both $n$ and $m$)
So here are the claims for the count of states for $C$,
if $GCD (m,n)$ equivalent to $1$, then the number of states in C is $m*n$
if $GCD (m,n)$ isn't equivalent to $1$, then number of states in C is $LCM(m,n)$
(EDIT - Both are technically the same thing, check the comments and the answer)
Now I have checked the results for few m and m manually and they seem to be correct for them..
But why it's so?(I know that A and B will have m and n as count of states respectively for minimal DFA)
automata finite-automata
add a comment |Â
up vote
1
down vote
favorite
up vote
1
down vote
favorite
PS It isn't a homework problem..
(But the results seems to be working for me when I checked manually a couple of values of m and n)
Let's say I have two FSM's(calling them A and B)
- A is the the machine for checking divisibility by any +ve number (calling it m)
- B is the the machine for checking divisibility by any +ve number (calling it n)
(m and n aren't equal)
Now we have a third machine (C) for which we need to find the number of states it will have if the goal of that machine is A machine(FSM) which will accept Divisibility of both $n$ and $m$)
So here are the claims for the count of states for $C$,
if $GCD (m,n)$ equivalent to $1$, then the number of states in C is $m*n$
if $GCD (m,n)$ isn't equivalent to $1$, then number of states in C is $LCM(m,n)$
(EDIT - Both are technically the same thing, check the comments and the answer)
Now I have checked the results for few m and m manually and they seem to be correct for them..
But why it's so?(I know that A and B will have m and n as count of states respectively for minimal DFA)
automata finite-automata
PS It isn't a homework problem..
(But the results seems to be working for me when I checked manually a couple of values of m and n)
Let's say I have two FSM's(calling them A and B)
- A is the the machine for checking divisibility by any +ve number (calling it m)
- B is the the machine for checking divisibility by any +ve number (calling it n)
(m and n aren't equal)
Now we have a third machine (C) for which we need to find the number of states it will have if the goal of that machine is A machine(FSM) which will accept Divisibility of both $n$ and $m$)
So here are the claims for the count of states for $C$,
if $GCD (m,n)$ equivalent to $1$, then the number of states in C is $m*n$
if $GCD (m,n)$ isn't equivalent to $1$, then number of states in C is $LCM(m,n)$
(EDIT - Both are technically the same thing, check the comments and the answer)
Now I have checked the results for few m and m manually and they seem to be correct for them..
But why it's so?(I know that A and B will have m and n as count of states respectively for minimal DFA)
automata finite-automata
automata finite-automata
edited 12 mins ago
asked 42 mins ago
Aditya
14313
14313
add a comment |Â
add a comment |Â
1 Answer
1
active
oldest
votes
up vote
2
down vote
accepted
In both cases, the number of states is the LCM. This is because a number is divisible by $m$ and $n$ if, and only if, it is divisible by $mathrmlcm(m,n)$ and, for any positive integer $d$, you can check that the input length is divisible by $d$ by having states $0, dots, d-1$ such that the automaton is in state $i$ when the number of characters read is congruent to $i$, modulo $d$.
Thanks a lot David! I forgot this simple but strong conclusion of LCM's and Divisibility!
– Aditya
16 mins ago
add a comment |Â
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
2
down vote
accepted
In both cases, the number of states is the LCM. This is because a number is divisible by $m$ and $n$ if, and only if, it is divisible by $mathrmlcm(m,n)$ and, for any positive integer $d$, you can check that the input length is divisible by $d$ by having states $0, dots, d-1$ such that the automaton is in state $i$ when the number of characters read is congruent to $i$, modulo $d$.
Thanks a lot David! I forgot this simple but strong conclusion of LCM's and Divisibility!
– Aditya
16 mins ago
add a comment |Â
up vote
2
down vote
accepted
In both cases, the number of states is the LCM. This is because a number is divisible by $m$ and $n$ if, and only if, it is divisible by $mathrmlcm(m,n)$ and, for any positive integer $d$, you can check that the input length is divisible by $d$ by having states $0, dots, d-1$ such that the automaton is in state $i$ when the number of characters read is congruent to $i$, modulo $d$.
Thanks a lot David! I forgot this simple but strong conclusion of LCM's and Divisibility!
– Aditya
16 mins ago
add a comment |Â
up vote
2
down vote
accepted
up vote
2
down vote
accepted
In both cases, the number of states is the LCM. This is because a number is divisible by $m$ and $n$ if, and only if, it is divisible by $mathrmlcm(m,n)$ and, for any positive integer $d$, you can check that the input length is divisible by $d$ by having states $0, dots, d-1$ such that the automaton is in state $i$ when the number of characters read is congruent to $i$, modulo $d$.
In both cases, the number of states is the LCM. This is because a number is divisible by $m$ and $n$ if, and only if, it is divisible by $mathrmlcm(m,n)$ and, for any positive integer $d$, you can check that the input length is divisible by $d$ by having states $0, dots, d-1$ such that the automaton is in state $i$ when the number of characters read is congruent to $i$, modulo $d$.
answered 20 mins ago


David Richerby
63.3k1596181
63.3k1596181
Thanks a lot David! I forgot this simple but strong conclusion of LCM's and Divisibility!
– Aditya
16 mins ago
add a comment |Â
Thanks a lot David! I forgot this simple but strong conclusion of LCM's and Divisibility!
– Aditya
16 mins ago
Thanks a lot David! I forgot this simple but strong conclusion of LCM's and Divisibility!
– Aditya
16 mins ago
Thanks a lot David! I forgot this simple but strong conclusion of LCM's and Divisibility!
– Aditya
16 mins ago
add a comment |Â
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fcs.stackexchange.com%2fquestions%2f99259%2fcan-someone-explain-this-conclusion-for-finite-state-machines%23new-answer', 'question_page');
);
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password