Analysis and Synthesis for Discrete-Time Switched Systems