Question: We are given four items, namely A , B , C , and D . Their corresponding unit profits are pA , pB , pC
We are given four items, namely A B C and D Their corresponding unit profits are pA pB pC
and pD The following shows five transactions with these items. Each row corresponds to a transaction where
a nonnegative integer shown in the row corresponds to the total number of occurrences of the correspondence
item present in the transaction.
T A B C D
t
t
t
t
t
The frequency of an itemset in a row is defined to be the minimum of the number of occurrences of
all items in the itemset. For example, itemset C D in the first row has frequency equals But,
itemset C D in the third row has frequency as
The frequency of an itemset in the dataset is defined to be the sum of the frequencies of the itemset
in all rows in the dataset. For example, itemset C D has frequency
Let f be a function defined on an itemset s f will be specified later One example of this functions is
f s
i in s pi In this example, if s C D then f s pC pD
The profit of an itemset s in the dataset is defined to be the product of the frequency of this itemset
in the dataset and f s For example, itemset C D has profit times f C D
Answer the following two questions based on the above problem setting.
a Assume f s
i in s pi
s where s is the size of s Suppose that we know pA pB pC
and pD We want to find all itemsets with profit at least Can the Apriori Algorithm be adapted
to find these itemsets? If yes, please write down the pseudocode and illustrate it with the above example.
If no please explain why. In this case, please also design an algorithm for this problem and write down the
pseudocode.
b Assume f s
i in s pi Suppose that we know pA pB pC and pD We want to find
all itemsets with profit at least Can the Apriori Algorithm be adapted to find these itemsets? If yes,
please write down the pseudocode and illustrate it with the above example. If no please explain why. In
this case, please also design an algorithm for this problem and write down the pseudocode.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
