Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Given P={p_1, p_2, ...p_m}, the set of products available at a local grocery sto

ID: 3843704 • Letter: G

Question

Given P={p_1, p_2, ...p_m}, the set of products available at a local grocery store; D={T_1, T_N}, the set of transactions that were completed at this store in the past year, where each U. (I in [1, N]) is a subset of P; min_freq, a user-specified parameter (e.g., 5%). A product is said to be frequent if it occurs in at least min_freq of the transactions in D. By the same token, a pair of products is said to be frequent if it occurs in at least min_freq of the transactions in D. Also, it's straightforward to prove the following claim: if a product is not frequent, none of the pairs that involve this product will be frequent. Use this claim to design an algorithm to find all the frequent products and frequent product pairs in D. Represent your algorithm in pseudo code.

Explanation / Answer

scanf("%s",input);

if(input contains only one item)

{ if(transaction>min_freq)

{ printf("product is frequent";

}

else

printf("product is not frequent");

}

else //if input conatin more than 1 item

{ if(transaction1<min_freq)

{

printf("product set is not frequent");// we don't have to check for 2 transaction

}

else //transaction 1 is frequent

{ for i=2;n

if(transactioni>min_freq)

printf("transaction is frequent");

}

}

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote