Unless you want to deny the Omniscience of God then you have the same "problem" to answer.
Is it a given that we must find an answer to this "problem" ?
Doesn't it fall into the area of how God accomplishes His will ?
Can we even trust ourselves to truly comprehend such a thing ?Isaiah 55:8 For my thoughts are not your thoughts, neither are your ways my ways, saith the LORD.If God knew who would and would not be saved, or however you want to say it, and created the world anyway ... then who, really, is doing what God did not intend for them to do?
9 For as the heavens are higher than the earth, so are my ways higher than your ways, and my thoughts than your thoughts.
Well ... it appears that Israel may have been ...Jeremiah 32:30 For the children of Israel and the children of Judah have only done evil before me from their youth: for the children of Israel have only provoked me to anger with the work of their hands, saith the LORD.
31 For this city hath been to me as a provocation of mine anger and of my fury from the day that they built it even unto this day; that I should remove it from before my face,
32 Because of all the evil of the children of Israel and of the children of Judah, which they have done to provoke me to anger, they, their kings, their princes, their priests, and their prophets, and the men of Judah, and the inhabitants of Jerusalem.
33 And they have turned unto me the back, and not the face: though I taught them, rising up early and teaching them, yet they have not hearkened to receive instruction.
34 But they set their abominations in the house, which is called by my name, to defile it.
35 And they built the high places of Baal, which are in the valley of the son of Hinnom, to cause their sons and their daughters to pass through the fire unto Molech; which I commanded them not, neither came it into my mind, that they should do this abomination, to cause Judah to sin.
In context God was saying that he never ordained that kind of abominable pagan "worship" for Himself .
God that knows the beginning from the end , was not caught unaware of that sin or any sin .