Geschreven door studenten die geslaagd zijn Direct beschikbaar na je betaling Online lezen of als PDF Verkeerd document? Gratis ruilen 4,6 TrustPilot
logo-home
Overig

COS2601 Assignment 2 Year 2023

Beoordeling
5.0
(1)
Verkocht
7
Pagina's
7
Geüpload op
23-05-2023
Geschreven in
2022/2023

Complete Solutions to COS2601 Assignment 2 for the year 2023. Please note this is programming-language fluid and may not be 100% as per your chosen programming language.

Instelling
Vak

Voorbeeld van de inhoud

Question 1a
Universal Set:

The appropriate universal set for this language is the set of all possible strings over the alphabet Σ =
{a, b}. Let's denote this set as U.


Question 1b
The generators of ODDnotAB can be defined as follows:

The empty string ε is a generator of ODDnotAB.
For any string x in ODDnotAB, the strings xa and xb are also generators of ODDnotAB.


Question 1c
Function on the Universal Set:

We need to define a function on the universal set that determines whether a given string belongs to
ODDnotAB or not. Let's denote this function as isInODDnotAB(x), where x is a string from the
universal set U. The function isInODDnotAB(x) returns true if x belongs to ODDnotAB, and false
otherwise.


Question 1d
Recursive Definition of ODDnotAB:

Using the concepts described above, we can write the recursive definition for the language
ODDnotAB as follows:

1. Base Cases:
a) The empty string ε is in ODDnotAB.
isInODDnotAB(ε) = true
b) Strings of length 1:
For any single character string x, isInODDnotAB(x) = true.

2. Recursive Cases:
a) If x is a string in ODDnotAB, then the strings xa and xb are also in ODDnotAB.
isInODDnotAB(xa) = isInODDnotAB(x)
isInODDnotAB(xb) = isInODDnotAB(x)

b) If x is a string in ODDnotAB, then the strings xaa and xab are also in ODDnotAB.
isInODDnotAB(xaa) = isInODDnotAB(x)
isInODDnotAB(xab) = isInODDnotAB(x)

c) If x is a string in ODDnotAB, then the strings xba and xbb are also in ODDnotAB.
isInODDnotAB(xba) = isInODDnotAB(x)
isInODDnotAB(xbb) = isInODDnotAB(x)

By using these base cases and recursive cases, we can determine whether a given string belongs to the
language ODDnotAB or not.

Geschreven voor

Instelling
Vak

Documentinformatie

Geüpload op
23 mei 2023
Aantal pagina's
7
Geschreven in
2022/2023
Type
OVERIG
Persoon
Onbekend

Onderwerpen

$6.35
Krijg toegang tot het volledige document:

Verkeerd document? Gratis ruilen Binnen 14 dagen na aankoop en voor het downloaden kun je een ander document kiezen. Je kunt het bedrag gewoon opnieuw besteden.
Geschreven door studenten die geslaagd zijn
Direct beschikbaar na je betaling
Online lezen of als PDF

Beoordelingen van geverifieerde kopers

Alle reviews worden weergegeven
2 jaar geleden

2 jaar geleden

Thank You. All the best, Learn2Progress

5.0

1 beoordelingen

5
1
4
0
3
0
2
0
1
0
Betrouwbare reviews op Stuvia

Alle beoordelingen zijn geschreven door echte Stuvia-gebruikers na geverifieerde aankopen.

Maak kennis met de verkoper

Seller avatar
De reputatie van een verkoper is gebaseerd op het aantal documenten dat iemand tegen betaling verkocht heeft en de beoordelingen die voor die items ontvangen zijn. Er zijn drie niveau’s te onderscheiden: brons, zilver en goud. Hoe beter de reputatie, hoe meer de kwaliteit van zijn of haar werk te vertrouwen is.
Learn2Progress Learn2Progress
Volgen Je moet ingelogd zijn om studenten of vakken te kunnen volgen
Verkocht
75
Lid sinds
3 jaar
Aantal volgers
63
Documenten
15
Laatst verkocht
1 jaar geleden

4.6

5 beoordelingen

5
4
4
0
3
1
2
0
1
0

Recent door jou bekeken

Waarom studenten kiezen voor Stuvia

Gemaakt door medestudenten, geverifieerd door reviews

Kwaliteit die je kunt vertrouwen: geschreven door studenten die slaagden en beoordeeld door anderen die dit document gebruikten.

Niet tevreden? Kies een ander document

Geen zorgen! Je kunt voor hetzelfde geld direct een ander document kiezen dat beter past bij wat je zoekt.

Betaal zoals je wilt, start meteen met leren

Geen abonnement, geen verplichtingen. Betaal zoals je gewend bent via iDeal of creditcard en download je PDF-document meteen.

Student with book image

“Gekocht, gedownload en geslaagd. Zo makkelijk kan het dus zijn.”

Alisha Student

Bezig met je bronvermelding?

Maak nauwkeurige citaten in APA, MLA en Harvard met onze gratis bronnengenerator.

Bezig met je bronvermelding?

Veelgestelde vragen