Shreya Sapkal

Period 5

Q14: I got this problem wrong, because I miscounted the number of values displayed by programs A and B. Program A should display 1, 2, 3, 4, 5, 6, 7, 8, 9, 10. Program B should display 2, 3, 4, 5, 6, 7, 8, 9, 10, 11. They both have the same number of values, but the values are different, so C would be correct.

Q22: Option B is correct, because we are looking at whether the high temperature was at least 90 degrees for a MAJORITY of days in the month. The counter variable represents the number of days that the high temp is at least 90 degrees, and the variable “total” represents the total number of days in the month looked at. Therefore, in order for the statement to return “true” for the MAJORITY, the value for counter has to be greater than half of the variable total to create a majority.

Q24: From this problem, I learned that in byte coding, some pairs of characters that make up the original string are replaced by an encoded string with a single character, but the original string can be restored.

Q28: From this problem, I learned that using 8 bits allows you to store 28 = 256 characters, and 200 falls within 27 = 128 and 28 = 256. Therefore, we need 8 bits because 7 can’t store up to 200 characters or greater.

*I WAS ONLY ABLE TO COMPLETE UP TO QUESTION 28 DURING MY ATTEMPT. BELOW ARE MY SOLUTIONS FOR THE QUESTIONS I DIDN’T GET TO.*

Q29: The A & B gate will return false with option a. The C & D gate will return false. This gives the final gate a false and a false to work with, and with the “or” statement, this produces a result of “false.”

MY INITIAL RESPONSES

30. C *

31. C

32. A

33. A

34. D

35. D

36. B *

37. B

38. C *

39. A

40. D

41. B

42. D

43. B *

44. B * blog to explain; makes sense now :)

45. C * blog, was confusing

46. D * blog for vocab of undecidable problem

47. B *blog, got wrong

48. D

49. A *blog, got wrong

50. B

51. B *blog for definition of symmetric encryption

52. D

53. A *blog for definition of machine learning

54. D

55. D

56. D

57. B

58. A

59. B

60. A & D

61. A & B

62. C & D

63. B & D

64. B & C

65. B & D

66. C & D

BLOG FOR INCORRECT/KEY QUESTIONS

Q30: I said C for this, because I didn’t account for the call to the procedure “Analysis” in the very first line of code, which would make the run time 5 hours. I knew that it was called 4 times within the loop, but missed the part outside of the loop.

Q36: From this question, I learned that there are constraints in using float-point representation of numbers due to a fixed number of bits, which limits the precision of floating-point, or decimal, values.

Q38: From this question, I learned that the MOD expression evaluates to true based on whether the number inputted is a multiple of the number indicated.

Q43: From this problem, I learned that having a polynomial number of steps/pattern means that the alogirhm runs in a reasonable amount of time.

Q44: I am blogging this problem, because it shows that I made progress from previous problems about Bits. I was able to reason this problem out, since I knew that 4 bits could be used to store up to the integer of 16. 4+8 and 12+3 are both less than 16, but 7+10 is greater than 16, which would cause an overflow error.

Q45: Not gonna lie, I kinda didn’t understand this problem at all :(((

Q46: I blogged this question to remind myself that an undecidable problem is one where you can’t make an algorithm that will always lead to a definite/correct yes or no answer.

Q47: From this problem, I learned that in public cryptography, a message is encrypted using a recipient’s public key, and decrypted using the recipient’s private key. (decrypt –> private. Both have to do with the recipient, not the sender)

Q49: Didn’t really understand how this one worked, lol. I see how it’s checking for the multiples of 5, but I didn’t understand the point of the 5th line of code.

Q51: From this question, I learned that in symmetric encryption, a secret key is used to encrypt as well as decrypt messages.

Q53: From this problem, I learned that machine learning is used to analyze large data sets, reocognize patterns, and make predictions based on data.

Work for Q56:

1. Sum = 1 ; count = 3

2. Sum = 4 ; count = 5

3. Sum = 9 ; count = 7

4. Sum = 16 ; count = 9

5. Sum = 25 ; count = 11

6. Sum = 36 ; count = 13

7. Sum = 49 ; count = 15

8. Sum = 64 ; count = 17

9. Sum = 81 ; count = 19

10. Sum = 100 ; count = 21