hws/hw02.tex
changeset 891 4b1c96ab1c57
parent 889 c40a182af075
child 916 2ab96407f350
equal deleted inserted replaced
890:1bb5e4955d4d 891:4b1c96ab1c57
   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