Does the basicity decreases as going down the column and right across the periodic table? How does the size of an element or electronegativity apply to strength of basicity and acidicity?

Yes, the trend is as you have it.

The strength HF<HCl<HBr<HI so you see the acidity increases as size increases.
For electronegativity, acidity increases with electronegativity; i.e., NH3<H2O<HF

Yes, the basicity generally decreases as you go down the column and increases as you move from right to left across the periodic table.

To understand why this happens, let's first discuss basicity in terms of Lewis bases. A Lewis base is a species that donates an electron pair during chemical bonding. In the context of acid-base reactions, a Lewis base is a species that donates an electron pair to form a new bond with a proton (H+). The basicity of an element or compound is a measure of its tendency to donate an electron pair.

Now, when we move down a column in the periodic table, the atomic size or radius tends to increase. This increase in size means that the outermost electrons are farther away from the atomic nucleus. As a result, the attraction between the nucleus and the electron pair being donated by the Lewis base decreases. This decrease in attraction makes it less likely for the Lewis base to donate the electron pair, thus decreasing its basicity.

On the other hand, when we move from right to left across a period of the periodic table, the electronegativity tends to decrease. Electronegativity is a measure of the tendency of an atom to attract electrons towards itself in a chemical bond. If an atom has higher electronegativity, it can exert a stronger pull on shared electrons, making it less likely to donate an electron pair to form a new bond. Therefore, as electronegativity decreases across a period, the atoms become less electronegative and more likely to donate their electron pair, resulting in an increase in basicity.

In summary, as you move down a column in the periodic table, the basicity decreases due to larger atomic size, which weakens the attraction between the nucleus and the electron pair being donated. Moving from right to left across a period, the basicity increases due to lower electronegativity, which makes the atoms more likely to donate their electron pair.