  A halfspace is a function $f\colon\{-1,1\}^n \rightarrow \{0,1\}$ of the form
$f(x)=\mathbb{1}(a\cdot x>t)$, where $\sum_i a_i^2=1$.
  We show that if $f$ is a halfspace with $\mathbb{E}[f]=\epsilon$ and
$a'=\max_i |a_i|$, then the degree-1 Fourier weight of $f$ is
  $W^1(f)=\Theta(\epsilon^2 \log(1/\epsilon))$, and the maximal influence of
$f$ is $I_{\max}(f)=\Theta(\epsilon \min(1,a' \sqrt{\log(1/\epsilon)}))$.
  These results, which determine the exact asymptotic order of $W^1(f)$ and
$I_{\max}(f)$, provide sharp generalizations of theorems proved by Matulef,
O'Donnell, Rubinfeld, and Servedio, and settle a conjecture posed by Kalai,
Keller and Mossel.
  In addition, we present a refinement of the definition of noise sensitivity
which takes into consideration the bias of the function, and show that (like in
the unbiased case) halfspaces are noise resistant, and, in the other direction,
any noise resistant function is well correlated with a halfspace.
  Our main tools are 'local' forms of the classical Chernoff inequality, like
the following one proved by Devroye and Lugosi (2008):
  Let $\{ x_i \}$ be independent random variables uniformly distributed in
$\{-1,1\}$, and let $a_i\in\mathbb{R}_+$ be such that $\sum_i a_{i}^{2}=1$.
  If for some $t\geq 0$ we have $\Pr[\sum_{i} a_i x_i > t]=\epsilon$, then
$\Pr[\sum_{i} a_i x_i>t+\delta]\leq \frac{\epsilon}{2}$ holds for $\delta\leq
c/\sqrt{\log(1/\epsilon)}$, where $c$ is a universal constant.
