How to gather functions which intersect at the same point (real solution)?
func = {2 x, x^2 + 1, (x^3 + 3)/2};
For example, with the list of functions above I want it to be divided into 3 groups as follows:
(I'm not sure if I missed any, I just looked at the plot to group them)
out= {{2 x, x^2 + 1, (x^3 + 3)/2}, {2 x, (x^3 + 3)/2}, { x^2 + 1, (x^3 + 3)/2}}
EDIT: rhermans gave a nice answer. However, I didn't know that the number of functions would change the approach. I should have mentioned that in my case, the number of functions is quite large, probably 100 or more. So some apporach may work very nice for small number of functions but cause insufficient memory with large number of functions.
sb2 = Subsets[func, {2}]
? Then subtract, set to zero, solve and find that the common point of intersection for each pair is atx->1
. $\endgroup$new=Equal @@@ Subsets[func, {2}]
to get all possible equations. Then,Solve@new
gives one solution which is where all three meet andSolve /@ new
gives the remaining solutions. Then you can group them. Is this roughly what you meant? $\endgroup$Subsets
of length two or larger is $2^n-n -1$, for $n=100$ that is more than $10^{30}$ Subsets. Too many to be manageble, a different approach is needed. $\endgroup$