You are on page 1of 6

Computing Theory Assignment Page 1 of 6

CT111-2-3 COMPUTING THEORY

ASSIGNMENT SCENARIO

Most programming languages support a number of Iterative and/or Recursive constructs,


such as loops (e.g., For, While, Do…While, Loop…Until, Label…Return, Goto…Return,
etc.) and recursion (e.g., recursive functions, recursive statements).

ITERATIVE
1. Do while
2. While
3. For

RECURSIVE
1. Method that calls itself

Choose a programming language that supports at least one of the above, and specify the chosen
programming language and the chosen construct.

JAVA
Iterative construct

The tasks in the Parts A and B of this assignment relate to this given assignment scenario.
Answer the given tasks accordingly.

Learning Outcomes

The coursework is 50% of the assessment for the module.

Demonstrate the working of automata to generate regular Part A


1 expressions for specified languages (C3,PLO7) (30%)

2 Demonstrate complexity and computability of problems Part B


(A3,PLO9) (20%)

WEEK ASSIGNED Week 3


SUBMISSION - PART-A (Automata) Week 8
SUBMISSION - PART-B (Complexity) Week 12

Asia Pacific University of Technology and Innovation 2021


Computing Theory Assignment Page 2 of 6

Assessment Criteria

IMPORTANT: This is a group assignment. All submitted components must be the work of the
group or appropriately accredited. All members of the group MUST contribute
and gain the necessary competence in all parts of the assignment.

Referencing: If you use ideas from external sources, e.g. books / magazines / internet /
forums, then proper citation should be done using the APA Name convention
within your solution. Failure to reference design / ideas properly is considered
as plagiarism.

GROUP ASSIGNMENT (PART A - AUTOMATA)


TECHNOLOGY PARK MALAYSIA

CT111-2-3-COMT

COMPUTING THEORY

HAND OUT DATE: REFER MOODLE

HAND IN DATE: REFER MOODLE

WEIGHTAGE: 30%

INSTRUCTIONS TO CANDIDATES:

1 Submit your assignment online via the submission folder provided on Webspace.

2 Students are advised to underpin their answers with the use of references (cited using
the Harvard Name System of Referencing).

3 Late submission will be awarded zero (0) unless Extenuating Circumstances (EC) are
upheld.

Asia Pacific University of Technology and Innovation 2021


Computing Theory Assignment Page 3 of 6

4 Cases of plagiarism will be penalized.

5 The assignment should be bound in an appropriate style (comb bound or stapled).

6 Where the assignment should be submitted in both hardcopy and softcopy, the softcopy
of the written assignment and source code (where appropriate) should be on a CD in an
envelope / CD cover and attached to the hardcopy.

PART A: Automata

This Part consists of 3 tasks with a total of 30 marks,


and contributes 30% to the overall module marks.

i) Design a Non-deterministic Finite Automata (NFA) for the syntax of the chosen construct.
Note that the NFA must cover the generic syntax of the construct, and not be limited to just
a specific sample code. The syntax covers all valid code for the construct, hence the NFA
must accept all valid code, whilst rejecting all invalid code.
For loop
Generic syntax:

for(initialization; condition; increment/decrement){    
//statement or code to be executed    
}    

Sample code:
//Java Program to demonstrate the example of for loop  
//which prints table of 1  
public class ForExample {  
public static void main(String[] args) {  
    //Code of Java for loop  
   for(int i=1;i<=10;i++){  
        System.out.println(i);  
    }  
}  
}  

[10 Marks]

Asia Pacific University of Technology and Innovation 2021


Computing Theory Assignment Page 4 of 6

ii) Provide the corresponding quintuple and state transition table for the NFA. Reminder:
the state transition table columns represent non-overlapping components of the language
alphabet (i.e. any shortcuts/notations used to group components of the alphabet must be
done very carefully).

[10 Marks]

iii) Generate the related Regular Expression from the NFA, showing all the steps in the
conversion process.

[10 Marks]

Guideline: Length approximately 200 words.

Deliverables (Part – A)

You are required to submit:

Documentation (upload a single document to the module submission folder in Webspace)

1. Cover page (include names and TP number of all group members)


2. Results (Part A)
3. References

Asia Pacific University of Technology and Innovation 2021


GROUP ASSIGNMENT (PART B - COMPLEXITY)
TECHNOLOGY PARK MALAYSIA

CT111-2-3-COMT

COMPUTING THEORY

HAND OUT DATE: REFER MOODLE

HAND IN DATE: REFER MOODLE

WEIGHTAGE: 20%

INSTRUCTIONS TO CANDIDATES:

1 Submit your assignment online via the submission folder provided in Webspace
2 Students are advised to underpin their answers with the use of references (cited using
the Harvard Name System of Referencing)
3 Late submission will be awarded zero (0) unless Extenuating Circumstances (EC) are
upheld
4 Cases of plagiarism will be penalized
5 The assignment should be bound in an appropriate style (comb bound or stapled).
6 Where the assignment should be submitted in both hardcopy and softcopy, the softcopy
of the written assignment and source code (where appropriate) should be on a CD in an
envelope / CD cover and attached to the hardcopy.
Computing Theory Assignment Page 6 of 6

PART B: Complexity

This Part consists of 2 tasks with a total of 20 marks,


and contributes 20% to the overall module marks.

i) Specify a short snippet of a program code that employs the construct from Part A,
indicating the Best Case and Worst Case complexities of the code snippet. For each case,
specify the situation that gives rise to the best or worst case, the number of operations
required and the corresponding Big-O notation.

[10 Marks]

ii) Discuss the Computability of the snippet in (i), providing sufficient justification for your
explanation. Computability of the program code snippet must be discussed in terms of the
3 characteristics of computability, as discussed in the lectures. Based on those, provide the
overall conclusion to the computability of the snippet.

[10 Marks]

Guideline: Length approximately 200 words.

Deliverables

You are required to submit:

Documentation (upload a single document to the module submission folder in Webspace)

1. Cover page (include the names and TP numbers of the group members)
2. Results (Part B)
3. References

Asia Pacific University of Technology and Innovation 2021

You might also like