Lots of good answers so far, but somehow nobody's mentioned the great terms whim, whimsy and whimsical which seem to me to closest fit your examples. Picking a stock because its symbol sounded like one's name is a great example of whimsy, a totally whimsical thing to do, something one did on a whim.
Unlike all the terms mentioned so far, there's no negative connotation to whimsy and whimsical. Whim can have a negative connotation, but doesn't necessarily.
The aforementioned capricious is also good, but perhaps more pertinent is caprice, "a sudden and unaccountable change of mood or behavior" which has less negative connotation than capricious (which can go either way). If the mood aspect is applicable, you may also want to check out mecurial which, before it became an SCC meant in thrall to one's mood of the moment.
Addendum: Also in a similar vein: the idioms on a lark, for a lark, for kicks, and for kicks and giggles.