OK, put simply length is not the factor that determines accuracy. Look at Glenn Zedikers book "The competitive AR15" and the ammo oracle on this site: http://ammo.ar15.com/ammo/ and read through them; you will find that:
Barrel length has an effect on velocity but not as much as you think it will,
Barrel construction has the effect on accuracy (material, chamber specs, twist rate, quality of construction, barrel finish (internal), etc.)
Ammunition built and tuned for the barrel etc...
Barrel length and accuracy intuatively are related. Assuming that everything else is equal and the bullet has time to stabilize in the barrel a shorter barrel will be inherently more accurate if only because there will be less of an opportunity for defects in workmanship to introduce flaws in the barrel that will upset the bullet in it's path to the target. In reality you need to read the book and other information from reputible sources to make the best compromises for your situation...
I chose a used 22 inch bull barrel with a .223 match chamber and get 0.355" groups at 100 yards with my pet load and a decent trigger.
I have found that realistically in an AR15 the trigger and scope make a bigger difference in accuracy than the choice in barrel length.
Do the research, you won't be disappointed.
Lc