Answer is 12. As the lifetime of stack is not defined I am assuming life time is the time the element was in the stack til it was fully removed. Let the elements be a, b, c, d
Average life time = (life time of a + life time of b + life time of c + life time of d) / 4
When a will be pushed the time will not be counted because yet no element was in the stack. After pushing a I'm pushing b, c, d, and then removing d, c, b, a in that order. So a will be in stack for 3 push and 4 pop operations, that is, 3*3 + 4*3 = 21 time units.
Similarly for b the life time will be 2*3 + 3*3 = 15,
for c, 3+6 = 9 and
for d, 3 time units.
Average life = (21+15+9+3) / 4
= 12 time units