comp-think / 2024-2025

The GitHub repository containing all the material related to the Computational Thinking and Programming course of the Digital Humanities and Digital Knowledge degree at the University of Bologna (a.a. 2024/2025).
12 stars 0 forks source link

Lecture "Algorithms", exercise 1 #5

Open essepuntato opened 1 month ago

essepuntato commented 1 month ago

What is the result of the execution of the algorithm in Figure 4 of the chapter "Algorithms" using "Peroni", "HTML", and "Peroni, S., Osborne, F., Di Iorio, A., Nuzzolese, A. G., Poggi, F., Vitali, F., Motta, E. (2017). Research Articles in Simplified HTML: a Web-first format for HTML-based scholarly articles. PeerJ Computer Science 3: e132. e2513. DOI: https://doi.org/10.7717/peerj-cs.132" as input values?

ValkyrieCain9 commented 1 month ago

2

nicoldamelio commented 1 month ago

2

mir-pin commented 1 month ago

2

rumana-mh commented 1 month ago

The output would be 2.

maridematteis commented 1 month ago

The result of the execution of the algorithm in Figure 4 using the inputs presented in the question is 2. In fact, both strings ("Peroni" and "HTML") are present in the bibliographic entry. However, an ambiguity could have been raised since "HTML" is present twice in the bibliographic entry. But considering that the algorithm asks if the words are present and not how many times they are present, the final answer is 2.

picontestudio00 commented 1 month ago

The result is 2

arinee01 commented 1 month ago

The result value is 2

cristinavercelli commented 1 month ago

The result is 2

digitalctrlv commented 1 month ago

2

justyna09549 commented 1 month ago

2

simplycyrus99 commented 4 weeks ago

"Peroni" and "HTML" are both present in the bibliographic text thus 0+1=1 1+1=2 The answer is 2

Fahmyrose commented 4 weeks ago

The result of the execution of the algorithm is 2: Immagine WhatsApp 2024-10-22 ore 15 52 30_df9a7452

VirgiBo commented 4 weeks ago

2

ceciliavesci commented 4 weeks ago

2

martinamrc commented 3 weeks ago

The answer is 2

theair-hub commented 3 weeks ago

2

ERendall commented 3 weeks ago

The output would be 2.

Just to get people thinking, HTML appears twice in the bibliographical entry. But the second has a hyphen following it. I presume, then, that the hyphen distinguishes the latter 'HTML' from the former, making it a different and distinct entity?

I am thinking about the 'Find' function in Microsoft Word; inputting a sequence of characters identifies all sequences in the document, not taking into consideration whether these characters seem different from each other visually.

To make this clearer, as an example, when one writes 'de' into the Find box, the algorithm identifies all words with the characters 'de' in them.

Would the algorithm be able to distinguish between the two, despite the fact that the same sequence of characters appears twice? If so, or if not, I guess it depends on the definitions of the algorithm used in the 'Find' function? Or am I mistaken?

(Sorry for the long post, but I thought I should say something about this...!) :)

P.S. I realise @maridematteis has also observed this...

essepuntato commented 3 weeks ago

Hi all, thanks for your answers. Indeed, "HTML" appears two times in the bibliographic entry, but that does not affect the algorithm's operation since it checks if the word (i.e. the string) is present or not in the bibliographic entry. Thus, since it is there (indeed two times!), the answer to the second decision widget of the diagram would be "yes" anyway.

KikaYang commented 3 weeks ago

2