100% satisfaction guarantee Immediately available after payment Both online and in PDF No strings attached 4.2 TrustPilot
logo-home
Other

COS Assignment 2 solution

Rating
-
Sold
3
Pages
4
Uploaded on
06-06-2023
Written in
2022/2023

Contains the discussion and solutions of the second assignment

Institution
Course








Whoops! We can’t load your doc right now. Try again or contact support.

Connected book

Written for

Institution
Course

Document information

Uploaded on
June 6, 2023
Number of pages
4
Written in
2022/2023
Type
Other
Person
Unknown

Subjects

Content preview

COS2601 2023 Assignment 2
Discussion
Q1
a) The appropriate universal set for the language ODDnotAB is the set of all words over the
alphabet Σ = {a, b}.

b) The generator(s) of ODDnotAB are as follows:
i) The empty string ε.
ii) The single characters a and b.

c) The function on the universal set is defined as follows:
i) If x is a word in ODDnotAB, then ax is also in ODDnotAB.
ii) If x is a word in ODDnotAB, then bx is also in ODDnotAB.

d) Using these concepts, the recursive definition of the language ODDnotAB is as follows:

i) ε ∈ ODDnotAB
ii) a ∈ ODDnotAB
iii) b ∈ ODDnotAB
iv) If x ∈ ODDnotAB, then ax ∈ ODDnotAB
v) If x ∈ ODDnotAB, then bx ∈ ODDnotAB

This definition states that the language ODDnotAB includes the empty string ε, the single
characters a and b, and any word obtained by appending an 'a' or a 'b' to a word already in
ODDnotAB.


Q2
a) Recursive Definition of Set P:
We can define the set P of all positive integers greater than 0 recursively as follows:
Base Case: 1 is in P.
Recursive Case: If n is in P, then (n + 1) is also in P.
In simpler terms, the set P includes 1, and if a number n is in P, then the number (n + 1) is also in P.
b) Induction Principle:
The appropriate induction principle for this proof is the Principle of Mathematical Induction. It
consists of two steps:
1. Base Step: We need to show that the given statement holds true for the base case, which is n = 1.
2. Inductive Step: We assume that the statement is true for a particular positive integer k and then
prove that it holds for the next positive integer k + 1.
c) Proof by Mathematical Induction:

Get to know the seller

Seller avatar
Reputation scores are based on the amount of documents a seller has sold for a fee and the reviews they have received for those documents. There are three levels: Bronze, Silver and Gold. The better the reputation, the more your can rely on the quality of the sellers work.
CrystalIndigo University of South Africa (Unisa)
Follow You need to be logged in order to follow users or courses
Sold
486
Member since
5 year
Number of followers
226
Documents
73
Last sold
1 month ago
CrystalIndigo Solutions

providing all solutions to all computer science modules

4.1

51 reviews

5
27
4
13
3
6
2
1
1
4

Recently viewed by you

Why students choose Stuvia

Created by fellow students, verified by reviews

Quality you can trust: written by students who passed their tests and reviewed by others who've used these notes.

Didn't get what you expected? Choose another document

No worries! You can instantly pick a different document that better fits what you're looking for.

Pay as you like, start learning right away

No subscription, no commitments. Pay the way you're used to via credit card and download your PDF document instantly.

Student with book image

“Bought, downloaded, and aced it. It really can be that simple.”

Alisha Student

Frequently asked questions