hws/hw02.tex
changeset 891 00ffcd796ffb
parent 889 00c1c3408c93
child 916 10f834eb0a9e
equal deleted inserted replaced
890:646f985b512e 891:00ffcd796ffb
   121 
   121 
   122 \item Give regular expressions for (a) decimal numbers and for
   122 \item Give regular expressions for (a) decimal numbers and for
   123       (b) binary numbers. Hint: Observe that the empty string
   123       (b) binary numbers. Hint: Observe that the empty string
   124       is not a number. Also observe that leading 0s are
   124       is not a number. Also observe that leading 0s are
   125       normally not written---for example the JSON format for numbers
   125       normally not written---for example the JSON format for numbers
   126       explicitly forbids this.
   126       explicitly forbids this. So 007 is not a number according to JSON.
   127 
   127 
   128       \solution{Just numbers without leading 0s: $0 + (1..9)\cdot(0..1)^*$;
   128       \solution{Just numbers without leading 0s: $0 + (1..9)\cdot(0..1)^*$;
   129         can be extended to decimal; similar for binary numbers
   129         can be extended to decimal; similar for binary numbers
   130       }
   130       }
   131 
   131