# Conditional Probability for Network Science

My network has 100 nodes and 196 edges. Each node has an attribute of "smoker" or "non-smoker". There are 5 smokers and 95 non-smokers.

I want to know the probability of being a smoker given that you are connected to a smoker.

16 nodes in the network are connected to a smoker.

2 nodes are connected to a smoker AND are a smoker themselves.

I want to set up a conditional probability P(A|B) where:

A = node is a smoker

B = node has a neighbor who is a smoker

P(A) = 5/100

P(B) = 16/100

P(A∧B) = 2/100

So P(A|B) = .02/.16 = .125

Is this the right way to do this? I'm a little uncertain about using the number of nodes as the denominator for my probabilities. Might edges make sense too? Particularly for P(B)--the sum of degrees of smoker nodes divided by total edges. In this case 18/196.

Also, if I loop through the network and look at all neighbors, there are 392 (196*2). My graph is not directed, but might this number be relevant too. Thinking of each neighbor-neighbor relationship as a ball in a bowl. In the context of probability, is source->target identical to target->source if the graph is not directed? Or should I be considering each neighbor for each node's perspective?

Visualization below: Blue nodes are smokers

• If you want to increase the likelihood of someone answering your question, please include pictures. Jun 23 '21 at 14:40
• @mhdadk okay I added a visualization of the graph. I'm not sure if I have any pictures that help articulate the question though Jun 23 '21 at 14:49
• While the plot of the graph is refreshing to see on stat.SE, you could probably just summarize the required information for this problem in a contingency table. Jun 23 '21 at 15:06