def one_shot_distribution(self): if self.cache_dist_3 is None: t = {-1: 1 / 3, 0: 1 / 3, 1: 1 / 3} Dfm = dist_iter_convolution(t, self.n - 1) Dgr = dist_scale(Dfm, 3) if self.improper: Dfm = dist_scale(Dfm, 3) self.cache_dist_3 = dist_convolution(Dfm, Dgr) return self.cache_dist_3
def secret_l2_distribution(self): if self.cache_dist_1 is None: t = {0: 1 / 3, 1: 2 / 3} Df = dist_iter_convolution(t, self.n - 1) Dg = dist_scale(Df, 3**2) if self.improper: Df = dist_scale(Df, 3**2) self.cache_dist_1 = (Df, Dg) return self.cache_dist_1
def one_shot_s_quantile(self, lgu): t = {0: 1 / 3, 1: 2 / 3} D = dist_iter_convolution(t, self.n - 1) pnz = expectation(top_quantile(D, 2**(lgu / 2))) / (self.n - 1) t = {-1: pnz / 2, 0: 1 - pnz, 1: pnz / 2} Dfm = dist_iter_convolution(t, self.n - 1) Dgr = dist_scale(Dfm, 3) if self.improper: Dfm = dist_scale(Dfm, 3) return dist_convolution(Dfm, Dgr)