Global Sensitivity
Global sensitivity is a key concept in differential privacy that measures how much a single individual's data can influence the output of a function or query. Specifically, the global sensitivity of a function is defined as the maximum change in the function's output when a single record in the input dataset is changed, added, or removed. This value is crucial because it determines the minimum amount of noise that must be added to the output to ensure differential privacy.
If the global sensitivity is high, a single individual's data can have a large impact on the result, requiring more noise to protect privacy. Conversely, if the global sensitivity is low, less noise is needed, which allows for more accurate results. Therefore, understanding and calculating global sensitivity is essential for designing effective differentially private mechanisms. For example, when answering a count query — such as "How many users are over 18?" — the global sensitivity is 1, since adding or removing one person can change the count by at most 1.
1234567891011121314151617def global_sensitivity_count(dataset): """ Computes the global sensitivity of a count query on the dataset. For count queries, the global sensitivity is always 1, but this function demonstrates the reasoning by comparing datasets differing by one record. """ # Create two neighboring datasets: one with, one without the last record dataset1 = dataset dataset2 = dataset[:-1] count1 = len(dataset1) count2 = len(dataset2) sensitivity = abs(count1 - count2) return sensitivity # Example usage: dataset = ["Alice", "Bob", "Charlie"] print("Global sensitivity of count query:", global_sensitivity_count(dataset))
Tack för dina kommentarer!
Fråga AI
Fråga AI
Fråga vad du vill eller prova någon av de föreslagna frågorna för att starta vårt samtal
Fantastiskt!
Completion betyg förbättrat till 7.14
Global Sensitivity
Svep för att visa menyn
Global sensitivity is a key concept in differential privacy that measures how much a single individual's data can influence the output of a function or query. Specifically, the global sensitivity of a function is defined as the maximum change in the function's output when a single record in the input dataset is changed, added, or removed. This value is crucial because it determines the minimum amount of noise that must be added to the output to ensure differential privacy.
If the global sensitivity is high, a single individual's data can have a large impact on the result, requiring more noise to protect privacy. Conversely, if the global sensitivity is low, less noise is needed, which allows for more accurate results. Therefore, understanding and calculating global sensitivity is essential for designing effective differentially private mechanisms. For example, when answering a count query — such as "How many users are over 18?" — the global sensitivity is 1, since adding or removing one person can change the count by at most 1.
1234567891011121314151617def global_sensitivity_count(dataset): """ Computes the global sensitivity of a count query on the dataset. For count queries, the global sensitivity is always 1, but this function demonstrates the reasoning by comparing datasets differing by one record. """ # Create two neighboring datasets: one with, one without the last record dataset1 = dataset dataset2 = dataset[:-1] count1 = len(dataset1) count2 = len(dataset2) sensitivity = abs(count1 - count2) return sensitivity # Example usage: dataset = ["Alice", "Bob", "Charlie"] print("Global sensitivity of count query:", global_sensitivity_count(dataset))
Tack för dina kommentarer!