📘 CodingMarble Learn

Social Media and Social Networks

A social network is a graph: people are dots (nodes) and friendships are lines (edges). The number of friends of a person is the degree. Networks are "small worlds": any two people are linked by a short chain of friends. Most apps are free because advertisers pay for your attention and data. Online cruelty (cyberbullying) spreads fast on the same links, so block, report and tell an adult.

🎬 Step-by-step story

  1. These dots are people who use a social app, like WhatsApp groups, Instagram or YouTube. Right now nobody is linked.
  2. Now friendships appear as lines. People are dots and friendships are lines. A picture like this is called a graph.
  3. Count the lines at one dot. That is its degree, the number of friends. The big purple dot has the most friends. It is a hub.
  4. How far apart are A and B? Count the steps along friends. Because of the hub, the chain is short. This is a small world.
  5. The app is free for you. But you give your time and data. Advertisers pay the app money to show you ads.
  6. A post travels along the same lines, very fast. Press the buttons: a hurtful post, a kind post, and block and report to stop it.

Tip: drag the 3D scene to turn it. Use two fingers to zoom.

🤔 Common doubts, cleared

Is the dot a person or an account?

In the graph it is one account. We use a dot so we can ignore everything else and study only who is linked to whom.

What if I follow a star but the star does not follow me?

Then the link has a direction. We draw an arrow, and the graph is called directed. The 3D shows two-way friendships only.

Why does the big dot have a bigger size?

Its size is its degree: more lines means more friends, so we make it bigger. Such a dot is called a hub.

How can strangers be only a few steps apart?

Hubs and long links join different groups. In the 3D, the purple hub shortens the walk from A to B. Press New pair to test other pairs.

If the app is free, who pays?

Advertisers. The coins in the 3D go from the advertiser box to the app, because the app shows their ads to you and uses your data.

Why does a cruel post spread so fast?

Each person who sees it can send it to all of their friends. So the number of people doubles with each step, as the red wave shows.

Does blocking really help?

Blocking cuts the bullying person off from you, and reporting lets the app remove the post. Press Block and report to see the spread stop at the first dot.

Existing social networks

A social network is a website or app where people connect, share and talk. There are several kinds. Messaging apps (WhatsApp, Telegram) are for chats and groups. Photo and video apps (Instagram, YouTube, Snapchat) are for sharing pictures and clips. Short-post and discussion sites (X, Reddit) are for opinions and news. Professional networks (LinkedIn) are for jobs. Wikipedia and online games have communities too.

Every account is a profile. You can follow people, make friends, post, like, comment and share. Some links are two-way (friends) and some are one-way (you follow a singer, the singer does not follow you).

Graphs and their measures

Mathematicians draw a network as a graph. A person is a node (dot). A friendship is an edge (line). If you follow someone and they do not follow back, the edge is an arrow: a directed graph.

Degree = how many edges touch a node. A person with 6 friends has degree 6. The node with the biggest degree is a hub (an influencer, a popular teacher). The sum of all degrees = 2 × number of edges, because each edge is counted at both ends.

A path is a chain of edges from one node to another. Its length is the number of edges. The distance between two people is the shortest path. A graph is connected if there is a path between every pair. A cluster is a group whose members are mostly friends with each other, like a class.

Small world and the Milgram experiment

In 1967 the psychologist Stanley Milgram asked people in one part of the USA to send a letter to a stranger far away. They could only hand it to someone they knew by first name, who passed it on. The letters that arrived took about 5 to 6 hand-overs. This gave the idea of six degrees of separation: almost any two people are linked by a short chain of acquaintances.

Why so short? A few hubs and a few long-distance links join separate clusters. In our 3D, the purple hub cuts the distance from A to B a lot. Large online networks have been measured with an average distance of only about 4 to 5. The result is a small world. Note: many letters never arrived, so the experiment is a hint, not a proof.

Business model: why is it free?

Running servers, engineers and storage costs a lot of money, yet most apps are free. The money comes from advertising. The app learns what you watch, like and search (your data), and also keeps you looking (your attention). Advertisers pay to show their ad to the right group, for example "students aged 15 to 18 who like cricket". Other income: premium subscriptions, selling gifts or stickers, and a fee on shopping in the app.

So the real customer of a free app is the advertiser, and you are the audience. This is why settings like privacy, ad choices and screen-time limits matter. Apps are designed to be hard to put down, so decide your time limit before you start.

Cyberviolence and cyberbullying

Cyberviolence is harm done through phones and the internet. It includes cyberbullying (repeated insults, threats, rude memes, leaving someone out of a group), harassment and stalking, sharing someone's private photos or details without permission (doxxing), spreading lies (fake news and rumours), pretending to be someone else (impersonation) and cheating people for money (scams).

It hurts more than we expect: it can reach the victim at any hour, many people can see it, it can be copied and it is hard to delete. A post spreads along edges like a wave (see the 3D).

If it happens to you: 1) Do not reply or fight. 2) Take screenshots as proof. 3) Block the person. 4) Report the post to the app. 5) Tell a parent, teacher or helpline. In India you can call the Childline number 1098 or report cyber crime at cybercrime.gov.in; other countries have similar helplines.

If you see it happen to someone: do not share or laugh. Support the person and report it. Before you post, think: is it true, is it kind, would I say it face to face?

Try it

Draw your own graph. Pick 6 friends. Draw a dot for each, and a line between two who also know each other. Count the degree of each dot. Who is the hub? Pick two dots that are not joined and find the shortest chain between them.

In the 3D, step 4, press "New pair" and guess the number of steps before you read it.

Key formulas and definitions

Worked examples

1. A friend group has 4 people: Asha, Ben, Chen and Dev. Asha is friends with all three. Ben is also friends with Chen. Draw the graph in words and find each degree.

Edges: Asha-Ben, Asha-Chen, Asha-Dev, Ben-Chen. That is 4 edges. Degrees: Asha 3, Ben 2, Chen 2, Dev 1. Check: 3 + 2 + 2 + 1 = 8 = 2 × 4. Asha is the hub.

2. In the same group, how many steps from Dev to Ben?

Dev is only linked to Asha. Asha is linked to Ben. So the path is Dev - Asha - Ben: 2 steps. There is no 1-step path, so the distance is 2.

3. A network has 100 people and each has exactly 6 friends. How many friendships (edges) are there?

Sum of degrees = 100 × 6 = 600. Each edge is counted twice, so edges = 600 / 2 = 300.

4. A free video app shows 3 ads per video. Each ad pays 0.50 rupee. One user watches 40 videos a day. How much does the app earn from that user per day?

Ads per day = 3 × 40 = 120. Money = 120 × 0.50 = 60 rupees. The user paid nothing, but the advertisers paid 60 rupees for this user's attention.

5. You get a rude message from a classmate in a group chat. Put the best actions in order.

First do not reply. Then take a screenshot. Then block the person and report the message. Finally tell a parent or teacher. Do not forward the message to others.

Common mistakes

Practice quiz

1. In a social-network graph, a friendship is a:
2. The degree of a node is:
3. Milgram found letters reached strangers in about:
4. Most free social apps earn money mainly from:
5. Best first action when someone bullies you online:

Practice: answer these yourself

Type or choose your answer, then press Check. Use a hint if you are stuck; the full solution appears after you answer.

Frequently asked questions

What is a social network in graph terms?

People are nodes (dots) and friendships or follows are edges (lines). Maths and computer science study these graphs to learn how information spreads.

What is six degrees of separation?

It is the idea that any two people in the world are linked by a short chain of acquaintances, often about six people or fewer. Milgram's 1967 letter experiment gave this idea.

How do social media apps make money if they are free?

Mainly by showing ads. Advertisers pay to reach a chosen group, and the app uses your data and attention to match ads to you. Some also sell subscriptions and gifts.

Where this is taught

FranceSecondeThemes

Learn first

Learn next

Related lessons

All Computer Science lessons