COMP 455: Models and languages of Computation Homework 3Matlab

Java Python Homework Assignment 3:

COMP 455: Models and languages of Computation

DEADLINE: 11:59 P.M., Wednesday, Oct 16, 2024

Problem 1: (16 points; 4 parts) Design CFGs for the following languages. Follow the format presented in the class for specifying CFGs.

1.1 (4 points) L consists of all the strings over the alphabet {0, 1} which contain at least three 0’s or at least two 1’s.

1.2 (4 points) L = {w010w ′ | w, w′ ∈ {0, 1}*and |w| = |w ′ |}

1.3 (4 points) L is the language over the alphabet {a, b, c} given by L = {a i b j c k | i = j ri = k, and i, j, k ≥ 1}.

1.4 (4 points) The alphabet is {a, b, c, d} and L = {a nb mc md n | n, m ≥ 0}

Problem 2: (10 points; 4 parts) Let w = (())()(). Consider the grammar:

S → SS | (S) | ()

2.1 (4 points) Construct a parse tree whose yield is w.

2.2 (2 points) G

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值