Escrito por estudiantes que aprobaron Inmediatamente disponible después del pago Leer en línea o como PDF ¿Documento equivocado? Cámbialo gratis 4,6 TrustPilot
logo-home
Document preview thumbnail
Vista previa 4 fuera de 45 páginas
Examen

Machine Learning (COS4852) - Complete Assignment 1 Solution: Boolean Functions, KNN, Decision Trees & ID3 Algorithm | Graded A+ | UNISA

Document preview thumbnail
Vista previa 4 fuera de 45 páginas

Ace Your COS4852 Assignment with this A+ Grade, Step-by-Step Solution! Are you struggling with the complexities of Machine Learning theory and algorithms? Stop stressing and start scoring! This document is the complete, fully worked-out solution to Assignment 1 for the University of South Africa's COS4852 Machine Learning module. It's your ultimate guide to mastering the core mathematical and algorithmic foundations of ML. This isn't just a set of answers; it's a detailed, explanatory walkthrough that breaks down every question, helping you not just to submit, but to truly understand the material. It's like having a personal tutor guide you through the toughest parts of the course. Here’s what you’ll get inside: Question 1 & 2: Boolean Algebra & Function Classes: A crystal-clear explanation of Boolean functions, literals, terms, clauses, and the crucial Disjunctive (DNF) and Conjunctive (CNF) Normal Forms. We break down complex concepts like Decision Lists, Symmetric Functions, and Linearly Separable Functions with ease. Question 3: K-Nearest Neighbours (KNN): A practical, example-driven solution to the KNN classification algorithm. We demonstrate how to calculate Euclidean distance step-by-step and show you exactly how to classify a new data point. We even discuss the critical choice of the 'K' value! Question 4: Find-S & Find-G Algorithms: A deep dive into the Version Space. We visually and mathematically demonstrate how the Find-S (most specific) and Find-G (most general) algorithms work, using a unique "donut" hypothesis space example. We even show you how to find the S- and G- boundary sets. Question 5: Building Binary Decision Trees: We take Boolean functions and teach you how to construct, simplify, and optimize Binary Decision Trees from scratch. You'll see multiple examples, including how a different root node selection can change the tree's structure. Question 6: The ID3 Algorithm (The Crown Jewel): This is the most important part! We provide a complete, step-by-step application of the famous ID3 decision tree learning algorithm. We calculate Entropy, Information Gain, and build a full decision tree from a given truth table, demonstrating every mathematical step. This is the number one skill you need to master for this module! Why this document is a lifesaver: 100% Worked Solutions: Every calculation is shown, from entropy formulas to distance measures. Perfect for Revision: Clear, concise, and structured to help you revise quickly before exams. Avoid Common Mistakes: By seeing the correct methodology, you'll avoid the pitfalls that cost students marks. Visual Learning: Includes diagrams and decision trees to help you visualize the algorithms. Stop wasting time trawling through textbooks. Get the complete solution, understand the logic behind it, and secure your top grade with confidence. Download now and get the marks you deserve!

Vista previa del contenido

University
of South
Africa
Department of Computer
Science
School of Computing

Module: Machine Learning COS4852
First names: Siviwe Shadrack
Surname: Khathangana
Student Number: 67799124

,Table of Content Page
Question 1 1
Question 2 2-5
Question 3 6-8
Question 4 8-16
Question 5 17-26
Question 6 27-45

,1


Question 1
Introduction to Machine Learning, Nils J. Nilsson, 1998

 URL: https://ai.stanford.edu/~nilsson/MLBOOK.pdf
 Size: 2,56 MB
A first encounter with Machine Learning, Max Welling, 2011

 URL:https://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.360.4637&rep=rep
1&type=pdf
 Size: 415 KB

, 2


Question 2
Most significant notions about functions are most easily make use of special case of Boolean
functions. There are some major subclasses of Boolean functions that are used as
Hypothesis classes for function learning. For example a Boolean function, f (s1, s2,…, sn)
maps an n-tuple of (0,1) values to {0,1}. To represent the Boolean functions we make use of
Boolean algebra. The definition of Boolean algebra is the branch of algebra in which the
values of the variables are the truth values true and false, usually denoted 1 and 0,
respectively. Boolean algebra is a suitable notation to represent Boolean functions. Boolean
uses conjunctions ·, + and ¯. For example, the and function of two variables is written s1 ·
s2. By usage, the conjunction, “·” is normally quelled, and the and function is written s1s2.
s1s2 has a value 1 if and only if both a1 and a2 have value 1; if either s1 or s2 has a value 0,
s1s2 has a value 0. The (inclusive) or function of two variables is represented as s1+s2.
s1+s2 has value 1 if and only if either or both of s1 or s2 has a value 1; if both s1 and s2
have value 0, s1 + s2 has a value 0. The complement or negation of a variable, s. is
represent as ˜s. ˜s has a value 1 if and only if s has value 0; if s has a value 1, ˜s has a value
0. The definitions of Boolean functions are compactly given by the below rules
1+1 = 1, 1+0=1, 0+0=0
1·1=1, 1·0=0, 0·0=0 and
˜1=0, ˜0=1.
Sometimes the arguments and values of Boolean functions are expressed in terms of the
arguments of the constants T (True) and F (False) instead of 1 and 0, respectively. The
conjunctions · and + are each commutative and associative. As indicated for example,
s1(s2s3)=(s1,s2)s3 and both can be written as simply as s1,s2,s3 likewise for +. A Boolean
formula consisting of a single variable such as s1 is called an atom. One consisting either
single variable or its complement, such as ˜s1 is called a literal. The operations · and + do not
commute between themselves, instead we have DeMorgan’s laws below, which can be
confirmed using the above definitions. s1˜s2=˜s1+˜s2, and s1+˜s2=˜s1˜s2.

Boolean functions can also represented using Diagrams, we can use a labelled vertices of
cube. To represent a function of n variables, we can use n-dimensional hypercube. It is easy
to see how many Boolean functions of n dimensions using hypercube representation. One
diagrammatic technique for dimensions slightly higher than is the Karnaugh map. Karnaugh
map is used to simplify Boolean expressions where you have more than two variables.
Karnaugh Maps are quicker and easier to use than other simplification methods, including
computerized ones for Boolean expressions that contain between two and six variables. For
Boolean expressions with one to three variables, Boolean algebra is the best method. For
those expressions that contain more than six variables, computerized methods are best. In a
K-map, crossing a vertical or horizontal cell boundary is always a change of only one
variable.

Información del documento

Subido en
18 de agosto de 2026
Número de páginas
45
Escrito en
2026/2027
Tipo
Examen
Contiene
Preguntas y respuestas
$16.49

¿Documento equivocado? Cámbialo gratis Dentro de los 14 días posteriores a la compra y antes de descargarlo, puedes elegir otro documento. Puedes gastar el importe de nuevo.
Escrito por estudiantes que aprobaron
Inmediatamente disponible después del pago
Leer en línea o como PDF

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.
MYNET
3.8
(44)
Vendido
232
Seguidores
16
Artículos
1633
Última venta
4 días hace



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