简体   繁体   English

如何为偶数十进制数构造有限自动机?

[英]How can I construct a finite automaton for even decimal numbers?

I have to do this exercise and am completely stumped as to how. 我必须做这个练习,并且完全难以理解。 I've constructed some FA's before, but using binary numbers. 我之前构建了一些FA,但是使用了二进制数。 How can I do this but for even decimal numbers? 我怎么能这样做,但偶数十进制数?

It would be a simple one. 这将是一个简单的。

2 states: q1, q2. 2个州:q1,q2。

  • q1 is initial state. q1是初始状态。
  • q2 is final state. q2是最终状态。
  • if input digit on q1 is any even digit, make a move to q2. 如果q1上的输入数字是任何偶数位,则移至q2。
  • if input digit on q1 is any odd digit, remain on q1. 如果q1上的输入数字是任何奇数,则保持在q1上。
  • if input digit on q2 is any even digit, remain on q2. 如果q2上的输入数字是任何偶数位,则保持在q2上。
  • if input digit on q2 is any odd digit, make a move back to q1. 如果q2上的输入数字是任何奇数位,则返回q1。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何在 javascript 中添加购物车中的数字并正确显示小数点后的数字 - How can I add numbers as in a shopping cart in javascript and display them properly with the numbers after the decimal points 如何更新表格以在数字中的固定位置插入小数点? - How can I update a table to insert decimal points at a fixed position in numbers? 如何使 ar plot 上的 y 轴以带逗号的十进制格式显示数字? - How can I make the y axis on a r plot display numbers in decimal format with commas? 如何确定小数点后有一定数量的数字(零位跟踪) - How can i make sure there is a certain amount of numbers in a decimal (trailing zeros) 如何在此正则表达式中包含负十进制数? - How do I include negative decimal numbers in this regular expression? 当我在clojure中划分数字时,我得到一小部分,我如何得到小数? - When I divide numbers in clojure I get a fraction , how do I get the decimal? jQuery如何在检查中使用小数 - jquery how to use decimal numbers in if checkup 如何在xslt 1.0的子字符串中添加十进制数字 - How to add decimal numbers in xslt 1.0 in substrings 如何在我的 js 计算器上区分小数逗号和小数点? - How can I differentiate decimal comma and decimal point on my js calculator? 我正在尝试将数字转换为货币并添加带 2 个小数点的数字 - I am trying to convert numbers to currency and add numbers with 2 decimal points
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM