100% de satisfacción garantizada Inmediatamente disponible después del pago Tanto en línea como en PDF No estas atado a nada 4,6 TrustPilot
logo-home
Examen

COS2601 EXAM PACK 2025 {DETAILED QUESTIONS AND ANSWERS }

Puntuación
-
Vendido
-
Páginas
55
Grado
A+
Subido en
27-12-2024
Escrito en
2024/2025

COS2601 EXAM PACK 2025 {DETAILED QUESTIONS AND ANSWERS }

Institución
Grado











Ups! No podemos cargar tu documento ahora. Inténtalo de nuevo o contacta con soporte.

Escuela, estudio y materia

Institución
Grado

Información del documento

Subido en
27 de diciembre de 2024
Número de páginas
55
Escrito en
2024/2025
Tipo
Examen
Contiene
Preguntas y respuestas

Temas

Vista previa del contenido

lOMoAR cPSD| 49343224




Downloaded by Vincent master ()

, lOMoAR cPSD| 49343224




Question 1 [15 marks]

A recursive definition for the language ODDnotAB over
the alphabet ∑ = {a b} must be compiled where
ODDnotAB has as elements all words that are of odd
length and do not contain the ab-substring.

Give (i) an appropriate universal set,
(ii) the generator(s) of ODDnotAB, and
(iii) an appropriate function on the universal
set, and then
(iv) use these concepts to write down a
recursive definition of the language ODDnotAB.

Answer

(i) The set {a b}* will be suitable because it contains,
along with other words, all the words that are in the
language ODDnotAB.

(ii) The generators are a and b. Note that the
generator(s) is/are always the shortest word(s) in a
language.

(iii) The function CONCAT as defined in learning unit
3, will be suitable. You can see how this function
has been used in Activity 3.1 in learning unit 3.

(iv) We give two possible recursive definitions. Note
the words in ODDnotAB have an odd number of
letters. Both generators have an odd number of
letters; therefore, to keep the length of new
generated words odd, we concatenate two letters at
a time. We also need to ensure that when we
concatenate strings to form new words that we do




Downloaded by Vincent master ()

, lOMoAR cPSD| 49343224




not add a word that starts with a b to a word that
ends with an a – this would result in words that
contain an ab-substring, and these words are not in
ODDnotAB. We will also not attempt to
concatenate the ab-substring to any existing words
in ODDnotAB as these words would also not be in
ODDnotAB.

ODDnotAB is the smallest
subset of {a b}* such that a,
b ODDnotAB

and if w ODDnotAB, then also
CONCAT(bb, w), CONCAT(w, aa)
ODDNOTAB, and

if w ODDNOTAB and w does not
end on a, then CONCAT(w, ba),
CONCAT(w, bb) ODDNOTAB,

if w ODDNOTAB and w does not begin with b, then
CONCAT(aa, w), CONCAT(ba, w) ODDNOTAB.
(this mark only once)

OR

Rule 1: a, b ODDNOTAB.
Rule 2: If w ODDNOTAB then
CONCAT(bb,w), CONCAT(w,aa)
ODDNOTAB, and if w
ODDNOTAB and w does not end on a,
then CONCAT(w,ba), CONCAT(w,
bb) ODDNOTAB, if w
ODDNOTAB and w does not begin with
b, then CONCAT(aa,w),
CONCAT(ba,w) ODDNOTAB.



Downloaded by Vincent master ()

, lOMoAR cPSD| 49343224




Rule 3: Only words generated by rules 1 and 2 are in
ODDNOTAB.


Question [15 marks]
2

This question has three parts and tests mathematical
induction.

(i) Give a recursive definition of the set P of all
positive integers greater than 0,
(ii) formulate the appropriate induction principle, and
then
(iii) use mathematical induction to prove that

11 + 15 + 19 + … + (4n + 7) = 2n2 + 9n

for all positive integers n > 0.

Answer

(i)P is the smallest subset of ę such that 1 P and if k
P then also k+1 P.
Another correct recursive definition for P is:

Rule 1: 1 P
Rule 2: If k P, then also k+1 P
Rule 3: Only elements generated by the above rules are in
P.

(ii) The applicable induction principle is:

If a subset A of P is such that 1 A and if k A
then also k+1 A, then A = P.



Downloaded by Vincent master ()
$2.65
Accede al documento completo:

100% de satisfacción garantizada
Inmediatamente disponible después del pago
Tanto en línea como en PDF
No estas atado a nada

Conoce al vendedor

Seller avatar
Los indicadores de reputación están sujetos a la cantidad de artículos vendidos por una tarifa y las reseñas que ha recibido por esos documentos. Hay tres niveles: Bronce, Plata y Oro. Cuanto mayor reputación, más podrás confiar en la calidad del trabajo del vendedor.
Jennifer2024 University of South Africa
Seguir Necesitas iniciar sesión para seguir a otros usuarios o asignaturas
Vendido
1255
Miembro desde
2 año
Número de seguidores
347
Documentos
1235
Última venta
1 semana hace
Jennifer2024

On this page, you find all documents, package deals, and flashcards offered by seller Jennifer2024.

3.7

123 reseñas

5
54
4
18
3
30
2
7
1
14

Recientemente visto por ti

Por qué los estudiantes eligen Stuvia

Creado por compañeros estudiantes, verificado por reseñas

Calidad en la que puedes confiar: escrito por estudiantes que aprobaron y evaluado por otros que han usado estos resúmenes.

¿No estás satisfecho? Elige otro documento

¡No te preocupes! Puedes elegir directamente otro documento que se ajuste mejor a lo que buscas.

Paga como quieras, empieza a estudiar al instante

Sin suscripción, sin compromisos. Paga como estés acostumbrado con tarjeta de crédito y descarga tu documento PDF inmediatamente.

Student with book image

“Comprado, descargado y aprobado. Así de fácil puede ser.”

Alisha Student

Preguntas frecuentes