Written by students who passed Immediately available after payment Read online or as PDF Wrong document? Swap it for free 4.6 TrustPilot
logo-home
Document preview thumbnail
Preview 4 out of 45 pages
Exam (elaborations)

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

Document preview thumbnail
Preview 4 out of 45 pages

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!

Content preview

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.

Document information

Uploaded on
August 18, 2026
Number of pages
45
Written in
2026/2027
Type
Exam (elaborations)
Contains
Questions & answers
$16.49

Wrong document? Swap it for free Within 14 days of purchase and before downloading, you can choose a different document. You can simply spend the amount again.
Written by students who passed
Immediately available after payment
Read online or as PDF

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.
MYNET
3.8
(44)
Sold
232
Followers
16
Items
1633
Last sold
4 days ago



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

Working on your references?

Create accurate citations in APA, MLA and Harvard with our free citation generator.

Working on your references?

Frequently asked questions