Rusty's Blog

Thoughts and musings of someone who's not sure what 'normal' is…

Wednesday, August 25, 2010

A game of dice.

There are times when a little bit of random delay is handy. We see it technology wise in ethernet for example. Classic hub based ethernet operates in a half duplex mode, which works very much as the original thick net and thin net bus architectures did. If you are not familiar with the scheme, think of you, and your neighbor across the street both getting ready to go to the store, or work, or perhaps one of you for the store, the other for work, or who knows. You both check your wallets to make sure that you have what you need when you get to your destination. One of you grabs the re-usable grocery bags, the other the backpack with the laptop for work. You each head out to the garage, open the garage door, start the car, and start backing out to the street. You shut the garage door and you’re now a packet ready to get out onto the streets and highways on your way, but there’s a small problem. You both can’t get onto the street at the same time.

Up to this point everything you each have done doesn’t directly impact what the other does. You probably didn’t even see each other through the point of closing the garage doors. And that’s OK. But neither of you wants to sit there forever on the driveway, and you can’t both get onto the street at the same time, or there will be a collision. So you look at each other and in some way one of you decides to wait till the other goes, and lets the other know to go ahead. Unfortunately computers don’t have a way of passing that information back and forth. Essentially what computers do is check before they put the packet on the net to see if there is already a packet being sent, if there is they wait several milliseconds and check again. If not they put the packet out onto the network and look to see if what they get back on the network looks like their own packet or not. If it doesn’t they assume that a collision has happened, send what’s called a jamming signal (think of this as the driver honks the horn) and waits again. However this time the wait is not a fixed time. If it were, then every time it went to send a packet the other computer sending packets would do the same and they would continue to have collisions.

Instead what the system does is it uses a random number generator to determine how many milliseconds it will wait, then it listens and sends a packet again. This happens pretty much every place where a collision might happen. Think of it as happening at every intersection. There are a lot of places where random number generators are handy in computers.

If you’ve been playing any of a large number of roll playing games (off line variety) you are probably familiar with random number generators as well. You might have used 2 sided, 4 sided, 6 sided, and so on dice to decide how far you may go on a turn, what your character is capable of, how well your character performs a task, damage sustained, etc.

Obviously random numbers are at play in most games of chance. Luck of the draw, flip of a coin, spin of the wheel, and roll of the dice. And there’s bingo and the various lottery games. I have a strong suspicion though that we are going to see random numbers being used more in business as a means of controlling contacts than we do today. Oh we see that at some level with telemarketers, some random dialer walks through a list of phone numbers and connects the person on the line to a telemarketer who’s ‘available’ at that time. Most of the time though, that’s not part of a business relationship, it’s a marketing tactic to keep the telemarketing drone on the phone selling.

Business relationship maintenance is a slightly different problem. Some times you need to follow up a couple of days after a transaction, and other times it might be good to wait a week or more. The better business relationship management software will take into consideration things like knowing when your contact is on vacation and when they will be back. You may adjust contact frequency based on knowing what sort of a mood the person is on Monday vs. Friday, or if knowing that the week is half over on Wednesday is a good feeling or bad. But most of the time you won’t know ahead of time. It’s almost a given that day after day is not going to work out for you. So any solution that says call the day after you’ve called, probably won’t work in your favor. Likewise unless you have a fixed business relationship that probably doesn’t need a specific contact schedule either, it’s probably a good idea to at least touch base every couple of weeks. But for a while it is probably a good idea to work with the ‘about once a week’ schedule. But with a little bit of randomness built in.

This is where a pair of 6 sided dice can be handy. If you look at the collection of ways that 2 dice can be summed together you end up with the following series. 2 – 1, 3 – 2, 4 – 3, 5 – 4, 6 – 5, 7 – 6, 8 – 5, 9 – 4, 10 – 3, 11 – 2, 12 – 1. That means 12 times out of the possible rolls you should end up with a 2, 3, 4, 10, 11, or 12. the remaining 24 times will result in 5, 6, 7, 8 or 9. If you treat the result of the roll as the number of days to wait before calling again, you trend strongly for calls about a week apart, with ranges from a couple of days apart to almost 2 weeks apart.

But perhaps that’s too frequent. You don’t want any calls to happen within 5 days of when you last talked. And the relationship is pretty good, but you don’t want to go over a month between calls. So add more dice. Let’s work with 5 dice. The sums and frequency and up looking like: 5 – 1, 6 – 5, 7 – 15, 8 – 35, and so on. It turns out that there are 7,776 possibilities, and 780 each are 17 and 18, and if you plot the count you end up with a classic bell curve. In other words if you wait this many days before calling, you are most likely to call between 2 and 3 weeks from the last time you called. I will leave it to someone else to calculate the standard deviations.

That said, I like the distribution pattern of 2 dice a little better. So you could use 8 sided or 10 sided dice and sum, or even a pair of 20 sided and get a range from 2 to 40 if that’s the range you are looking at. 3 10 sided dice would give you a rang of 3 to 30 with a tendency towards 16 as well.

For really long term contacts of course you could use the 2 10 sided dice method gamers use to get a random percentage. Designate one 10 sided die as the units position, the other as the 10s position, a double 0 is 100, otherwise a zero in the 10′s position means that the other die gives you the range of 1 to 9%, and a zero in the units position gives you 10, 20, …, 90. That would make a reasonable range for calculating a delay of anywhere from tomorrow through 3 months (and a little) from now.  I think that range is a bit too long, but it may work out for you.

But as I say, the better relationship management software and practices are going to use information you glean from your relationship already to suggest when to call again.

posted by Rusty at 6:14 pm  

Monday, December 14, 2009

The Caledar.

Well, it’s time to have my calendar assembled and ready to ship out for family members. It’s not perfect, but it’s getting better.

The source file for generating the calendar takes a bit of work every year. In the output are several different varieties of events. The lunar calendar is maintained separately. Personally I think that should be true for a couple of other sets of data, but it doesn’t quite work that way.

Most of the content is of the variety , month, day, text. I’m not expecting most of that to change from year to year, but there are exceptions.

Holidays get an asterisk ‘*’ after the day. or at least before the text.

Next in complexity is stuff that is related to our trip around the sun, that doesn’t quite fit a month day format. Equinoxes, solstices and meteor showers end up being in the same format as ‘events’ but may change from year to year. For example the vernal equinox was on March 19 in 2009, and will be March 20 in 2010.

Then comes ‘national holidays.’ Not all are actually holidays for all people, but that’s not the worst of it. Holiday’s ‘Observed’ is either the Monday before or closest to a date, or the closest working day. When the 4th of July falls on a Sunday, it is ‘observed’ on the 5th. On a Saturday it is observed on the 3rd. Memorial day is observed on the last Monday of May, and so on.

Every year the Jewish holidays move around, because they are part of the Jewish calendar which is based mostly on the lunar month rather than a solar month. There are additional complications based on the fact that observance of most of them begins at sunset the previous day, which also affects when some of them get set. More on that later.

Worst though is the Christian calendar. The easy ones are Christmas, and All Saints Day. The fall on the same days of the same months every year. Next up come things like the Sundays of Advent.

Easter poses a bit of a problem though. If you grew up going to Sunday school, you probably recall that Christ was crucified on Friday because the Saturday of passover was considered holy by the Jewish faith, and they could not allow him to be hanging on the cross on that day. So Easter Sunday is axiomatically tied to Passover. The rule for deciding when Easter is, is The first Sunday after the first full moon after the first full day of spring. So if the vernal equinox is at 11 pm on the 19th of March, and the full moon is at 2 pm on the 21st, then Easter would be on the following Sunday. That could be as early as the 29th of March.

Based on that you would expect passover to be observed the same week. Right? Well, not really. Remember that the Jewish set holidays based on sunset rather than midnight. So if the vernal equinox is at 11 pm, which is after sunset, on the 19th, it is treated as if it happened on the 20th. So the first full day after the vernal equinox is not the 20th, but the 21st. If the full moon happens at 2 pm on the 21st, it is not the Passover moon, but the full moon before the passover moon. Passover does not start for another 29 days. So while I can calculate both events, the actual calculation will depend on different parameters, and as a result will end up pointing to different days or periods of time. Of course there are a number of events on the christian calendar that are directly related to when Easter is set. Palm Sunday, Ash Wednesday, Ascension day, etc.

I’ve also completely glossed over ‘where’ the time has to be compared for determining sunset, and midnight. The Vernal Equinox is at a specific UTC time, but may be posted to a calendar as a local time. For Christian calendars the comparison is likely to be against the local time for Rome which is UTC +1, vs. Jerusalem at UTC +2.

A minor addition is that in addition to the commonly recognized observance of Christmas and new years, there are also orthodox Christian observances which are not the same days as appear on the western calendar because they are based on the Julian calendar observances and not the Gregorian calendar dates.

There are potentially hundreds of additional calendars I could add. For example there are all of holidays recognized in India. I have not added the events in the Islamic calendar, or posted things like various Asian new year and other holidays important to the region. In theory there are over a hundred different country calendars with different holidays being designated. If someone wants to throw together and comment to the page a list of holidays or events that they think should be on a calendar, and would like a calendar created for them, feel free. Eexamples of the calendars that can be created are at http://www.beresourceful.net/~rusty/Calender2010/2010-Calendar_pub.pdf and http://www.beresourceful.net/~rusty/Calender2010/2010-Calendar_pub_p.pdf

As I stated in the begining, I may have a few of the items wrong. In any case, enjoy.

posted by Rusty at 1:39 am  

Friday, November 12, 2004

paperspam

Paper Spam…

I got to my car last night and was disapointed to find that I had some fresh paper spam on my car. In this case it was a religious tract, which I find somewhat less offensive than Herbalife or varient MLM spam that I seem to get with entirely too much frequency.

While I do find it less offensive, it still violates my primary disagrement with the practice, and was agrivated in that this spam was laminated. (plasticised to improve wear life)

There was only one thing that this piece had going for it. Asside from it being a religious tract, it was also a 2005 wallet callendar.

I will carry it in my wallet, as I do occasionally need to check a callendar. I don’t expect it to change my christian outlook on life.

Even with the fact that I will make use of it, I do not approve of the practice. At a very minimum well over 90% of paper spam on a car in a parking lot will be dropped on the parking lot itself by the car owner. Unless (and even most of the times when) the owner of the parking lot sweeps it nightly, most of this material is going to be blown or rained into gutters, storm sewers and the surounding environment. (To the immeadiate East of the lot my car was in is a rather large pond that gease summer in and rais their young) The dies, bleaches, inks plastics (including toner) are therefore going to be seaping into the environment, some of which is not environmentally friendly.

I think that should someone be caught placing paper flyers on cars, they should be charged with littering, with an incidence count of one charge per item placed per car. (100 cars, 100 counts)

That’s just my opinion however.

-Rusty

posted by admin at 1:59 pm  

Powered by WordPress