If we define matter as the thing that gives concreteness and shape to the three-dimensional world and creates a substrate layer, and an idea as a notion that is pure information and does not depend on its substrate, similar to what hardware and software are for computing:
a) The root of all cannot be simple matter. Matter does not account for inner or psychic phenomena, experience or consciousness, or the quality of the world.
b) The root of all cannot be simply an idea. An idea cannot be a substratum itself; how can an idea be processed or exist on its own without matter or substance?
The definitions of the two terms directly beg the question, but it seems true that if we experience or define the world in this dualistic sense of matter and idea, body and mind, or hardware and software, as most of us do, then we are likely to encounter contradictions.
The most honest conclusion, given our current knowledge, is that the root of existence is a PARADOX relative to our current understanding and reasoning. We can never reach it with classical logic, Aristotelian syllogisms, or current mathematics.
Philosophical, theological, and logical inquiries point to similar antinomies: infinite regress, an acausal cause, the first unmoved mover, and the thing that cannot be comprehended.