Pergunta de entrevista da empresa Spotify

given n samples from a uniform distribution [0, d], how to estimate d?

Respostas da entrevista

Sigiloso

30 de jul. de 2015

d=2*E(X)

15

Sigiloso

1 de abr. de 2015

it should be max[x_1, ...,,x_n] by using maximum likehood estimation

15

Sigiloso

7 de mar. de 2016

Given k measurements x_1, x_2, ... x_k, the probability density function for x is P(x) = { 1/d for x in [0,d], 0 otherwise }. d* = argmax{d} (product{i = 1:k} P(x_i) ) = argmax{d} (sum{i = 1:k} log (P(x_i)) ) = argmax{d} (sum{i = 1:k, d >= max (x_i)} log(1) - log(d) ) = argmax{d} (sum{i = 1:k, d >= max (x_i)} -log(d) ) = max(x_i)

4

Sigiloso

24 de ago. de 2017

d=2Avg(X) / d=2Median(X)

3

Sigiloso

26 de jan. de 2018

The expectation of max(x_i) is (n-1)d/n, therefore an unbiased estimator would be n*max(x_i)/(n-1)

1