From: Paulo Roberto Bianchi de Oliveira on
Hi, if I have some string like: "2010051912101" can it be reduced to as min
numbers as possible?

Because it's the "date+hour+milsec+etc" generated on the DB, but on the doc
that will be impressed it must be reduced because the operator will inform
it via phone... So minimizes errors typing on tel keyboard

Do you know if there's any algorithm? And I need to be able to get the
inverse too, the reduced to the original string...

Is it possible? Thanks

From: Evertjan. on
Paulo Roberto Bianchi de Oliveira wrote on 19 mei 2010 in
microsoft.public.inetserver.asp.general:

> Hi, if I have some string like: "2010051912101" can it be reduced to
> as min numbers as possible?
>
> Because it's the "date+hour+milsec+etc" generated on the DB, but on
> the doc that will be impressed it must be reduced because the operator
> will inform it via phone... So minimizes errors typing on tel keyboard
>
> Do you know if there's any algorithm? And I need to be able to get the
> inverse too, the reduced to the original string...

All redusing reduces diversity,
but if you do not mind that,
you could reduce to a 1 character string:

function reduce(s){
return (s=='2010051912101')?'1':'0';
};

function expand(s){
return (s=='1')?'2010051912101':'';
};


--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
From: Evertjan. on
Evertjan. wrote on 20 mei 2010 in
microsoft.public.inetserver.asp.general:

> Paulo Roberto Bianchi de Oliveira wrote on 19 mei 2010 in
> microsoft.public.inetserver.asp.general:
>
>> Hi, if I have some string like: "2010051912101" can it be reduced to
>> as min numbers as possible?
>>
>> Because it's the "date+hour+milsec+etc" generated on the DB, but on
>> the doc that will be impressed it must be reduced because the operator
>> will inform it via phone... So minimizes errors typing on tel keyboard
>>
>> Do you know if there's any algorithm? And I need to be able to get the
>> inverse too, the reduced to the original string...
>
> All redusing reduces diversity,
> but if you do not mind that,
> you could reduce to a 1 character string:
>
> function reduce(s){
> return (s=='2010051912101')?'1':'0';
>};
>
> function expand(s){
> return (s=='1')?'2010051912101':'';
>};

More:

This is no "Reductio ad absurdum" but the concequence of your failing to
define constraints of that string, like:

Is only one string possible, either it is or empty?
Must the string always have the same length?
Can there be only figures in the string?
Does the string contain a date/time sequence?

If the string can have any content, so has no constraints,
no reduction is possible.

If the string is concidered to be a base-10 number,
you could convert it to a base 26+26+10= 62 number,
and use A-Z a-z 0-9 to depict that.



--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)