I juli var vi på ferie i #Viborg. Her besøgte vi bl.a. Viborg Miniby.
Viborg Miniby er et forsøg på at vise byen, som den så ud i 1850. Den er i forholdet 1:10, og den bliver bygget med rigtige små mursten osv. Men først skulle vi finde stedet. Vi er ved at være tæt på.
Værkstedet er åbent, så man kan se processen.
Jeg prøvede på at få overblik over byen på forhånd, og har også arbejdet på sagen senere. Jeg kan ikke få heeelt styr på det, men næsten. Og det er jo nogle gange også godt nok. Lad os starte med, hvordan en for sagen vigtig del af Viborg ser ud i dag. (Fejl kan forekomme.)
Minibyen er rigtig meget baseret på Sct. Mogens Gade, den del der i dag hedder nr. 1 til 54. Minibyen er ikke helt magen til billedet ovenfor, som jeg selv har strikket sammen. Dels er kortet ovenfor baseret på forholdene i dag, 2025, dels mangler der huse i minibyen (bl.a. domkirken, som den så ud dengang), dels tager minibyen også lidt fra sidegaderne med. Men sådan i det store og hele, ikk?
Og lad os så kigge på nogle huse! Når jeg kalder et af dem Skovgaard Museet, så er der tale om det nuværende navn; i sin tid var det et rådhus.
I juli var vi på ferie i #Viborg. Her besøgte vi bl.a. Borgvold.
Borgvold, der dateres til 1313, er resterne fra en borg + vold, fantastiske 11 m høj. Den måtte vi jo bestige. Bl.a. fordi vi ved andre lejligheder har fundet og besteget resterne af volde. Når man sidder på toppen, så kan man se det karakteristiske dip, altså at det rundt om toppen går nedad. Også selvom det hele er dækket af græs og svært at fotografere. På forhånd satte vi os ind i tingene via den her rigtig gode beskrivelse, der har et kort over stedet og teksten fra stenen. Bemærk i øvrigt, at “paa” (på) naturligvis staves med stum snegl.
Efter at have set domkirken, der ivrigt (?) prøver at virke gammel, men ikke helt lykkes med det, var det sjovt at komme over i en kirke, der faktisk er gammel og er nænsomt restaureret.
En interessant ting ved kirken er de såkaldte emblemmalerier. De er ikke enestående, men de er sjældne nok til, at jeg blev optaget af dem. Der er også en bog om dem. Og for sådan en som mig, der har brug for et konkret eksempel for at forstå teknikken: Emblem of the Month.
This week the #puzzle is: Can You Box the Letters? #permutations
In the game of Letter Boxed from The New York Times, you must connect letters together around a square to spell out words. However, from any given letter, the next letter cannot be on the same side of the square.
Consider the following diagram, which consists of eight points (labeled A through H), two on each side of the square. A valid “letter boxed” sequence starts at any of the eight points, and proceeds through all of the other points exactly once. However, adjacent points in the sequence can never be on the same side of the square. The first and last points in the sequence can be on the same side, but do not have to be.
As an illustration, AFBCHEDG is a valid sequence of points. However, AFBCHGED is not a valid sequence, since H and G are adjacent in the sequence and on the same side of the square.
How many distinct valid “letter boxed” sequences are there that include all eight points on the square?
And for extra credit:
Instead of two points on each side of the square (and eight points in total), now there are three points on each side (and twelve points in total), labeled A through L in the diagram below.
How many distinct valid “letter boxed” sequences are there that include all 12 points on the square?
There are 4 edges, each with 2 letters. Let’s call these edges group 1-4. (Not necessarily meaning group 1 is {A, B} etc.)
The task is to keep choosing letters, until 0 are left. Also, never choose from the same group twice.
Method 1:
Choose the 1st letter. There are 8 to choose from. Let’s call this a letter from group 1.
Choose the 2nd letter. There are 6 to choose from. Let’s call this a letter from group 2.
Choose the 3rd letter. This could be the remaining letter from group 1, or one of the 4 remaining from unchosen groups. Let’s call the latter a letter from group 3.
It was from group 1. Choose the 4th letter. This could the remaining letter from group 2, or one of the 4 remaining from unchosen groups.
It was from group 2. Choose the 5th letter. There are 4 to choose from. Let’s call this a letter from group 3.
Choose the 6th letter. There are 2 to choose from. Let’s call this a letter from group 4.
Choose the 7h letter. It is the remaining letter from group 3.
Choose the 8th letter. It is the remaining letter from group 4.
All this have 8 * 6 * 1 * 1 * 4 * 2 * 1 * 1 = 384 different permutations.
Of course the full method also investigates all the choices I skipped above. I try to capture all the possibilities in a spreadsheet. Result: 13824.
Method 2:
Write a program to go through (almost) all options. Same result.
And for extra credit:
Method 2, just with 3 elements in each group. Result: 53529984.
This week the #puzzle is: Fine, Maybe Tiling Problems Can Be Fun… #tiling
Question row A:
You have an infinite square grid. Each cell in this grid is either red or blue.
Can you create a pattern in which every red cell has exactly:
zero red neighbors, one red neighbor, two red neighbors, ⋮ eight red neighbors?
Neighbors include any cell that is directly adjacent or corner-adjacent. To avoid admitting degenerate solutions, your pattern must have at least some fraction 0<r≤1 of the total board composed of red cells.
Question row B:
Now we will consider patterns in which every red and every blue cell has exactly the same number—nr and nb, respectively—of same colored neighbors. For example, the image above is not a valid pattern since some of the blue cells have 4 blue neighbors while others have 6.
For which pairs (nr, nb) can we construct valid patterns?
If (nr, nb) = (a,b) is possible, (nr, nb) = (b,a) is also possible, by reversing the colors.
If a red has 0 red neighbors, it will have 8 blue neighbors.
A blue edge neighbor has at least 4 blue neighbors.
A blue corner neighbor has at least 2 blue neighbors.
So the cases of (nr, nb) = (0, 0), (0,1), (0,2), (0,3) aren’t possible.
Similarly for (nr, nb) = (1,0), (2,0), (3,0).
If a red has 1 red neighbor, it will have 7 blue neighbors.
A blue edge neighbor has at least 3 blue neighbors.
A blue corner neighbor has at least 1 blue neighbor.
So the cases of (nr, nb) = (1,1), (1,2) aren’t possible.
Similarly for (nr, nb) = (2,1).
If a red has 2 red neighbors, it will have 6 blue neighbors.
A blue edge neighbor has at least 2 blue neighbors.
A blue corner neighbor might have 0 blue neighbors.
This does not exclude any new cases.
Solution with 8 red and x blue can’t work, because there’s no room for the blue. Similarly for 8 blue and x red.
If a red has 7 red neighbors, it will have 1 blue neighbor.
If this is an edge neighbor, it has at most 3 blue neighbors.
If it is a corner neighbor, it has at most 5 blue neighbors.
So the cases of (nr, nb) = (7, 6), (7,7) aren’t possible.
Similarly for (nr, nb) = (6,7).
If a red has 6 red neighbors, it will have 2 blue neighbors.
A blue edge neighbor has at most 4 blue neighbors.
A blue corner neighbor has at most 6 blue neighbors.
This does not exclude any new cases.
It is however possible to keep building. All the reds have 6 red neighbors. Going through these cases gives a blue cell with at most 5 blue neighbors. (6,6) isn’t possible.
Method: In some cases I think of a regular pattern, create it and count.
Further I built a program to create and test patterns. This is how I found the (2, 6) solution.
This week the #puzzle is: How Low (or High) Can You Go? #probabilities #volume #area #random
You’re playing a game of “high-low,” which proceeds as follows:
First, you are presented with a random number, x1, which is between 0 and 1.
A new number, x2, is about to be randomly selected between 0 and 1, independent of the first number. But before it’s selected, you must guess how x2 will compare to x1. If you think x2 will be greater than x1 you guess “high.” If you think x2 will be less than x1, you guess “low.” If you guess correctly, you earn a point and advance to the next round. Otherwise, the game is over.
If you correctly guessed how x2 compared to x1 then another random number, x3, will be selected between 0 and 1. This time, you must compare x3 to x2, guessing whether it will be “high” or “low.” If you guess correctly, you earn a point and advance to the next round. Otherwise, the game is over.
You continue playing as many rounds as you can, as long as you keep guessing correctly.
You quickly realize that the best strategy is to guess “high” whenever the previous number is less than 0.5, and “low” whenever the previous number is greater than 0.5.
With this strategy, what is the probability you will earn at least two points? That is, what are your chances of correctly comparing x2 to x1and then also correctly comparing x3 to x2?
And for extra credit:
Your friend is playing an epic game of “high-low” and has made it incredibly far, having racked up a huge number of points.
Given this information, and only this information, what is the probability that your friend wins the next round of the game?
As there is no history in probabilities, I simply need to look at 2 guesses in a row. So this time we’re looking at the good part of the area of a unit square. The first guess can be anything. See Desmos for calculation of the area: 0.75.
Just to make absolutely sure, I wrote a small program to simulate winning a lot of times in a row. Behaves as expected.
Alternate answer: My friend is cheating. The probability is 100%.
I decided to take another look at the data. Wrote a better program. Among other things, it produced data for a spreadsheet. What do you know! The data skews somewhat. There’s a good chance, the latest number drawn was in the middle, was close to 0.5. This has an effect on whether my next guess will be correct. My program says:
Probability for win at length 10: 0.72113 Probability for win at length 20: 0.72152 Probability for win at length 30: 0.71378
So instead of 0.75 (or 1), it appears the probability is 0.71 or 0.72.
This week the #puzzle is: How Far Can You Run Before Sundown? #maximum #strategy #recursion
You’re participating in a trail run that ends at sundown at 7 p.m. There are four loops: 1 mile, 3 miles, 3.5 miles, and 4.5 miles. After completing any given loop, you are randomly assigned another loop to run—this next loop could be the same as the previous one you just ran, or it could be one of the other three. Being assigned your next loop doesn’t take a meaningful amount of time; assume all your time is spent running.
Your “score” in the race is the total distance you run among all completed loops you are assigned. If you’re still out on a loop at 7 p.m., any completed distance on that loop does not count toward your score!
It is now 5:55 p.m. and you have just completed a loop. So far, you’ve been running 10-minute miles the whole way. You’ll maintain that pace until 7 p.m.
On average, what score can you expect to earn between 5:55 p.m. and 7 p.m.?
And for extra credit:
Now let’s add one more wrinkle. At some point during the race, if you’re unhappy with the loop you’ve just been randomly assigned, you’re granted a “mulligan,” allowing you to get another random assignment. (Note that there’s a 25 percent chance you’ll be assigned the same loop again.) You don’t have to use your mulligan, but you can’t use it more than once.
As before, the time is 5:55 p.m. You have just completed a loop, and you haven’t used your mulligan yet.
With an optimal strategy (i.e., using the mulligan at the right moment, if at all), on average, what score can you expect to earn between 5:55 p.m. and 7 p.m.?
So. I didn’t get the extra credit last week. No shame in that. I had all the points from the previous puzzles of Q3. We were a group of 10 persons able to say that. I am now in the group of 6 persons, who dropped out from that max points group, now counting 4 members.
Still. It made me wonder. What was required to solve the extra credit? How does one find a strategy?
Make a list of all the strategies you can think of. Remember to include the optimal one. 😉
Test every item on the list.
Declare a winner.
This requires good brainstorming skills. Also in this case I couldn’t leap this hurdle:
A strategy is a list of “given voucher situation A, choose bet option B”.
As it turned out, the strategy also needed to include “is this the 1st bet, yes or no”.
Because I actually had the pieces. I had the $55 strategy for the 1st bet. And I had the $35 strategy for having all vouchers. I could just have combined them to get the correct extra credit result.
Ah well.
Highlight to reveal (possibly incorrect) solution:
A mulligan can be invoked once during the run and a new random loop be assigned.
This leads to an optimal strategy.
Question: What will the expected score be for the remainder of the run, using this strategy?
My solution. The strategy will look like this:
Given that there’s A minutes left of the run, and a loop requiring B minutes got assigned, and that the mulligan hasn’t been used, should it be used now, yes or no?
This can be written in a table with all the combinations of A and B.
Some of the combinations are very easy. If running this loop means there will be 0 minutes left, keep it, we hit the max possible. If running this loop means the loop won’t be finished before the deadline and a better option exists, use the mulligan.
In general: If the average score over all 4 loop options without a mulligan is C, and keeping the assigned loop on average adds D to the score, and D < C, use the mulligan.
My table:
\ loop time
time left \
45
35
30
10
5
keep
keep
keep
keep
10
mull
mull
mull
keep
15
mull
mull
mull
keep
20
mull
mull
mull
keep
25
mull
mull
mull
keep
30
mull
mull
keep
keep
35
mull
keep
keep
mull
45
keep
keep
mull
mull
55
keep
mull
mull
keep
65
keep
keep
keep
keep
Let me go through an example, related to the image. (Might contain errors as I later changed the algorithm a little.)
When there’s 10 minutes left (yellow), from left to right the 4 options (in minutes 45, 35, 30, 10, green) add nothing (-0), nothing, nothing and 10 (*) to the score (calculated in minutes). Furthermore, the first 3 options left no time. The 4th option uses all the time left. Therefore the first 3 options are good for a mulligan, while the 4th is a keeper.
Mulligan = happy smiley, yes, please use the mulligan.
Keeper = green flag, you have reached a good option.
(*) From the yellow to the right most option below, there’s a difference from 10 to 0. This is because the route was through a 10 minute loop. Reaching the green flag, there’s no time left and nothing further added to the score.
The 4 possible options from the yellow state adds 0, 0, 0 and 10 to the score. This is 10/4 = 2.5 in average.
Another way to say the green flag is a keeper, is because 2.5 < 10.
When there’s 20 minutes left (orange), similar construction.
The 4 possible options from the orange state adds 0, 0, 0 and 10 + 2.5 to the score. Therefore the 3 cyan options are good for a mulligan, while the yellow option is a keeper (purple).
When there’s 65 minutes left, 1 of the options (orange) will add 45 + 3.13 to the score. As this is less than the average for all 4 options, 48.66, this option is good for a mulligan (red).
I change my program. First I calculate all averages without the mulligan. Then I calculate new averages for the situation with a mulligan. Every time I use a mulligan I drop down to the mulligan free version of the averages. I also fill in a table showing whether I use a mulligan in a given situation.
The result appears to be 5.352 miles.
Just for fun I also implemented a monte carlo program, covering all situations with 0-10 mulligans, assuming the mulligan table is the same all the way up.
Expected score with 0 mulligans: 48.677 Expected score with 1 mulligans: 53.514 Expected score with 2 mulligans: 56.563 Expected score with 3 mulligans: 58.585 Expected score with 4 mulligans: 59.967 Expected score with 5 mulligans: 60.997 Expected score with 6 mulligans: 61.748 Expected score with 7 mulligans: 62.318 Expected score with 8 mulligans: 62.773 Expected score with 9 mulligans: 63.123 Expected score with 10 mulligans: 63.391
Jeg har læst “The Moral Bullet”, #BruceSterling og #JohnKessel. Quick fix. Spoilers.
Nogen har opfundet en foryngelseskur. Eftersom alle jo gerne vil være yngre, så bliver den en del af samfundet, og alle kan få de indsprøjtninger, de har brug for. Effektivt er det udødelighed. Man startede med de gamle. Det her er simpelthen bare en god ting.
Men uvægerligt er der nogen, der begynder at mistænke, at doserne ikke er jævnt fordelt. Så verden bryder sammen, mens bander kæmper mod hinanden. (Måske er det en faktor her, at en verden af unge mennesker er let at ophidse.) Dødeligheden stiger voldsomt. Ups. Det første quick fix i den her historie virkede altså ikke i første forsøg.
Hele det her rod startede i USA. Ovre i Europa har de gjort en ny opdagelse, nemlig at man også kan indsprøjte moral i folk. Europæerne er derfor ved at få styr på sagerne igen. De mest skydeglade får sådan en dosis, og så bliver der ro. Nu er planen 1) at finde den oprindelige opfinder, der jo er et geni, 2) fylde ham med moral (folk med moral opfinder ikke bare evig ungdom, og lader verden forfalde som resultat), 3) importere ham til Europa, 4) få opfundet en kombination af ungdom og moral, 5) udbrede denne version af indsprøjtningerne.
Men amerikanerne, der jo altså stadig er ret paranoide, hopper absolut ikke bare med på den plan.
Kan planen gennemføres, når geniet ikke giver samtykke? Er samtykke nødvendigt? Er det en god plan? En moralsk plan? Er det faktisk moral på sprøjte, man har opfundet? Det er en historie, der tager fat i de her spørgsmål, men ikke besvarer dem.
Anmeldelse af Warp Your Own Way, af #RyanNorth. #GraphicNovel. 2024. Hugo-vinder. #StarTrek
Skitse: Ombord på Cerritos vågner Mariner desværre. Hendes sambo skal tidligt på arbejde, mens hun selv kan sove et par timer til. Skidt pyt. Man falder jo bare i søvn igen. Men der bliver ved med at være forstyrrelser, så til sidst opgiver hun, står op, laver noget kaffe og går ud for selv at forstyrre nogle andre.
Er det science fiction? Ja! 🖖🏻🖖🏻🖖🏻
Temaer: Lynhurtigt kommer vi i gang med du-er-helten-delen. Hvilken kaffe skal det være? Og hvem skal forstyrres? Fordi jeg har prøvet det her før, så skrev jeg mine valg ned, så en “blind vej” bare kunne blive rullet tilbage. Og det var der behov for. Rigtig mange af vejene er nemlig blinde. Og der dukker også elementer op, der vist ikke plejer at høre til i den her genre. Et par gange måtte jeg ændre min forståelse af tingene. En mindre doven læser lavede et diagram over bogen og forklarede et par ting, jeg ikke havde fanget.
Det her føles virkelig som en integreret del af Star Trek. Visuelt ligner det 100 %, og det er flot. De forskellige personer opfører sig som de plejer. Plottet er også indenfor skiven, og moralen til sidst er vist en gentagelse fra et af afsnittene, der var det vist bare Rutherford, der viste os, hvordan man bør ordne tingene.
Plottet har en skurk, der på sin egen måde bryder en af “lovene”, og derfor taber. Jeg vil ikke afsløre hvilken lov. Men det kan sammenlignes med, at hvis de var kommet til en paradisisk planet, så ville loven sige, at Tingene Er I Virkeligheden Som Helvede, og at vores helte derfor skulle vælte tyrannen eller ødelægge computeren eller sådan noget. Den slags lov.
Oprindeligt var det her en papirbog, men den virker også fint som pdf på en tablet. Bogstaverne er store nok. Dobbeltsider kan man se ved at blade lidt frem og tilbage. Man kan ikke bare klikke på en boks og hoppe til den side, hvor historien fortsætter (i hvert fald ikke med lige min pdf-læser), men der er en fin indholdsfortegnelse, så skiftet trods alt kan ske hurtigt. Hele bogen tog mig 2-3 timer.
Er det godt? Ja! 🖖🏻🖖🏻🖖🏻 Det er en af de bedste oplevelser, jeg har haft med franchiset i papirform. Og medmindre Paramount får fundet ud af at lave episoder, der kopierer Black Mirrors interaktive film, så kunne det her kun laves som papir- eller computerspil. Og det er charmerende, at de valgte papir. 👽👽👽
This week the #puzzle is: How Much Free Money Can You Win? #probabilities #bets #minimum #maximum
A casino offers you $55 worth of “free play vouchers.” You specifically receive three $10 vouchers and one $25 voucher.
You can play any or all vouchers on either side of an even-money game (think red vs. black in roulette, without those pesky green pockets) as many times as you want (or can). You keep the vouchers wagered on any winning bet and get a corresponding cash amount equal to the vouchers for the win. But you lose the vouchers wagered on any losing bet, with no cash award. Vouchers cannot be split into smaller amounts, and you can only wager vouchers (not cash).
What is the guaranteed minimum amount of money you can surely win, no matter how bad your luck? And what betting strategy always gets you at least that amount?
Hint: You can play vouchers on both sides of the even money game at the same time!
And for extra credit:
You have the same $55 worth of vouchers from the casino in the same denominations. But this time, you’re not interested in guaranteed winnings. Instead, you set your betting strategy so that you will have at least a 50 percent chance of winning W dollars or more. As before, you cannot split vouchers and cannot wager cash.
What is the maximum possible value of W? In other words, what is the greatest amount of money you can have at least a 50 percent chance of winning from the outset, with an appropriate strategy? And what is that betting strategy?
This time I chose to write out all the possibilities. Big PDF file resulted. The important bit is the part shown in the image. This shows this strategy:
I first bet 2 x 10 against 25.
Either I win $20 and have 3 x 10 left. Bet 10 against 10 twice, resulting in a further $20. $40 in all.
Or I win $25 and have 1 x 10 and 1 x 25 left. Bet them against each other and win at least $10. $35 in all.
I adjust my PDF to look at probabilities instead of minimum. This gives me the strategy:
1 first bet 10 against 25.
Either I win $10 and have 3 x 10 left. Now bet 2 x 10 against 10.
Either I win $20 and have 2 x 10 left. Now bet 10 against 10, win $10, have 10 left, bet that 10 alone, 50% of getting $10. That is in total 50% for $40, 50% for $50.
Or I win $10 and have 10 left. Bet that 10 alone, 50% of getting $10. That is in total 50% for $20, 50% for $30.
Combined this is 25% for $20, 25% for $30, 25% for $40, 25% for $50.
Or I win $25 and have 2 x 10 and 25 left. Now bet 2 x 10 against 25.
Either I win $20 and have 2 x 10 left. Now bet 10 against 10, win $10, have 10 left, bet that 10 alone, 50% of getting $10. That is in total 50% for $55, 50% for $65.
Or I win $25 and have 25 left. Bet that 25 alone, 50% of getting $25. That is in total 50% for $50, 50% for $75.
Combined this is 25% for $50, 25% for $55, 25% for $65, 25% for $75.
Combined this is 12.5% for each of $20, $30, $40, $50, $50, $55, $65, $75.
The median here is $50. That is therefore my 50% chance result.
I am little surprised at this result. I doodled with adding more bets (if I win my final bet above, I can bet again), but that didn’t change the result. It is close to a theoretical $55, the value of all the vouchers.
Ahem.
There’s a strategy where I begin by betting everything on red. Either I lose, 50% chance, or I win $55 and keep all my vouchers, 50% chance. If I win, I can bet again. This way I get at least $55 with 50% chance. A more complicated strategy has to beat that.
After many thoughts I tried writing a program. This approach uses a little monte carlo. It also uses going through all the options for strategies. A typical output looks like this:
The numbers (7c, 6b etc.) refer to the program and to the PDF. Translated this strategy is:
Bet 10 on red and 3 other vouchers on the rest. (7c)
Either win on red, get $10 and keep a 10 voucher. By all means keep playing (1), but it probably won’t get much better. At least $10 in all.
Or win on black. Get $45 and keep vouchers for 10, 10 and 25. Bet 2 x 10 on red and 25 on black. (6b)
Either win on red and get $20 more and keep 2 x 10 vouchers. Bet 10 on red and 10 on black. (3b) Get $10 more and keep a 10 voucher. Feel free to keep playing (1). At least $75 in all.
Or win on black and get $25 more and keep the 25 voucher. Feel free to keep playing (2). At least $70 in all.
Winning on the 1st black guarantees winning at least $70, with 50% chance. And that’s what we were looking for! W = 70!
It’s a rather special feeling, writing a program just to make sure everything is right, and then finding a better solution.
Just for fun I converted the program back to solve the fiddler. And found another solution. And an error in my math in the prodigious, pretty PDF. Hm. This strategy also works:
Play 10 against 10 (3b). Lose 1 x 10, gain $10. Play 2 x 10 against 25 (6b).
Either lose 25 and gain $20. Play 10 against 10 (3b). Lose 1 x 10, gain $10. $40 in total.