When you start trying to make a camera less than one inch thick, the camera maker usually has to start making compromises.
Picture quality seems to be one problem
I looked at customer reports for the Pentax S4i and the Casio EX-Z40 and picture quality is not one of their strong points. I was seeing worse complaints about the Casio picture quality than the Pentax.
The Sony T1 has been a bit of a disappointment for many. Mostly for its very weak flash (less than 5 feet coverage). If you want to take flash pictures, forget this one. The newer T11 is no better.
That leaves the Canon S410 and S500 which are only a bit thicker (1.1 inches). The picture quality for these cameras has been very good. They also use Compact Flash memory cards. You can find very low prices for Compact Flash cards. Their one weak point seems to be short battery life between charges. So plan on buying an extra battery.
If you still want one of the extra thin cameras, look at Minolta (now called Konica/Minolta).
Their thin cameras: G400, Xg, and the just announced X31.
...
Im planning to purchase a ulta-compact camera that doesnt take up too much space. I first considered the sony t1, pentax optio s4i, and the casio exilim ex-z40. Then i saw that the sony memorysticks are like twice the price of other brands so i didnt like that option. The pentax optio s4i and the casio uses the same lense, but from what ive heard the pentax is smaller, but the casio is better.
Which is the best, is there any other alternatives which are 4-5 mpix?
I would really appreciate an answer!

Chowhound
Comic Vine
GameFAQs
GameSpot
Giant Bomb
TechRepublic