There are different verses some of which seem to clearly suggest determinism :
و ما تشاءون الا ان یشاء الله رب العالمین
and you do not wish unless it is wished by Allah, the lord of the worlds.81:29
فَلَمْ تَقْتُلُوهُمْ وَ لكِنَّ اللَّهَ قَتَلَهُمْ وَ ما رَمَيْتَ إِذْ رَمَيْتَ وَ لكِنَّ اللَّهَ رَمى وَ لِيُبْلِيَ الْمُؤْمِنينَ مِنْهُ بَلاءً حَسَناً إِنَّ اللَّهَ سَميعٌ عَليمٌ
You did not kill them; rather it was Allah who killed them; and you did not throw when you threw, rather it was Allah who threw, that He might test the faithful with a good test from Himself. Indeed Allah is all-hearing, all-knowing.(8:17)
On the other hand there are other verses that imply free will:
لَهُ مُعَقِّباتٌ مِنْ بَيْنِ يَدَيْهِ وَ مِنْ خَلْفِهِ يَحْفَظُونَهُ مِنْ أَمْرِ اللَّهِ إِنَّ اللَّهَ لا يُغَيِّرُ ما بِقَوْمٍ حَتَّى يُغَيِّرُوا ما بِأَنْفُسِهِمْ وَ إِذا أَرادَ اللَّهُ بِقَوْمٍ سُوْءاً فَلا مَرَدَّ لَهُ وَ ما لَهُمْ مِنْ دُونِهِ مِنْ والٍ
He has guardian angels, to his front and his rear, who guard him by Allah's command. Indeed Allah does not change a people's lot, unless they change what is in their souls. And when Allah wishes to visit ill on a people, there is nothing that can avert it, and they have no protector besides Him.(13:11)
يَا أَيُّهَا الَّذِينَ آمَنُوا عَلَيْكُمْ أَنفُسَكُمْ لَا يَضُرُّكُم مَّن ضَلَّ إِذَا اهْتَدَيْتُمْ..
O believers! You have charge of your own souls. He who goes astray cannot injure you if you are rightly guided.5:105
There seems to be a contradiction between these verses, I'd like to know how we should make sense of these apparently contradicting verses? Does Islam teach free will or determinism? I am interested in Shiite view.