according to, by (means of), due to, because of
Noun + に +
Used directly after a noun to indicate a cause, means, the agent of a passive sentence, or that a situation varies depending on the noun.
Noun
Attach
地震
Due to the earthquake, the building collapsed.
人
Preferences differ depending on the person.
この絵は有名な画家
This picture was painted by a famous artist.
不注意に
Due to carelessness, an accident occurred.
Informal form + かどうかに +
Appended to a phrase ending in かどうか (whether or not) to indicate that an outcome depends on whether a certain action occurs or a state is true.
Verb informal form or い-Adjective
Use the informal form of a verb or い-adjective before かどうか
雨が降るかどうか
Depending on whether it rains or not, the schedule will change.
高いかどうか
Depending on whether it is expensive or not, I will decide what to buy.
合格したかどうかに
Depending on whether I passed or not, I will decide my future path.
な-Adjective stem or Noun
Attach かどうか
静かかどうか
Depending on whether it is quiet or not, it determines whether I can concentrate.
Remember to drop the copula だ when attaching か to a noun or a な-Adjective stem.
Question Clause + かに +
Used after a clause containing a question word (like who, what, when, where) to indicate that an outcome depends on the answer to that embedded question.
Embedded Question Clause
Attach か
何を買うか
Depending on what you buy, the price changes.
誰がリーダーか
Depending on who the leader is, the team's atmosphere differs.
いつ出発するかに
Depending on when you depart, the ticket price differs.
When the embedded question ends in a noun or な-Adjective, ensure that you do not add だ before か