Monday, April 25, 2016

Omer Counting in Different Bases

My father-in-law showed me a ספר that discusses whether or not you can fulfill your obligation to count the עומר using other base systems besides decimal. This a good case where the question is far more interesting than the answer. Surely, one should not do that. However, it was a very interesting concept I had never thought of before. So, I added a widget on the blog's sidebar which will display the day of the Omer in various relevant bases.

On the insistence of reader Pi (that's his shorter name), I have added base 7 as well as a pick-your-own-base section.
Here is the excerpt from the ספר.

16 comments:

  1. In practise, we count in base 10 and base 7. Why is base 7 not in the sidebar?

    ReplyDelete
  2. Happy now? :-)
    Don't say I never did anything for you.
    :-)

    ReplyDelete
  3. Wow, thanks. It stops after base 36 - I was wondering what it would do after running out of letters of the alphabet.

    Did you have to write the applet yourself or did you get it somewhere?

    ReplyDelete
  4. I wrote it. It took me a while but it is actually quite simple. The base conversions were the simplest part. Go to the source page and you can see the JavaScript code.
    The tricky part was figuring out dynamically what the beginning day of the Omer is. PHP has built in Jewish Calendar functions which is what I used. It will work unattended now. It will automatically show custom "error" messages if after Shavuos or before Pesach. I can send you the full code if you like.

    ReplyDelete
  5. At one point it looked like the date had changed after sunset (I was starting to wonder which location was used) but now it's after midnight (EDT) at it's back to the 27th day when it should be 28 (decimal). Is this a bug?

    ReplyDelete
  6. It's complicated. It's half a bug (not a beriyah.) It was a bug that I fixed and somehow unfixed. But I refixed it.

    ReplyDelete
  7. What do you mean by "relevant" in "So, I added a widget on the blog's sidebar which will display the day of the Omer in various relevant bases"?

    ReplyDelete
  8. It means that while you can theoretically count in any base you please, I considered binary, octal and hexadecimal to be the only ones relevant as they are the ones people are familiar with.
    Of course, that all really went by the wayside once you insisted on being able to plug in any base you please.

    ReplyDelete
  9. The output is inconsistent. It says today is 2B (with a capital B) in hex, but if I choose base 11 it gives 3a with a lowercase a. I see in the code that the hexadecimal line includes "toUpperCase()" which you left out of the choose-your-own-base section. Want to add it in?

    ReplyDelete
  10. As I was writing the previous comment, I realized that today's hexadecimal Omer count belongs to Hamlet. Or not.

    ReplyDelete
  11. It's especially problematic if you choose base 22 today, because a lowercase l looks like a number 1.

    ReplyDelete
  12. Maybe it depends on which browser you use, but the box containing the sidebar widget seems to be slightly too small, so that you have to scroll to see the answer for "choose you own base". Can you enlarge it slightly?

    ReplyDelete
  13. Today is one of the days when the decimal digits (46) are the same as the base-7 digits (64), in reverse order. Remember in high school when we worked out all the occasions when that could happen?

    ReplyDelete