assumption k <= n