# Private and Secure Distribution of Targeted Advertisements to Mobile Phones
## 5 Detailed System Description
### Requester Meets an Agent
#### 5.3.2. UIP Comparison of Requester and Agent  
If the Requester decides to use the services of the Agent, he/she then may select a number of specific interests that he/she will request adverts for. In an effort to minimize bandwidth and memory overhead, the Requester attempts to give priority to adverts that the Agent is also interested in. This way, a single advert can be downloaded and viewed by both users.  
Interest commonalities could be easily identified by openly comparing the UIPs of the two users, but this would also mean that the users would need to expose their advertising interests to each other. To maintain privacy, the system implements a probability-based UIP comparison mechanism. This mechanism enables the Requester to select some of his/her interests which have a high probability of also being shared with the Agent, but still prevents both of them from learning each other's exact interests.  
The UIP, which includes both marked and unmarked interests, is first split into smaller groups of entries, and each of the groups is given a unique name (A, B, C, etc.). The number and size of the groups is determined by the system administrator who is the Broker, and it can vary depending on the total size of the supported UIP, which determines the number of different interests categories that are supported by the system. The size of the groups is a compromise between accuracy and privacy as smaller groups will produce more accurate results while larger groups make it more difficult for a curious Agent to determine the Requester's exact interests. The Agent then composes a list with the group names in descending order based on the number of marked interests in each group and sends it to the Requester. For example, the interest profile UIP that is shown in Figure 4 consists of 50 marked or unmarked interests that are divided into five groups (A, B, C, D and E) with a total of 10 entries in each group. If the Agent were to have the most marked interests in Group C followed by D, then E, A and, finally, B, then his/her composed list L1 would be as L1 = [C,D,E,A,B].  
Upon receiving L1, the Requester follows the same procedure with his/her own \(UIP_{Requester}\) in order to produce L2 = [B,A,C,D,E]. The Requester can now select a group by simultaneously going through the items in both lists from the top ranked to the bottom ranked until he/she finds a group in L2 that has the same or higher ranking in L1. More specifically, the Requester will begin by comparing the top ranked groups in each list (Group C in L1 and Group B in L2). If they do not match, he/she will then compare the top two items of each list and so forth.  
In our particular example, the first comparison will be between L1'= [C] and L2' = [B]. As a match is not found, the second comparison will take place between L1' = [C,D] and L2' = [B,A] that also does not produce a match. The third comparison will be between L1' = [C,D,E] and L2' = [B,A,C] to which the system will identify the leading group to be C, as it has the third highest ranking in L2 and the top ranking in L1. Note that if we had L1' = [A,B] and L2' = [B,A], then the leading group would have been A, as we always select the common item that has the highest ranking in the Agent's list L1.  
Figure 4: Example of algorithm for User’s Interest Profile (UIP) comparison.  
Once the leading group has been identified, the Requester picks \(N\) marked interests from that group. \(N\) is sent to the Requester by the Agent and is the number of requests that the Agent is willing to accept. Should \(N\) be greater than the total number of marked interests that the Requester has in the leading group (Group C), then the Requester would continue the algorithm until he/she finds a second group and supplements the remaining interests from there.