Okay, maybe you can help me come up with a problem. I can feel it coming on, so here is where I am going:

A trick for pricing things for negotiation is to hide the price encoded. One of the ways of doing this is using a 10 letter isogram such as "upholstery" to convert 0=u, 1=p, 2=h...9=y. So then you could mark a tag or sticker with Tly for $6.49 (with the capitols for dollars and the lower case for cents) Alternatively, you could have an asking price and hide a lowest taking price TlyLuu Meaning that you could ask 6.49 but settle for 4.00. This way someone else could negotiate with the customers, from the person that set the prices.

So writing a program should be unnecessary, the reason for using the isogram is to make it easy to remember and figure it out simply.

So how hard would a program to do this be? Ideas?

@Absinthe
Just spitballing here. Maybe a program to further obfuscate prices by generating sequences of isograms so buyers wouldn't be able to guess what letters mean over time, since different items would be hidden by different isograms and the encoded price has an additional signifier for which one it's encoded with? Then like a weird constraint like the first letter of each word used spells something out or something?

@serra that just begs for a rick roll :) I was thinking something more like encoding with one word, and then switch the letters around in the word and effect a 15, 20, 30% discount. Or something like that.

Follow

@serra not sure if it is possible, @freemo would know.. Might involve using different bases or something

@Absinthe
I'm not entirely sure I understand the original problem... An item would have a name then a encoded code and the encoded code along with the name can be used to decide some pricing info. Is that it? But what if the name has fewer than 10 letters. Since there isn't a letter for every number how is that handled?
@serra

@freemo @serra just a sticker with a sku#. Hey buddy how much for this thing? It should seem like you have all the prices memorized or made up on the spot :)

@Absinthe
Ok then I'm still confused how exactly you are encoding the information into the sku
@serra

@freemo @serra

what I was thinking was something like using the word "ABCDEFGHIJ" to encode a price BAjj as 10.00 if I were to change the word to "BCDEFGHIJA" then decoded the same price it would be $09.99.

I wonder if there is a system whereby encoding with one word, and decoding with another would be capable of effecting a change of some reasonable % like 10%, 15%, 35%.

I kind of thought you would have to change bases like base(*) or something, or if you had a pair of numbers that would be multiiplied or otherwise functionally modified. The problem being that you only have 10 numbers to play with.

I am not saying it is possible, but it seems like you could do it. I don't have a problem just trying to make one. Otherwise I don't have a real problem for this week yet. :)

@Absinthe

Would a single master word be selected as the key and then applied to all the products in the store. Or is the word unique to each item? Is the word just arbitrarily chosen?

Also is the word always exactly 10 letters long then?

@serra

@freemo @serra single word.

The base premise is that you would have picked a word you could remember like "UPHOLSTERY" then you would be able to look at the sticker and see Yyy and know it was 9.99 without having to have a decoder ring and calculator :)

But as a coding problem I am moving away from that and letting a computer do all the work. With that in mind just wondering if I could simply change the letters around to accomplish an overall discount or markup. Hey, it might not be possible, but it sounded like it should be.

(This is starting to remind me of my "Death of a Salesman" interview question fiasco :) remind me to tell you that story some time)

@Absinthe

Ok i think i got it, so one word across all the products and then some new word that would produce a consistent discount of the same percentage across all products. I'll consider it when i have the mental capacity in a bit, but I think I get the idea.

@serra

@Absinthe

Ok so i thought about it. If there is a single word and that word is always garunteed to be exactly 10 letters, one for each digit from 0 - 9, then no, this isnt possible.

If you allow for words larger than 10 letters such that multiple letters associate with the same digit then it could be possible if there were some rules around which letters were used in a particular item's sku. After all if we have the number of products multiplied by 10 and that is the number of letters int he original word then you'd have enough letters for each product to have its own independent mapping, so in this extreme case it would be possible.

The question is, what sort of interesting solutions or puzzles may like between these two cases.

@serra

@freemo @serra what I was thinking might be that if you set the prices using base 8 then you would have two letters left over so in the previous example a-h could be the only numbers used in the actual base price and i and j 8 and 9 could indicate whether or not to apply a consistent discount. best case you could have 89 meaning that rest of the price is standard and 98 means divide for a x% discount. I think that would be doable. Then if you could represent it with base 5 or 6 you would have 4 or 5 letters left over to have a modifier. I think it is a doable math issue once solved would make for some interesting "word" choice problems with fun meaningful anagrams.

@freemo @serra consider away. The way I see it if you do base(6) that leaves you with 4 letters. If you treat them as a permutation that gives you 4! Or 24 different values to code discounts or markups.

@Absinthe
Yea but that means the akus need to also be coded in base 8 which brakes the initial rules of a isogram. Which is fine just saying it doesn't satisfy the initial challenge.

But I'll consider if such a scheme could ever work for infinite items of varying price when I have the energy to consider this further (busy right now)
@serra

@freemo @serra not necessarily, the isogram will do 0-9 but you only use 0 to base-1 for your price then use the permutations of base to 9 for your modifier. So the price part WOD simply get calculated according to its base. Then the modifier would be calculated as a value based on permutation like 6789 = 1 to 9876 = 24 which could be arbitrary multipliers or divisors of the price.

@Absinthe

I know what you meant but you previously dictated the sku themselves as in base 10 so it breaks the rules allowing ty to define the skew however you wish now

@serra

@freemo @serra actually if you split it you could do base 5 for the price and base 5 for the other piece as L ng as you wanted

@Absinthe

think like this, lets forget the isogram and convert straight to the decoded numbers... if you have a SKU that representsd $900 (the n the sku of 900, if your rearranging the origibal word thats the same as picking pairs of numbers and swap it.. so all we can do hee are substitute digits..

$900 -> $90 for a 90% discount, to do that its impossible because youd have to swap the double 00 with some other double number. no such number would cause 90%. you could create a 1% discount in this case by swapping 0 and 9 though.

But we are pretty limited

thing is youd have to make the skus base 8 along with the isogram itself, but at that point f we can redefine the skew then its easy.

@serra

@Absinthe

none of this works unless you can define the skews too, if you can do that its much easier to cheat than your making it

@serra

@freemo @serra so system could be base 6 0-5 for the price. Then you have 4 left over 6,7,8,9 or wouldn't hurt my feelings to call them 0,1,2,3 knowing that you could do a second base 4 number as a multiplier. But I like it as a permutation value that could represent a fixed multiplier. Such as 0123 = 100% and 1023 = 110% and 1203 = 115% and 1230 = 130% then 2013 =90% and 2103 = 85% and 2130 = 70%

@freemo @serra So PPuutery for the upholstery code would be 7.00 dollars and no discount if we changed the isogram to upholsetry it would be a 10% premium and if we changed it to upholsreyt then it would be 30% discount.

@Absinthe
I think I understand this discussion, I'm admittedly out of my element though so specific implementation ideas aren't coming to mind (which is exciting for me!). Let me see if I have some basic problem constraints:

a n-letter word W is used for encoding pricesbase(s) are open field, ideally base 10 with a 10-letter word
an anagram of W can be used for decoding to deterministically apply a specific markup or discount

Am I following?

@freemo

@Absinthe
You can only find a agrams that work in edge cases not across an entire inventory though
@serra

@freemo @serra I think we could make it easier by saying the new word would effect a premium or discount across the store. With what I did, one could simply not put the second part on the tag and then the price would be firm and not subject to discounts. One of our local thrift stores does it with colored tags. But I digress. :)

@Absinthe
@freemo
I really dig this problem even if it's mathematically impossible. I'll give it a shot today as a reward for myself for cleaning my home a bit

#toyProgrammingChallenge

@serra

Its not so much that its mathematically impossible, its just any solutions would require you breaking the origina rules on the SKU (representing data in the sku itself in off ways). If you do that then you can cheat in easier ways.

There is probably a way to reword the problem a bit to be a bit more valid i just havent considering the problem to that extent.

@Absinthe

@serra @freemo well in that case I challenge you to do a simple encoder/decoder for it.

I think the base(6) for the price and a permutation of the remaining letters to handle 100% 10%, 15%, 30% discount (and premium if you like)

I see Capital letters as whole numbers and lower case as decimals.

But the test should be, making a bunch of prices. Then changing the isogram and decoding them to their different discount values. Extra points if the whole isogram is a word, and if each of the permuted anagrams are also words (or at least pronounceable)

Show newer

@Absinthe

I dont think doing a base will help you. Yes you get some free letters, but your skews will also be longer so you need more letters in the first place. I suspect these might balance out.

Regardless we are tring to solve across many items not just for a single item. Its easy fr a single item.

@serra

Sign in to participate in the conversation
Qoto Mastodon

QOTO: Question Others to Teach Ourselves
An inclusive, Academic Freedom, instance
All cultures welcome.
Hate speech and harassment strictly forbidden.