サンプルサイズが小さい場合のランダム分布において必然的に生じるストリーク(線や筋)やクラスター(群れや塊)を、ランダムなものではないと誤判断することである。

import numpy as np
import matplotlib.pyplot as plt
 
np.random.seed(42)
num_points = 1000
x = np.random.rand(num_points)
y = np.random.rand(num_points)
 
cluster_center = (0.5, 0.5)
cluster_radius = 0.1
num_cluster_points = 100
cluster_x = cluster_center[0] + cluster_radius * np.random.randn(num_cluster_points)
cluster_y = cluster_center[1] + cluster_radius * np.random.randn(num_cluster_points)
 
plt.figure(figsize=(6, 6))
plt.scatter(x, y, alpha=0.5, label='Random Points')
plt.scatter(cluster_x, cluster_y, color='red', alpha=0.7, label='Cluster Points')
plt.title('Clustering Illusion: Random Points with Cluster')
plt.legend()
plt.show()
  • How random, really, is Spotify’s shuffle feature?
    • Spotifyは、初期の頃はFisher-Yatesアルゴリズムを使用して完全なランダム再生を実現していましたが、ユーザーから「同じアーティストの曲が続く」「同じ曲が頻繁に再生される」といったフィードバックを受けて、2014年にアルゴリズムを変更しました。新しいアルゴリズムでは、アーティストやアルバムが連続して再生されないように調整され、ユーザーが感じる「ランダムさ」を向上させています。
  • Create a true random shuffle option - The Spotify Community