# Assignment: Discrete Maths

Want create site? With you can do it easy.

## Assignment: Discrete Maths

Assignment: Discrete Maths

Don't use plagiarized sources. Get Your Custom Essay on
Assignment: Discrete Maths
Just from \$13/Page

Based on the data in the following table,

(1) estimate a Bernoulli Naive Bayes classifer (using the add-one smoothing) (2) apply the classifier to the test document. (3) estimate a multinomial Naive Bayes classifier (using the add-one smoothing) (4) apply the classifier to the test document

You do not need to estimate parameters that you don’t need for classifying the test document.

docID words in document class = China?

training set 1 Taipei Taiwan Yes 2 Macao Taiwan Shanghai Yes 3 Japan Sapporo No 4 Sapporo Osaka Taiwan No

test set 5 Taiwan Taiwan Taiwan Sapporo Bangkok ?

Q2. (20 marks)

Algorithm 1: k-means(D, k)

Data: D is a dataset of n d-dimensional points; k is the number of clusters. Initialize k centers C = [c1, c2, . . . , ck];1

canStop ← false;2 while canStop = false do3

Initialize k empty clusters G = [g1, g2, . . . , gk];4

for each data point p ∈ D do5 cx ← NearestCenter(p, C);6 gcx .append(p);7

for each group g ∈ G do8 ci ← ComputeCenter(g);9

return G;10

1

2 DUE ON 23:59 1 NOV, 2013 (FRI)

Consider the (slightly incomplete) k-means clustering algorithm as depicted in Algo- rithm 1.

(1) Assume that the stopping criterion is till the algorithm converges to the final k clusters. Can you insert several lines of pseudo-code after Line 8 of the algorithm to implement this logic.

(2) The cost of k clusters

cost(g1, g2, . . . , gk) = k∑

i=1

cost(gi)

where cost(gi) = ∑

p∈gi dist(p, ci). dist() is the Euclidean distance. Now show that

the cost of k clusters as evaluated at the end of each iteration (i.e., after Line 11 in the current algorithm) never increases. (You may assume d = 2)

(3) Prove that the cost of clusters obtained by k-means algorithm always converges to a local minima. (Hint: you can make use of the previous conclusion even if you have not proved it).

Q3. (25 marks)

Consider the given similarity matrix. You are asked to perform group average hierar- chical clustering on this dataset.

You need to show the steps and final result of the clustering algorithm. You will show the final results by drawing a dendrogram. The dendrogram should clearly show the order in which the points are merged.

p1 p2 p3 p4 p5 p1 1.00 0.10 0.41 0.55 0.35 p2 0.10 1.00 0.64 0.47 0.98 p3 0.41 0.64 1.00 0.44 0.85 p4 0.55 0.47 0.44 1.00 0.76 p5 0.35 0.98 0.85 0.76 1.00

Q4. (10 marks)

Play several rounds of the Akinator game at http://au.akinator.com/.

(1) It is not uncommon that users may give completely or partially wrong answers during a game. Assume the site maintains a large table, where each row is about a person, and each column is a Boolean-type question, and each cell value is the correct answer (“Yes” or “No”), and that the core algorithm the site uses is a decision tree. To accommodate possible errors, let’s assume the site allows up to one error in a game. That is, a person will still be a candidate if at most one question answer the user provided does not match the correct answer in the data table. Now describe how you will modify the ID3 decision tree construction algorithm to build a decision tree for the site while allowing up to one error in a game.

COMP9318 (13S2) ASSIGNMENT 2 3

Figure 1. Example

(2) Assume that you do not think the site uses decision trees as the backbone algo- rithm. What are the reason(s) to support this conjecture? You may list more than one reason. If you design some experiments and will refer to them, please include the setup and the details of the experiments (e.g., something like Figure 1)

Q5. (20 marks)

We consider the linear counting estimator that estimates the number of distinct elements in a data stream. Using this as a building block, we shall derive methods to estimate the number of distinct elements after some common set operations on several data streams.

Let S1 and S2 be two data streams 1, and C(Si) be the linear counting estimator for Si

using the same hash function h() and same length of bit array (i.e., using m bits and the bit array is denoted as C(Si).B).

(1) Prove that C(S1 ∪ S2) = C(S1)∨ C(S2). Here ∪ is the multiset union operator, and the ∨ operator on two linear counting estimators C1 and C2 returns a new estimator (with the same hash function) with a m-bit bit array where its j-th entry is the result of bitwise OR of the corresponding bits in C1 and C2, i.e., C1.B[j] | C2.B[j].

(2) Prove that C(S1∩S2) 6= C(S1)∧C(S2). Here ∩ is the multiset intersection operator, and the ∧ operator is defined similar to ∨ except that we use bitwise AND instead of bitwise OR, i.e., C1.B[j] & C2.B[j].

(3) Derive a method to estimate the number of distinct elements in S1∩S2, based only on linear counting estimators.

Submission

Please write down your answers in a file named ass2.pdf. You must write down your name and student ID on the first page.

1Note that an element could appear in both S1 and S2.

4 DUE ON 23:59 1 NOV, 2013 (FRI)

You can submit your file by

give cs9318 ass2 ass2.pdf

Late Penalty. -10% for the first two days, and -30% for the following days.

Did you find apk for android? You can find new and apps.

# What Will You Get?

We provide professional writing services to help you score straight A’s by submitting custom written assignments that mirror your guidelines.

Get result-oriented writing and never worry about grades anymore. We follow the highest quality standards to make sure that you get perfect assignments.

#### Experienced Writers

Our writers have experience in dealing with papers of every educational level. You can surely rely on the expertise of our qualified professionals.

#### On-Time Delivery

Someone from our customer support team is always here to respond to your questions. So, hit us up if you have got any ambiguity or concern.

#### Complete Confidentiality

Sit back and relax while we help you out with writing your papers. We have an ultimate policy for keeping your personal and order-related details a secret.

#### Authentic Sources

We assure you that your document will be thoroughly checked for plagiarism and grammatical errors as we use highly authentic and licit sources.

#### Moneyback Guarantee

Still reluctant about placing an order? Our 100% Moneyback Guarantee backs you up on rare occasions where you aren’t satisfied with the writing.

#### Order Tracking

You don’t have to wait for an update for hours; you can track the progress of your order any time you want. We share the status after each step.

#### Areas of Expertise

Although you can leverage our expertise for any writing task, we have a knack for creating flawless papers for the following document types.

# Trusted Partner of 9650+ Students for Writing

From brainstorming your paper's outline to perfecting its grammar, we perform every step carefully to make your paper worthy of A grade.

##### Preferred Writer

Hire your preferred writer anytime. Simply specify if you want your preferred expert to write your paper and we’ll make that happen.

##### Grammar Check Report

Get an elaborate and authentic grammar check report with your work to have the grammar goodness sealed in your document.

##### One Page Summary

You can purchase this feature if you want our writers to sum up your paper in the form of a concise and well-articulated summary.

##### Plagiarism Report

You don’t have to worry about plagiarism anymore. Get a plagiarism report to certify the uniqueness of your work.

## Free Features \$66FREE

• Most Qualified Writer \$10FREE
• Plagiarism Scan Report \$10FREE
• Unlimited Revisions \$08FREE
• Paper Formatting \$05FREE
• Cover Page \$05FREE
• Referencing & Bibliography \$10FREE
• Dedicated User Area \$08FREE

#### Our Services

• On-time Delivery

We create perfect papers according to the guidelines.

##### Professional Editing

We seamlessly edit out errors from your papers.

Work with ultimate peace of mind because we ensure that your academic work is our responsibility and your grades are a top concern for us!

# Check Out Our Sample Work

Dedication. Quality. Commitment. Punctuality

# It May Not Be Much, but It’s Honest Work!

Here is what we have achieved so far. These numbers are evidence that we go the extra mile to make your college journey successful.

# Process as Fine as Brewed Coffee

We have the most intuitive and minimalistic process so that you can easily place an order. Just follow a few steps to unlock success.

# See How We Helped 9000+ Students Achieve Success

#### We Analyze Your Problem and Offer Customized Writing

We understand your guidelines first before delivering any writing service. You can discuss your writing needs and we will have them evaluated by our dedicated team.

• Clear elicitation of your requirements.
• Customized writing as per your needs.

#### We Mirror Your Guidelines to Deliver Quality Services

We write your papers in a standardized way. We complete your work in such a way that it turns out to be a perfect description of your guidelines.

• Proactive analysis of your writing.
• Active communication to understand requirements.

We promise you excellent grades and academic excellence that you always longed for. Our writers stay in touch with you via email.

• Thorough research and analysis for every order.