# Assessment question with calendar date

**URL:** <https://forum.code.org/t/assessment-question-with-calendar-date/19018>\
**Category:** Unit and Lesson Discussion\
**Tags:** csp-unit-1\
**Created:** [August 22, 2018, 9:07pm UTC](https://forum.code.org/t/assessment-question-with-calendar-date/19018 "2018-08-22T21:07:27Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![kadkins](https://avatars.discourse-cdn.com/v4/letter/k/f6c823/32.png) [@kadkins](https://forum.code.org/u/kadkins)\
**Post date:** [August 22, 2018, 9:07pm UTC](https://forum.code.org/t/assessment-question-with-calendar-date/19018/1 "2018-08-22T21:07:27Z")

</div>

There is an assessment question in the lesson plan that I don’t understand:

\_Develop a protocol that allows the user to send a calendar date (mm/dd). What is the minimum number of bits necessary?\_The answer is listed as 9 bits.

How?

---

<div class="post-metadata">

**Author:** ![hannah](https://sea2.discourse-cdn.com/flex016/user_avatar/forum.code.org/hannah/32/4837_2.png) [@hannah](https://forum.code.org/u/hannah)\
**Post date:** [August 29, 2018, 2:25pm UTC](https://forum.code.org/t/assessment-question-with-calendar-date/19018/2 "2018-08-29T14:25:06Z")

</div>

Hello Kadkins,

The highest number we need to send to communicate months would be 12 (December). This could be represented like so in binary: 1100

The highest day we might need to send would be 31. In binary that could be: 11111

The protocol could state that the **first four bits** indicate the **month** and the **last five bits** indicate the **day**.

We need a total of at least nine bits in order to communicate the biggest possibility (12/31).

12/31: 110011111

Other examples:  
1/5: 000100101 (0001 = 1, 00101 = 5)  
5/25: 010111001 (0101 = 5, 11001 = 25)

Hope this helps!  
~ Hannah

---

<div class="post-metadata">

**Author:** ![glenn.crane](https://avatars.discourse-cdn.com/v4/letter/g/839c29/32.png) [@glenn.crane](https://forum.code.org/u/glenn.crane)\
**Post date:** [August 31, 2018, 2:19am UTC](https://forum.code.org/t/assessment-question-with-calendar-date/19018/3 "2018-08-31T02:19:40Z")

</div>

I am teaching this today and figured I could discuss with my students two main methods.

One of which is above - Four bits for Month + Five bits for day

Alternatively if you look at how many days in a year 365 you could figure it out using 9 bits - **101101101**

I believe the question is trying to lead them to protocols, and therefore sending the month/day in chunks, but either method can answer the minimum number of bits portion of the question

---

<div class="post-metadata">

**Author:** ![glenn.crane](https://avatars.discourse-cdn.com/v4/letter/g/839c29/32.png) [@glenn.crane](https://forum.code.org/u/glenn.crane)\
**Post date:** [September 5, 2018, 5:34am UTC](https://forum.code.org/t/assessment-question-with-calendar-date/19018/4 "2018-09-05T05:34:35Z")

</div>

Turns out my method (above) does not work.

Using the example of a 75x75 grid - The x and y would both take 7 bits = Total of 14 bits.

However 75x75 = 5625 which would only take a total of 13 bits.

Can anyone explain this. Would technically 13 or 14 be correct?

---

<div class="post-metadata">

**Author:** ![hannah](https://sea2.discourse-cdn.com/flex016/user_avatar/forum.code.org/hannah/32/4837_2.png) [@hannah](https://forum.code.org/u/hannah)\
**Post date:** [September 6, 2018, 3:36am UTC](https://forum.code.org/t/assessment-question-with-calendar-date/19018/5 "2018-09-06T03:36:31Z")

</div>

> [@glenn.crane](#):
>
> Turns out my method (above) does not work.
> 
> Using the example of a 75x75 grid - The x and y would both take 7 bits = Total of 14 bits.
> 
> However 75x75 = 5625 which would only take a total of 13 bits.
> 
> Can anyone explain this. Would technically 13 or 14 be correct?  
> How?

I’m linking [here](https://forum.code.org/t/problem-question-bits-to-encode-a-75-75-grid/19457) for posterity’s sake the continued discussion we had surrounding @glenn.crane’s example in another thread. It’s an interesting read that I hope others can benefit from!
