0% found this document useful (0 votes)
4 views3 pages

CSC_319_Assignment_Solution_Final_Updated

The document outlines solutions for a CSC 319 assignment, including a DFA for the language L = {0101* + 0100} and an NFA for the language x*y*z*. It details the transition tables and diagrams for both the DFA and NFA, as well as the steps for converting an NFA to a DFA. The converted DFA's transition table is also provided.

Uploaded by

dennytissy2022
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
4 views3 pages

CSC_319_Assignment_Solution_Final_Updated

The document outlines solutions for a CSC 319 assignment, including a DFA for the language L = {0101* + 0100} and an NFA for the language x*y*z*. It details the transition tables and diagrams for both the DFA and NFA, as well as the steps for converting an NFA to a DFA. The converted DFA's transition table is also provided.

Uploaded by

dennytissy2022
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 3

CSC 319 Assignment Solution

Matric: 220591137

Name: Fatunke Joseph Iyanuoluwa

Department: Computer Science

1. DFA for L = {0101* + 0100}

The DFA is constructed to accept:


- Strings that start with '0101' followed by any number of '1's (0101*).
- The exact string '0100'.
The transition table and diagram are shown below.

DFA Transition Table

| Current State | Input 0 | Input 1 | Accepting? |


|--------------|---------|---------|------------|
| q0 | q1 | - | No |
| q1 | - | q2 | No |
| q2 | q3 | - | No |
| q3 | q5 | q4 | No |
| q4 | - | q4 | Yes (0101*) |
| q5 | - | - | Yes (0100) |

2. NFA for Language x*y*z*

The NFA accepts strings with:


- Any number of 'x's (including none).
- Followed by any number of 'y's.
- Followed by any number of 'z's.
The transition table and diagram are shown below.

NFA Transition Table

| Current State | Input x | Input y | Input z | Empty (epsilon) | Accepting? |


|--------------|---------|---------|---------|-----------------|------------|
| q0 | - | - | - | q1 | No |
| q1 | q1 | - | - | q2 | No |
| q2 | - | q2 | - | q3 | No |
| q3 | - | - | q3 | - | Yes |
3. Conversion of NFA to DFA

3. Conversion of NFA to DFA


To convert an NFA to a DFA:
1. Find epsilon-closures: Identify states reachable via epsilon-transitions.
2. Construct DFA states: Each DFA state is a subset of NFA states.
3. Build DFA transitions: Determine next states based on input symbols.
4. Identify accepting states: Any DFA state containing an NFA final state is accepting.

The transition table and diagram are shown below.

Converted DFA Transition Table

| Current State | Input x | Input y | Input z | Accepting? |


|--------------|---------|---------|---------|------------|
| q0 | q1 | - | - | No |
| q1 | - | q2 | - | No |
| q2 | - | - | q3 | No |
| q3 | - | - | q4 | Yes |
| q4 | - | - | q4 | Yes |

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy