“Every human needs a shelter” Given a signature $\Sigma$ consisting of an empty set of functions and a set of predicates $P=\{human,\ shelter,\ need\},$ where $need$ is of arity two and $human$ and $shelter$ have arity one, I want to express the sentence "Every human needs a shelter" over a set of variables $X.$
The answer that first came to my mind is:
$$\forall x,y\: \Big(\text{human}(x)\rightarrow \big(\text{shelter}(y)\rightarrow \text{need}(x,y)\big)\Big).\tag1$$ The problem with this is that it expresses, that every variable that qualifies as a shelter is needed by all humans, which is not quite, what the sentence is saying.
An alternative is to use an existential quantifier instead of the universal quantifier for $y$, which yields $$\forall x\:\Big(\text{human}(x)\rightarrow \exists y\:\big(\text{shelter}(y)\rightarrow \text{need}(x,y)\big)\Big).\tag2$$ The problem with this is that it entails that the existence of humans implies the existence of shelters, i.e. for every interpretation, where shelter is empty and human is not empty, the formula is falsified.
How to solve the given problem?
 A: The example is a bit difficult because "need" is a so-called intensional predicate: It combines with an object that, even when truthfully existentially quantified, may not actually exist in the universe of discourse; from the existential quantification "a shelter" we would actually not want to infer that there exist any shelters, even when it is true that all humans need one. This kind of situation can not be accurately represented with plain first-order logic, so the truth conditions will not exactly match the intended ones. But let's assume here that there exist indeed shelters.

$$\forall x,y\: \Big(\text{human}(x)\rightarrow \big(\text{shelter}(y)\rightarrow \text{need}(x,y)\big)\Big).\tag1$$ The problem with this is that it expresses, that every variable that qualifies as a shelter is needed by all humans, which is not quite, what the sentence is saying.

Yes, that's incorrect. This statement reads "Every human needs every shelter".

$$\forall x\:\Big(\text{human}(x)\rightarrow \exists y\:\big(\text{shelter}(y)\rightarrow \text{need}(x,y)\big)\Big).\tag2$$
The problem with this is that it entails that the existence of humans implies the existence of shelters, i.e. for every interpretation, where shelter is empty and human is not empty, the formula is falsified.

No, that's not the case. If there are no shelters at all, then every object will falsify $shelter(y)$ and thereby satisfy $shelter(y) \to need(x,y)$ by the truth conditions of $\to$. Even worse, as soon as there is anything at all in the universe that is not a shelter, the inner implication and thereby the existential statement becomes true. This is not what we want.
The correct answer is

$$\forall x\:\Big(\text{human}(x)\rightarrow \exists y\:\big(\text{shelter}(y)\wedge \text{need}(x,y)\big)\Big).\tag3$$

This means that for every individual that is human, there is something which is a shelter and needed by them.
"Some P Q" means $\exists (P(x) \land Q(x))$: An existential quantifier typically goes with a conjunction to get the desired truth conditions, whereas the univesrsal quantifier normally goes with implication. So a statement of the form $$\text{Every subject verbs an object}$$ translates $$\forall x (Subject(x) \to \exists y (Object(y) \land Verb(x,y)))$$
A: Revised answer with Addendum


$\text{Every human needs a shelter.}\tag0$


The phrase “needs/wants a/some” is tricky (impossible?) formalise, because it ostensibly calls for existential quantification yet the object needed may not exist. I gave up trying to translate $(0),$ so shall just cheat by adding an axiom $$\exists x\; \text{shelter}(x),$$ in which case $(0)$ is equivalent to $$\forall x\:\Big(\text{human}(x)\rightarrow \exists y\:\big(\text{shelter}(y)\land \text{need}(x,y)\big)\Big).\tag3$$
There is another axiom: no human is a shelter, and vice versa. However, this is common to both $(0)$ and $(3),$ so isn't required for them to be equivalent.

$$\forall x,y\: \Big(\text{human}(x)\rightarrow \big(\text{shelter}(y)\rightarrow \text{need}(x,y)\big)\Big).\tag1$$

$(1)$ is wrong, since it is equivalent to

*

*every human needs every shelter.


$$\forall x\:\Big(\text{human}(x)\rightarrow \exists y\:\big(\text{shelter}(y)\rightarrow \text{need}(x,y)\big)\Big).\tag2$$

$(2)$ is also wrong, since unlike $(0),$ it is indeed true whenever the universe contains a non-shelter. It is equivalent to

*

*for each human, for some object, if it's a shelter then the human needs it.


The problem with $(2)$ is that it entails that the existence of humans implies the existence of shelters, i.e. for every interpretation, where shelter is empty and human is not empty, the formula is falsified.

No $(2)$ doesn't entail what you're claiming: if the universe contains a human but no shelter, then $(2)$ is true. (Why?) Read more about sentence $(2)$ here.

Addendum (orthogonal)

@ryang Let us consider an interpretation consisting of exactly one variable $x,$ which is a human. This interpretation satisfies $$\forall x\:\Big(\text{human}(x)\rightarrow \exists y\:\big(\text{shelter}(y)\rightarrow \text{need}(x,y)\big)\Big),\tag2$$ because the right hand side of the implication in (2) is satisfied due to the existence of $x,$ which is not a shelter.

If we assume that either the human is not a shelter or they need themself, then $(2)$ is true. (Remember, of the current interpretation, although we know that the universe is $\{h\},$ the predicates' meanings haven't been properly specified.)

As a matter of fact, following the same argument, (2) is satisfied for any interpretation with a non empty universe.

This italicised portion is just an illogical leap, and the boldfaced claim is false.
Noting that a non-empty universe is a standard given anyway, your boldfaced claim is precisely rephrased as “sentence $(2)$ is a logical validity, i.e., true regardless of interpretation”. If you don't immediately see that this is absurd, click on these links: sentence $(2)$ is neither valid nor unsatisfiable; that is, sentence $(2)$ is alternately true and false as the interpretation varies.
A: If this problem comes from a textbook, then lemontree's answer is probably the expected one. However, as pointed out by lemontree, even that answer cannot express the true meaning of the English sentence. Some people have suggested that FOL is not capable of expressing this. I somewhat disagree with that. But first I want to show that it may be acceptable to use modal operators on top of FOL.
A simple solution using the modal operator "Should" is:
  ∀x∈Humans ( Should ∃y∈Shelters ( HasAccessTo(x,y) ) ).
This translates the English:
  Every human should have access to some shelter.
The problem with this simple way is that it expresses the notion of "need" via the global modal "should", which means that it ties individual need to the intended model of the axiomatization, as if what every individual needs is uniformly covered by the global "should". Whether this is appropriate would depend on your philosophical position on morality. (If whatever people need should be provided to them, and vice versa, then this way suffices.)
Note that "Should ∃" does not mean the same as "∃ Should". That is, the above solution is not equivalent to:
  ∀x∈Humans ( ∃y∈Shelters ( Should HasAccessTo(x,y) ) ).
which roughly corresponds to:
  ∀x∈Humans ( ∃y∈Shelters ( Needs(x,y) ) ).  [which is lemontree's answer]
Incidentally, we can express the true desired meaning using pure FOL, by using a different way of saying it:
  ∀x∈Humans ( Shelters∈Needs(x) ).
  ∀x∈Humans ( Satisfied(x) ⇔ ∀S∈Needs(x) ∃y∈S ( HasAccessTo(x,y) ) ).
which translates:
  Shelter is a need of every human.
  Every human x is satisfied if and only if,
    for each set S representing a need of x,
      x has access to some member of S.
which is what is really meant by:
  Every human needs a shelter.
Here Shelters is a set, and Needs is a function-symbol, with Needs(x) being the set of all S such that S is a set of objects of which x needs at least one. So every normal human x would satisfy WaterSources∈Needs(x) ∧ FoodSources∈Needs(x) ∧ Shelters∈Needs(x).
I have used restricted quantifiers throughout this post, because they are the most natural way to translate quantifiers from natural language, but I presume you know how to translate these to unrestricted quantifiers by having a predicate-symbol for each quantifier domain.
A: An appropriate setting to see the difficulties involved in such translations and the possible directions for progress is the epsilon calculus extension of first-order predicate logic.
Making use of Hilbert's $\varepsilon$-operator, the statement can be translated as
$$\forall x\,\underbrace{\big(\text{human}(x)\rightarrow\text{need}(x,\varepsilon y\,\text{shelter}(y)\big)}_{A(x)}$$
We may obtain an entirely quantifier-free formula using the equivalence
$$\forall xA(x)\leftrightarrow A(\varepsilon x(\neg A))$$
The $\varepsilon$-operator is a term-forming variable-binding operator that picks out some member of the domain of discourse that falls under the constituent predicate, if there is such a member; otherwise, the $\varepsilon$-term defaults to an arbitrary value.
A paraphrase of the statement in question is that humans need a shelter (not a shelter specific for each one), whether any shelters exist or not. Here, the consequent clause stands out as the problematic part to formulate in the language of logic. Carnap explains how the $\varepsilon$-operator fulfils the relevant task in his article On the Use of Hilbert's ε-Operator in Scientific Theories as follows:

If a language like $L_{\varepsilon}$ is used, the situation is
radically different, because the symbol '$\varepsilon$' was
intentionally introduced by Hilbert as an indeterminate constant. Its
meaning is specified by the axioms (1) and (2) only to the extent that
any non-empty set has exactly one representative and that this
representative is an element of the set. If the set has more than one
element, then nothing is said, either officially or unofficially, as
to which of the elements is the representative. Thus, for example,
$\varepsilon_{x}(x = 1\vee x = 2\vee x = 3)$ must be either $1$, or
$2$, or $3$; but there is no way of finding out which it is.

If there is no member of the domain of discourse that satisfies the stipulation expressed by the constituent predicate, then the $\varepsilon$-term (viz., $\varepsilon y\,\text{shelter}(y)$) is a null-term. In that case, it denotes an indefinite object that can be interpreted here as an associated object that does not exist in the given domain (universe), thus, effectively, points not to the extension, but to the intension expressed by the predicate.
