Please ignore secret bonuses. Secret tests do NOT award bonus. Max hw grade is 30+2 bonus efficiency

Do you need help?

Can we calculate the period using the length? [HW4req]

f
federica valeau (450 points)
2 5 7
in HW4 required by (450 points)
retagged by
Good evening, I noticed that the schema of the prosodic structure is the same as the one of the length of the verses, therefore can we use the lengths to evaluate the period? I did it with my code and now I pass all the tests (ignoring the timeout). Thanks in advance
471 views
closed

1 Answer

Best answer
B
Bruni1933963 (1160 points)
0 0 4
by (1.2k points)
selected by

 " the prosodic structure is obtained considering both the number of SE (#SE) and the final SE of the verses "

- program01.eng.py

No Federica, the problem is pretty clear: you should check both the number of SE and the final SE of the verse. 

There are tests in which the same final SE corresponds to two different numbers of SE (and so if you check just the final SE you fail the test) but apparently there are no tests that check the opposite way round ( so for example the same number of SE corresponds to two different final SE).

I strongly suggest you change your code since you might not be this lucky in the secret tests ( to be clear in the secret tests the situation explained above might happen and your code isn't ready for that! )

So since you can't be 100% sure that the prosodic structure corresponds to the number of SE, you can't use the number of SE to evaluate the module.

a
alessandro.bellia (930 points)
0 2 12
by (930 points)
For what I saw prosody and module are not as connected as they seem. Prosody follow the module's scheme, but the individual number of the prosody are different and there is no way to calculate a path with different numbers without importing anything and without hardcoding anything, or at least that's what it seemed to me
A
Alessandro Vecchi (1870 points)
1 10 18
by (1.9k points)
Nono it's surely possible. Since the period is the most difficult part of the homework I really hope that it doesn't depend on the length of the verses as the text of the homework says...

''' From the prosodic structure you should find the period, i.e. the minimum length of verses that repeats with the same schema.
        In this example the period is 5, in facts the prosody is obtained by repeating twice the [0, 1, 1, 2, 0] schema,
            since the sequence [0, 1, 1, 2, 0] has the same schema of [3, 4, 4, 5, 3] '''

It says clearly that the period must be found from the prosodic structure, so the fact that in the tests there aren't cases in which the length of the verses doesn't follow the scheme of the module I hope it's just a coincidence. Btw would be really appreciated an answer from a prof.
Dario_loi (1710 points)
1 4 10
by (1.7k points)
A considerable part of my program is based on the assumption that the length of the verses can be used as a shorthand for the prosody on the calculation of the period

It works on all the tests so I wouldn't have thought of this fact as a lucky coincidence, but as a property of the prosody itself, if this is not the case it would be really unfortunate, as I would have to rewrite some of my code to cover the edge cases/rewrite my period calculations altogether...

any clarification from a professor would be deeply helpful to me, so I could begin to work on a correct version in case it was wrong.
angelo.spognardi (8170 points)
75 155 224
by (8.2k points)
Hi all, the text leaves no space to any interpretation: you HAVE to take into account the final SE. There is no doubt that in the secret test this situation will be tested (i.e. you can expect a test were all the verses do have same length, but different final SE). So, please, change your code accordingly.
A
Alessandro Vecchi (1870 points)
1 10 18
by (1.9k points)
Ok thanks professor. but this is about the prosody. What about the period? The text leaves two different interpretations:

1.it defines the period as '' the minimum length of verses that repeats with the same schema''. This means that there is always a scheme on the verses and so we can easily calculate the module from this statement

2. on the other hand it says also that '''From the prosodic structure you should find the period'''. This means that we ''' can''' find the module also considering the prosody, we '''must''' find it from the prosody or something else?

However, if the first interpretation is correct, I think that the way my colleagues used to find the prosodic structure is correct too, since we don't have to take in account the final SE anymore
andrea.sterbini (207920 points)
749 1267 2373
by (208k points)

Le me be clear: I WILL generate ON PURPOUSE secret tests with all verses with same length.

A
Alessandro Vecchi (1870 points)
1 10 18
by (1.9k points)
Okok professor, thanks for the answer. I apoligize in advance for the insistence but I need to know which one of the interpretations is correct. If for 'scheme' we are intending the scheme of the len of the verses (such as 13,14,14,8,13---13,14,14,8,13) we obtain a result, if the scheme is the one of the prosodic structure we obtain another result. Thanks and sorry, but it's just to be sure since it's not clear from the text.
andrea.sterbini (207920 points)
749 1267 2373
by (208k points)
read the exercise again