Stuck on an exercise

Solved
yao -  
mamiemando Posted messages 33228 Registration date   Status Moderator Last intervention   -

Hello,

I need help to solve this problem please:

Memory: We are looking to store 1.5 million documents in memory. Each document contains 1000 values represented on 8 bytes. How many gigabytes (GB) of memory do I need at a minimum to store all the data in memory?

Select the option(s) that seem correct to you

1 GB

4 GB

8 GB

16 GB

2 answers

  1. brucine Posted messages 24849 Registration date   Status Member Last intervention   4 170
     

    Hello,

    Whether we multiply bytes or strawberries, there is only in the multiplication of the loaves by the Lord that a part of mystery lies.

    It's not very clear where the problem is apart from having learned the definition of a byte and its multiples and to do multiplications.

    1
    1. brucine Posted messages 24849 Registration date   Status Member Last intervention   4 170
       

      If we don't want to struggle by staring at the number of zeros, here's a hint: we need to use numbers in the form x * 10^n and perform operations on the powers, but this requires additional knowledge beyond just knowing how much 1 million of something or a gigabyte of another is worth.

      0
      1. [Dal] Posted messages 6122 Registration date   Status Contributor Last intervention   1 108 > brucine Posted messages 24849 Registration date   Status Member Last intervention  
         

        Hello brucine,

        The question is less obvious than it seems:

        https://fr.wikipedia.org/wiki/Octet#Confusions_entre_multiples_binaires_et_d%C3%A9cimaux

        :-)

        ... but anyway, there's a good chance that in Yao's course, he was told that 1 gigabyte represents 10^9 bytes and that the question is purely theoretical and does not assume dealing with real systems whose manufacturers can specify capacities in powers of 2.

        1
      2. brucine Posted messages 24849 Registration date   Status Member Last intervention   4 170 > [Dal] Posted messages 6122 Registration date   Status Contributor Last intervention  
         

        Hello,

        Yes, I know, but given the level, I don't think the question is tricky (we could have also tried to mislead the attention of the hasty reader by talking about bits and not bytes).

        I don't know which course this is about, but it’s clearly basic; I don’t see it being posed to anyone who has taken a specialized training in computer science, even at a medium level (and who, contrary to what we observe, would master multiplication calculations and powers of 10 or even 2, it doesn’t change anything).

        Formally speaking, it's "just" since we talked about GiB and not GiB even if the good student should ask themselves the question and consider both scenarios.

        At this "common" level, we speak in "manufacturer decimal" like, for example, a disk of 512 GiB (and also the famous USB drives, everyone knows that a 32 GiB one actually contains roughly 29 billion bytes).

        0
  2. mamiemando Posted messages 33228 Registration date   Status Moderator Last intervention   7 940
     

    Hello,

    To begin with, the exercise suggests that there are several solutions. The proposed values being all distinct, as we are only looking for the smallest one among them, there is at most one answer to choose in this exercise.

    The statement indicates that there are 1.5 million documents containing at least 1000 x 8 bytes, that is 8000 bytes per document, assuming that each document contains nothing else, resulting in a total size of exactly 12 billion bytes.

    The first three proposals are clearly too small (regardless of whether we are talking about GB or GiB). For example, if we consider the third one, 8 GiB = 8 * (1024) ^ 3 = 8,589,934,592 bytes (which is ~8.5 billion bytes) is less than the required 12 billion bytes. Therefore, the solution must be 16 GB.

    Good luck

    0