Average Out Two Lists

Pyth, 24 bytes

?}KcsJsQlJmcsdldtPyJK":(

Try it online: Demonstration

Thanks to Dennis for noticing an error and golfing one byte.

Explanation:

?}KcsJsQlJmcsdldtPyJK":(   implicit: Q = evaluated input
      sQ                   all numbers of Q
     J                     save them in J
  KcsJ  lJ                 average of J (sum(J) / len(J))
                           store in K
          m     tPyJ       map each nonempty subset d of J to:
           csdld             average of d
?}                         if K in ^:
                    K        print K
                     ":(   else print sad-face

SWI-Prolog, 159 bytes

a(A,B):-append([A,B],R),permutation(R,S),append([Y,Z],S),sum_list(Y,I),sum_list(Z,J),length(Y,L),length(Z,M),L\=0,M\=0,I/L=:=J/M,W is J/M,write(W);write(':(').

Called as a([1,4,8,2,5],[3,1,5,2,5]).


Julia, 101 bytes

f(a,b)=(m=mean;p=filter(i->m(i[1])==m(i[2]),partitions([a,b],2));isempty(p)?":(":m(collect(p)[1][1]))

This creates a function that accepts two arrays and returns a string or a float accordingly.

Ungolfed + explanation:

function f(a,b)
    # Get the set of all 2-way partitions of the array [a,b]
    l = partitions([a,b], 2)

    # Filter the set of partitions to those where the two
    # contained arrays have equal means
    p = filter(i -> mean(i[1]) == mean(i[2]), l)

    # Return a frown if p is empty, otherwise return a mean
    isempty(p) ? ":(" : mean(collect(p)[1][1])
end