The human mind is organically produced, and the attributed organ is the brain. Since the brain is a biological thing, it isn't really a machine. Except that in some instances, the brain and mind do seem to act like a machine. An example is where the human mind seems to operate in a linear, logical manner.
I'm not speaking of "logic" like you might've heard issuing from the character "Spock" in Star Trek. The human mind's logic is, as often as not, inaccurate. The "logic" I speak of points to how we function from assumptions. Assumptions are like postulates. If the assumption is correct, then accurate thinking will follow. If a person's assumptions are inaccurate, the mind will produce inaccurate thoughts and beliefs from these assumptions.
Except that human beings are designed with some mechanisms that allow some level of truth to filter in, despite possibly holding erroneous assumptions. These self-corrective mechanisms, however, don't always work very well. The latter fact pointing to how people can behave in a misguided manner.
People with psychosis usually have a delusion at the bottom of the thoughts. This is where, as a basic assumption, we believe something that isn't so. When erroneous behavior inevitably follows, we get into some type of trouble, and in a best-case scenario wind up being put in a good psychiatric ward.
-more-