AI prompts

Learn with the aid of AI

Esempi di casi d'uso dell'IA in un corso di Data Science:

  1. creare un tutor virtuale per gli studenti

  2. creare un assistente virtuale per il docente

  3. richiedere compiti di ragionamento (ad esempio, dimostrazione di teoremi o soluzione di problemi originali)

  4. generare domande di ricerca a partire da un dataset

  5. interpretare i risultati di un'analisi di dati

  6. scrivere codice per risolvere una domande di ricerca

  7. correggere codice

  8. generare visualizzazioni di un dataset

  9. analizzare e interpretare visualizzazioni di un dataset

  10. generare dataset artificiali

  11. riassumere e commentare articoli di ricerca

  12. commentare l'utilità della materia (data science) in certi contesti (ad esempio diffusione di epidemie)

  13. interpretare particolari ruoli (ad esempio, revisore o autore di articoli, esperto di dominio)

Esempi di prompt relativi ai casi d'uso elencati sopra:

Web3 tutor

Write a prompt to generate an AI tutor for the Web3 part of the course. The tutor will assist you during the leaning and integrate the teacher activity. The prompt need to contain at least the following information:

  1. The topics covered in the course. We will explore blockchain technology, wallets, tokens, smart contracts, and decentralized organizations. We will also dig deeper into more advanced topics, like quadratic voting, zero-knowledge proofs, rollups, and more.

  2. We will mainly use Ethereum and Tezos blockchains, with Metamask and Kukai wallets

  3. Introduce yourself, your background, skills and knowledge level with respect to these topics

  4. Describe how you desire to use and interact with the tutor. Try to be creative enough and program an ideal working environment for your learning, tailored on your preferences, skills and knowledge

Network science tutor

Write a prompt to generate an AI tutor for the network science part of the course. The tutor will assist you during the leaning and integrate the teacher activity. The prompt need to contain at least the following information:

  1. The topics covered in the course. Briefly, they are: centrality and power measures, similarity and heterogeneity measures, community detection and clustering, connectivity and resilience, small world, scale-free networks, and epidemics on networks

  2. The language and packages used to analyze the data. We will use R for data science and the following packages: tidyverse (for tabular data) and igraph, tidygraph, and ggraph (for network data).

  3. Introduce yourself, your background, skills and knowledge level with respect to these topics of the course.

  4. Describe how you desire to use and interact with the tutor. Try to be creative enough and program an ideal working environment for your learning, tailored on your preferences, skills and knowledge

If you use ChatGPT try this tutor with GPT Data Analysis & Report AI by Kenneth Bastian.

Elo method

  1. Do you know the Elo method for rating chess players

  2. Why the Elo ratings are roughly normally distributed?

  3. Write in R a function that implements the Elo rating system with the following input and output:

    • INPUT

      • games: a matrix with columns White, Black and Score, where White is the player playing as white, Black is the player playing as black, and Score is the game score (1 = White wins, 0 = Black wins, 0.5 = draw). Players are integer numbers starting at 1. The matrix rows are sorted in chronological order of the matches

      • z: logistic parameter (usually 400)

      • k: update K-factor (25)

    • OUTPUT

      • r: rating vector

Zachary social graph

  1. Do you know the Zachary's karate club graph?

  2. Visualize the graph in R with igraph

  3. Visualize the graph in R with ggraph

Regular and regularizable graphs

Let's talk about regular and regularizable graphs. I will first explain the concepts and then ask you some questions.

Let's focus on undirected graphs for simplicity. An unweighted graph is regular if there is an integer R > 0 such that all nodes have degree equal to R. In a weighted graph, the weighted degree of a node is the sum of weights of edges incident in the node. An unweighted graph is regularizable if the edges of the graph can be weighted with positive integers and in the resulting weighted graph all nodes have weighted degree equal to some R > 0.

All right, so far?

  1. Is a regular graph also regularizable? Why?

  2. However, not all graphs are regularizable: can you provide a simple example of a graph that is not regularizable?

  3. Can you provide an example of a regularizable graph that is not regular?

  4. I will show you a regularizable graph which is not regular (the W4 graph). Can you find the weights of the edges that prove the fact that the graph is regularizable?

Friendship paradox

  1. Do you know the friendship paradox, a phenomenon observed by sociologist Scott L. Feld on social networks?

  2. Mathematically formalize and prove the paradox

Resistance distance, closeness, and betweenness

  1. Summarize this paper

  2. Can you delve into the math of the paper?

  3. Imagine you are a reviewer of this paper for the Social Networks journal. Write a review

  4. Suppose now you are the author of the paper and want to reply to the reviewer's comment [choose one comment, such as "Expand Theoretical Discussion"] above. What would you write?

PageRank

  1. Summarize this paper [ChatGPT produces a more complete summary than Copilot]

  2. The author concludes that:

    "The classic notion of quality of information is related to the judgment given by few field experts. PageRank introduced an original notion of quality of information found on the Web: the collective intelligence of the Web, formed by the opinions of the millions of people that populate this universe, is exploited to determine the importance, and ultimately the quality, of that information."

    Can you comment on this conclusion?

ChatGPT answer

The author's conclusion reflects a profound shift in how information quality is evaluated in the digital age. Traditionally, quality was determined by a small group of experts—authoritative individuals or institutions who could assess content based on their expertise. While this approach ensures a high standard in specialized contexts, it can also limit the diversity of perspectives and favor established hierarchies.

PageRank's innovation lies in leveraging collective intelligence—the aggregate opinions and behaviors of millions of web users—to assess information quality. By analyzing the network of hyperlinks, the algorithm assumes that the "wisdom of the crowd" can offer a meaningful measure of importance and relevance. This democratization aligns well with the open nature of the web, where anyone can publish and share content.

Strengths of this Perspective:

  1. Scalability: The traditional expert-based evaluation model cannot scale to the vast amount of content on the web. PageRank offers a scalable, automated solution that adapts to the web's growth.

  2. Diversity: It captures a broad spectrum of user interests and preferences, reflecting the collective judgment of the web community rather than a select group of gatekeepers.

  3. Dynamic Nature: The algorithm evolves as the web evolves, providing a constantly updated view of what is considered important.

Challenges and Criticisms:

  1. Popularity vs. Quality: The reliance on collective intelligence can favor popularity over genuine quality, leading to the amplification of content that is widely linked but not necessarily accurate or meaningful.

  2. Manipulation Risks: The algorithm can be gamed through practices like link farming and SEO manipulation, undermining its integrity as a measure of quality.

  3. Neglect of Minority Perspectives: By emphasizing consensus, PageRank may undervalue niche or contrarian views that could offer significant insights or innovation.

Dolphin network analysis

David Lusseau, a researcher at the University of Aberdeen, observed the group of dolphins of Doubtful Sound. Every time a school of dolphins was encountered in the fjord between 1995 and 2001, each adult member of the school was photographed and identified from natural markings on the dorsal fin. This information was utilised to determine how often two individuals were seen together.

Here is the dataset. It is a zip file containing two CSV files:

All right so far?

  1. Compute degree, closeness, betweenness and PageRank on the nodes of the network. Perform a gender analysis on the outcomes of these metrics [Perform given analysis]

  2. Are female dolphins significantly performing better than male ones on these metrics? [Perform given analysis]

  3. Compute the relative number of ties in the network that link dolphins with the same sex [Perform given analysis]

  4. To your knowledge, edges linking dolphins of the same sex are 104 over 159. Given this outcome, do you think that the relationship among dolphins in the dataset is love or friendship? [Interpret the analysis outcome]

  5. Can you suggest some additional analysis on this dataset? [Suggest additional research questions]

  6. [Ask AI to write the R code for one analysis that caught your attention]

Generate signed networks

In the context of signed networks, edges have positive or negative signs. Balanced (or positive) triangles have an even number of negative signs (0 or 2), or the multiplication of the edge signs is positive, while unbalanced (or negative) triangles have an odd number of negative signs (1 or 3), or the multiplication of the edge signs is negative. A network is balanced if all triangles in it are balanced.

The argument of structural balance theorists is that because unbalanced triangles are sources of stress or psychological dissonance, people strive to minimize them in their personal relationships, and hence they will be less abundant in real social settings.

All right, so far?

  1. In the attached picture you have two networks (left and right). Which one is balanced and why? [analyze image]

  2. Can you provide a complete network with 5 nodes that is balanced? [dataset generation]

  3. Provide downloadable CSV files for both nodes and edges [dataset generation]

Check balance on signed networks

Let's talk of signed general networks in which each edge has either positive of negative sign. The sign of a path is the product of the signs of its edges. A positive path is a path with positive sign (with an even number of negative signs). A negative path is a path with negative sign (with an odd number of negative signs). It holds that a signed graph is balanced if and only if all cycles are positive. All right so far?

  1. Is the signed network depicted in figure balanced? Why? [reasoning]

  2. Alternative: consider the signed graph with 15 nodes associated with the following adjacency matrix. Is the graph balanced or not? If not, provide a negative cycle. [reasoning]

  3. Write the code in R to check if the a signed graph is balanced [coding]

 0,  1,  1,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0, 
 1,  0,  1, -1,  1,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0, 
 1,  1,  0,  0,  0, -1,  0,  0,  0,  0,  0,  0,  0,  0,  0, 
 0, -1,  0,  0,  0,  0, -1,  0, -1,  0,  0,  0,  0,  0,  0, 
 0,  1,  0,  0,  0, -1,  0,  0,  0,  0,  0,  0,  0,  0,  0, 
 0,  0, -1,  0,  0,  0,  0,  1,  0,  0, -1,  0,  0,  0,  0, 
 0,  0,  0, -1,  0,  0,  0,  0,  0,  0,  0,  1,  0,  0,  0, 
 0,  0,  0,  0,  0,  1,  0,  0,  0,  0, -1,  0,  0,  0,  0, 
 0,  0,  0, -1,  0,  0,  0,  0,  0,  0,  0,  1,  0,  0,  0, 
 0,  0,  0,  0,  0,  0,  0,  0,  0,  0, -1,  1,  0,  0,  0, 
 0,  0,  0,  0,  0, -1,  0, -1,  0, -1,  0,  0, -1, -1,  0, 
 0,  0,  0,  0,  0,  0,  1,  0,  1,  1,  0,  0,  1,  0,  0, 
 0,  0,  0,  0,  0,  0,  0,  0,  0,  0, -1,  1,  0,  0, -1, 
 0,  0,  0,  0,  0,  0,  0,  0,  0,  0, -1,  0,  0,  0, -1, 
 0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0, -1, -1,  0

Community detection

The Zachary network represents the pattern of friendships between members of a karate club at a North American university.

  1. Write R code to plot the network using ggraph

  2. Write R code to compute community detection with all known methods in igraph. For each method, compute the modularity measure. Finally, list methods in decreasing order of modularity

Madrid train bombing network

Jose A. Rodriguez of the University of Barcelona created a network of the individuals involved in the bombing of commuter trains in Madrid on March 11, 2004. Rodriguez used press accounts in the two major Spanish daily newspapers (El Pais and El Mundo) to reconstruct the terrorist network. The names included were of those people suspected of having participated and their relatives. Rodriguez specified 4 kinds of ties linking the individuals involved:

  1. Trust-friendship (contact, kinship, links in the telephone center)

  2. Ties to Al Qaeda and to Osama Bin Laden

  3. Co-participation in training camps or wars

  4. Co-participation in previous terrorist attacks (Sept 11, Casablanca)

These four were added together providing a strength of connection index that ranges from 1 to 4.

Comment on how network science can be useful to dismantle this terror network.

ChatGPT answer

1. Identifying Key Individuals

  • Centrality Analysis:

    • Individuals with high betweenness centrality act as bridges between subgroups. Removing them can disrupt communication and coordination.

    • Individuals with high degree centrality are highly connected and influential. Targeting them weakens the network's overall functionality.

    • Eigenvector centrality highlights individuals connected to other highly influential members, often leaders or critical intermediaries.

  • Practical Impact:

    • Arresting or monitoring these individuals can fragment the network, disrupt planning, or reduce efficiency.


2. Detecting Subgroups and Cells

  • Community Detection:

    • Identifying tightly-knit clusters reveals operational cells or kinship groups. These subgroups may operate semi-independently, making them ideal targets for simultaneous disruption.

    • Understanding connections between clusters (via inter-cluster edges) reveals potential coordinators or liaisons.

  • Practical Impact:

    • Targeting a key cluster or its coordinators can isolate parts of the network, reducing its ability to regroup or coordinate attacks.


3. Analyzing the Role of Strong and Weak Ties

  • Weighted Network Analysis:

    • Relationships in the network vary in strength (e.g., family ties vs. shared training camps). Strong ties represent trusted collaborators, while weak ties connect otherwise unconnected groups.

    • Practical Impact:

      • Disrupting strong ties can reduce trust and cohesion.

      • Cutting weak ties can isolate cells, preventing information flow and coordination.


4. Vulnerability and Resilience Analysis

  • Network Robustness:

    • By simulating the removal of key nodes (e.g., leaders or intermediaries), we can identify how robust the network is to disruption.

    • Networks with low redundancy are particularly vulnerable to the loss of critical nodes or connections.

  • Practical Impact:

    • Focus on removing individuals whose absence fragments the network into smaller, disconnected components.

    • Use targeted arrests or surveillance to create operational bottlenecks.


5. Monitoring and Predicting Future Activities

  • Dynamic Network Models:

    • If the network evolves over time, tracking changes (e.g., the formation of new ties) can highlight emerging threats or leaders.

    • Temporal Analysis can identify critical periods for intervention, such as before planned attacks.

  • Practical Impact:

    • Continuously monitor the network to adapt strategies as it reconfigures in response to disruptions.


6. Understanding Roles and Functions

  • Role-Based Analysis:

    • Different individuals serve specific functions (e.g., recruiters, financiers, planners). Identifying these roles allows tailored interventions.

    • For example, removing recruiters reduces the inflow of new members, while removing financiers disrupts resource flow.

  • Practical Impact:

    • Focus resources on key functions to cripple the network's ability to operate effectively.


7. Strategic Communication Disruption

  • Pathway Analysis:

    • Identify critical communication pathways using shortest paths or flow models.

    • Practical Impact:

      • Interrupt these pathways by targeting nodes or intercepting communications, delaying or obstructing attack planning.

Network models

In Network Science there are two models to generate artificial networks: the random model and the preferential attachment model.

  1. Can you briefly recap how they generate a network?

  2. What are the structural differences of the generated network with the two models?

ChatGPT answer

The networks generated by the random model and the preferential attachment model exhibit distinct structural differences. Here’s a breakdown:


1. Degree Distribution

  • Random Model:

    • The degree distribution follows a Poisson distribution, meaning most nodes have a degree close to the average degree, and very few nodes deviate significantly.

    • This results in a homogeneous network where nodes have similar numbers of connections.

  • Preferential Attachment Model:

    • The degree distribution follows a power-law distribution, meaning a few nodes (hubs) have very high degrees, while most nodes have a low degree.

    • This leads to a heterogeneous network with significant variation in node connectivity.


2. Presence of Hubs

  • Random Model:

    • The network lacks hubs because all nodes have similar probabilities of being connected.

    • There are no nodes with disproportionately high degrees.

  • Preferential Attachment Model:

    • Hubs naturally emerge due to the "rich-get-richer" mechanism.

    • These hubs dominate the network's structure and play a crucial role in connectivity.


3. Clustering Coefficient

  • Random Model:

    • The clustering coefficient is low, as edges are placed randomly.

    • There’s little tendency for neighbors of a node to also be connected.

  • Preferential Attachment Model:

    • The clustering coefficient is higher than in random networks because new nodes are more likely to connect to hubs, creating local triangles and clusters.


4. Path Length

  • Random Model:

    • The average path length is relatively short, but longer than in preferential attachment networks.

    • Paths grow logarithmically with the number of nodes log(n)\sim \log(n).

  • Preferential Attachment Model:

    • These networks are "ultra-small-world," with very short path lengths.

    • Paths grow logarithmically with the logarithm of the number of nodes log(log(n))\sim \log(\log(n)).


5. Robustness

  • Random Model:

    • The network is robust to the removal of random nodes because of its homogeneous structure.

    • It is, however, vulnerable to targeted attacks on a significant fraction of nodes.

  • Preferential Attachment Model:

    • The network is resilient to random failures because most nodes have low degrees.

    • It is highly vulnerable to targeted attacks on hubs, as removing a few key nodes can fragment the network.


6. Real-World Similarity

  • Random Model:

    • Poorly represents real-world networks, which often exhibit hubs, high clustering, and power-law degree distributions.

    • Useful as a baseline for comparison.

  • Preferential Attachment Model:

    • Closely resembles real-world networks like social networks, the internet, citation networks, and biological networks.

    • Captures the emergence of hubs and the hierarchical organization.

The strength of weak ties

  1. Riassumi l'articolo The strength of week ties di Mark Granovetter.

  2. Che impatto ha questo articolo nel contesto della Network Science?

  3. Che impatto ha nel contesto della vita quotidiana?

ChatGPT answer

1. Trovare Lavoro e Opportunità

  • Legami deboli (conoscenti, ex colleghi, contatti distanti) sono spesso cruciali per accedere a nuove informazioni e opportunità:

    • Mercato del lavoro:

      • Le persone trovano opportunità lavorative più frequentemente tramite conoscenti piuttosto che amici stretti.

      • I legami deboli connettono reti diverse, offrendo accesso a risorse non disponibili all’interno della propria cerchia ristretta.

    • Applicazioni pratiche:

      • Networking professionale su piattaforme come LinkedIn si basa sull'importanza dei legami deboli per trovare lavoro, partnership e clienti.


2. Social Media e Diffusione dei Contenuti

  • Le reti sociali online (es. Facebook, Twitter, Instagram) amplificano il ruolo dei legami deboli:

    • Diffusione di informazioni:

      • I legami deboli sono responsabili della viralità dei contenuti, poiché connettono gruppi sociali distinti.

      • Una condivisione di un contenuto da parte di un conoscente lontano può portarlo a nuove audience.

    • Influencer Marketing:

      • Le aziende si affidano ai legami deboli di influencer per diffondere i loro messaggi in modo capillare.


3. Espansione del Capitale Sociale

  • I legami deboli aumentano il capitale sociale di una persona, offrendo accesso a nuove prospettive, conoscenze e supporto:

    • Vita quotidiana:

      • Conoscere persone tramite amici di amici o in eventi sociali consente di costruire reti di supporto più ampie.

    • Collaborazione interdisciplinare:

      • Nelle università o nelle aziende, i legami deboli tra reparti o gruppi diversi favoriscono lo scambio di idee e l’innovazione.


4. Innovazione e Diffusione delle Idee

  • Le innovazioni raramente emergono dai legami forti, ma si diffondono tramite i legami deboli:

    • Innovazione personale:

      • Scoprire un nuovo libro, un'idea, o una tecnologia spesso avviene tramite interazioni casuali con conoscenti.

    • Cultura e tendenze:

      • Le mode o i movimenti culturali si diffondono più velocemente attraverso legami deboli che attraversano diversi gruppi sociali.


5. Diversità e Inclusione

  • I legami deboli espongono le persone a idee, valori e prospettive diverse, contribuendo a una maggiore comprensione e tolleranza:

    • Esposizione a nuove esperienze:

      • Legami con persone di culture o background diversi favoriscono una visione più ampia del mondo.

    • Superare l’isolamento:

      • Le persone che mantengono legami deboli sono meno isolate e hanno maggiori probabilità di accedere a opportunità di crescita.


6. Resilienza delle Reti Personali

  • Avere legami deboli rende le reti personali più robuste:

    • Supporto in tempi di crisi:

      • Se un legame forte non è disponibile, un legame debole può fornire supporto o informazioni essenziali.

    • Adattabilità:

      • Le reti sociali con legami deboli aiutano a far fronte ai cambiamenti nella vita personale o professionale, come traslochi o cambi di carriera.


7. Applicazioni nella Tecnologia

  • Piattaforme online:

    • Le piattaforme come LinkedIn, Facebook e Twitter si basano sull'idea che i legami deboli ampliano la portata delle connessioni.

    • I suggerimenti di “persone che potresti conoscere” sfruttano algoritmi che identificano potenziali legami deboli.

  • Consigli personalizzati:

    • Amazon o Netflix utilizzano raccomandazioni basate su legami deboli, suggerendo prodotti o contenuti apprezzati da utenti lontani nella rete.


8. Decostruzione di Echo Chambers

  • I legami deboli sono fondamentali per combattere le "echo chambers" (camere dell'eco) nei social media:

    • Diversità informativa:

      • Legami con conoscenti distanti forniscono esposizione a opinioni diverse, riducendo la polarizzazione.

Network science and epidemics

  1. How does network science can help in predicting and controlling epidemics?

  2. How can one design an immunization strategy using network science?

For both prompts use Search mode and follow the links.

Last updated

Was this helpful?