Lectures on optimal design and sequential analyses