if God knows everything that will happen then why did He create lucifer?

Sorry if this a dumb question to ask,but why did God create lucifer if He knew that he was going to rebel?