I define X as a set with say 50 elements. I manually assign distance between any to elements using numbers from the irrational number pi. So 50*(50-1)/2 distance values are assigned. Now for each element consider an open ball of radius 5. All the elements contained in the ball form a set (say SET1). Arbitrary union and arbitrary intersection of these sets SETis constitute to form a topology on X.
Is there any mistake in this topology construction? Can I define a ball like that? Considering the triangle inequality is not followed by the distance used. The distance is a semi-metric.
Yes, although it would suffice to take arbitrary unions and finite intersections; this is enough to satisfy the definition of topology. (But since your set is finite to begin with, this makes no difference in your situation).
It does not really matter how you formed the sets. More generally, you can take, for every $x$, some set $N_x$ containing $x$, and call it a neighborhood of $x$. Then take unions and intersections of the sets $N_x$, $x\in X$, as above. You'll get a topology.
In case you wonder why the triangle inequality is useful: it helps us express the topological notions, such as convergence, in terms of metric. For example, once we have topology, we know what $$\lim_{n\to\infty} x_n =x\tag1$$ means: every open set containing $x$ also contains all $x_n$ but finitely many. Having a topology consistent with a metric helps us see that (1) is equivalent to $$\lim_{n\to \infty} d(x,x_n)=0 \tag2$$ If you create a topology from $d$ that is not a metric, the equivalence of (1) and (2) is less clear.