What is the newest installment of 'Random Thoughts' on Physics Forums?

  • Thread starter Thread starter Evo
  • Start date Start date
  • Tags Tags
    Random Thoughts
AI Thread Summary
The discussion revolves around frustrations with current documentary programming, particularly criticizing the History Channel's focus on sensational topics like time travel conspiracies instead of real historical content. Participants express disappointment over National Geographic's sale to Fox, fearing a decline in quality programming. The conversation shifts to lighter topics, including humorous anecdotes about everyday life, such as a malfunctioning kitchen fan discovered to be blocked by installation instructions. There are also discussions about the challenges of understanding various dialects in Belgium, the complexities of language, and personal experiences with weather and housing in California. Members share their thoughts on food, including a peculiar dish of zucchini pancakes served with strawberry yogurt, and delve into mathematical concepts related to sandwich cutting and the properties of numbers. The thread captures a blend of serious commentary and lighthearted banter, reflecting a diverse range of interests and perspectives among participants.
  • #7,151
collinsmark said:
A couple of years ago I wrote a sudoku solver program for kicks and giggles (it was written in C#). I'm pretty proud of it (given that I wrote it just for fun). I'm not very speedy at sudoku puzzles myself, but my program is. It starts by using the same techniques that humans would use to solve sudoku puzzles. Then -- and only if it is unable to make progress -- does it fall back onto a brute-force method that involves recursion.

It can solve just about any valid puzzle I can throw at it, such as those you would find in a newspaper, in a matter of milliseconds (Edit: it also checks if the puzzle is valid and if it has one and only one unique solution). It takes just over half a second to solve Arto Inkala's puzzle, perhaps the hardest sudoku puzzle ever made.

Code:
int[] testArray04 = new int[]  // Hardest ever, perhaps, 21 clues Also called Arto Inkala's puzzle
            {
                8, 0, 0, 0, 0, 0, 0, 0, 0,
                0, 0, 3, 6, 0, 0, 0, 0, 0,
                0, 7, 0, 0, 9, 0, 2, 0, 0,
                0, 5, 0, 0, 0, 7, 0, 0, 0,
                0, 0, 0, 0, 4, 5, 7, 0, 0,
                0, 0, 0, 1, 0, 0, 0, 3, 0,
                0, 0, 1, 0, 0, 0, 0, 6, 8,
                0, 0, 8, 5, 0, 0, 0, 1, 0,
                0, 9, 0, 0, 0, 0, 4, 0, 0
            };

I've been neglecting it because I still need to write a user interface for it, and user interfaces are boring.
Did you feed it the needed " Boundary Conditions" for a problem to be well-defined in the sense of having a unique solution or does it implicitly know them ( or does it stop with a message if it cannot)?
 
Physics news on Phys.org
  • #7,152
I remember a post here a while back about the properties of sudokus when viewed as ( square) matrices. Interesting But don't remember much detail from it.
 
  • #7,153
etotheipi said:
"Maybe she's born with it, maybe it's curved spacetime"?
 
  • Like
Likes hmmm27 and etotheipi
  • #7,154
WWGD said:
collinsmark said:
A couple of years ago I wrote a sudoku solver program for kicks and giggles (it was written in C#). I'm pretty proud of it (given that I wrote it just for fun). I'm not very speedy at sudoku puzzles myself, but my program is. It starts by using the same techniques that humans would use to solve sudoku puzzles. Then -- and only if it is unable to make progress -- does it fall back onto a brute-force method that involves recursion.

Did you feed it the needed " Boundary Conditions" for a problem to be well-defined in the sense of having a unique solution or does it implicitly know them ( or does it stop with a message if it cannot)?

It figures it out if the solution is unique or not on the fly. I'll walk through the logic here.

Firstly, note that If you can solve a sudoku puzzle without making any "guesses," solving the puzzle with logic alone, then it follows that the resulting solution is unique. That's because each individual cell was found such that it must contain one and only one specific number; any other number would cause an inconsistency. And if the whole sudoku table is solved in this way, then the solution must be unique, because any deviation whatsoever would have caused an inconsistency somewhere along the way.

That said, really, really hard sudoku puzzles sometimes require guessing. That's where the program's recursion comes into play. If the solver finds itself unable to make progress with logic alone, it will start guessing. It does this by picking one of the unknown cells, filling it in with a guess, and feeding that into a new instance of the solver, but this time with the cell filled in with the guess (hence the recursion).

But it doesn't end with a single guess for the cell in question. It guesses all possibilities. For example, if by logic alone, the program narrows down a cell to be one of three possibilities, it will check [i.e., "guess"] all three possibilities. If more than one of those possibilities results in a valid solution for the puzzle, then the solution is not unique.

The recursion is quite useful here. Any child instance of the solver might discover that the puzzle has a non-unique solution, not the just the guess for that initial cell. A non-unique-solution flag along with any unique solutions are passed back to the calling method, even if that method happens to be another instance of the solver.

If at the end, after checking all guesses and following all logical possibilities, there is one and only one valid solution, that solution is deemed unique.

(On a side note, solving a sudoku puzzle is one of the few examples in my experience where recursion is not only convenient, but quite possibly essential.)
 
  • Like
Likes Klystron and WWGD
  • #7,155
collinsmark said:
It figures it out if the solution is unique or not on the fly. I'll walk through the logic here.

Firstly, note that If you can solve a sudoku puzzle without making any "guesses," solving the puzzle with logic alone, then it follows that the resulting solution is unique. That's because each individual cell was found such that it must contain one and only one specific number; any other number would cause an inconsistency. And if the whole sudoku table is solved in this way, then the solution must be unique, because any deviation whatsoever would have caused an inconsistency somewhere along the way.

That said, really, really hard sudoku puzzles sometimes require guessing. That's where the program's recursion comes into play. If the solver finds itself unable to make progress with logic alone, it will start guessing. It does this by picking one of the unknown cells, filling it in with a guess, and feeding that into a new instance of the solver, but this time with the cell filled in with the guess (hence the recursion).

But it doesn't end with a single guess for the cell in question. It guesses all possibilities. For example, if by logic alone, the program narrows down a cell to be one of three possibilities, it will check [i.e., "guess"] all three possibilities. If more than one of those possibilities results in a valid solution for the puzzle, then the solution is not unique.

The recursion is quite useful here. Any child instance of the solver might discover that the puzzle has a non-unique solution, not the just the guess for that initial cell. A non-unique-solution flag along with any unique solutions are passed back to the calling method, even if that method happens to be another instance of the solver.

If at the end, after checking all guesses and following all logical possibilities, there is one and only one valid solution, that solution is deemed unique.

(On a side note, solving a sudoku puzzle is one of the few examples in my experience where recursion is not only convenient, but quite possibly essential.)
Yes, I always thought it was an interesting question wether recursion is necessary. It seems I can solve a certain class of problems. I tried small scale to to use unsupervised learning to see if I can classify those problems that I have trouble with, but just a small project. I thought of recursion more in the sense that a Sudoku with x "unsolved" 1x1 squares can be dealt with in terms of one with x-1or fewer solved squares.
 
  • Like
Likes collinsmark
  • #7,156
Still trying to figure out why my PC becomes dusty as if I had left it open overnight in the #$% Sahara, while I leave it inside a case when I am not using it.
 
  • #7,157
As an engineer, I still need somebody to translate standards to useful information.
Is there such a sub-class for engineering that 'lawyer-engineer', or something?
 
  • #7,158
etotheipi said:
Actually, does anyone know if there are more exotic shapes that black holes can take other than just the boring spherically symmetric one? Like frisbee-shaped or boomerang-shaped would be neat, but maybe those shapes would arise as some modes of a certain oscillation. How do you find the possible vibrational modes of a black hole?... 🤔
https://arxiv.org/abs/hep-th/0701035
 
  • Wow
Likes etotheipi
  • #7,159
I fail to understand the use of bias in linear regression as the intersect with the x-axis. It doesn't seem to match the expression E(p)-p; E(p) is the expected value of p.
 
  • #7,160
Rive said:
As an engineer, I still need somebody to translate standards to useful information.
Is there such a sub-class for engineering that 'lawyer-engineer', or something?
Maybe try our engineering forums here? If they don't know themselves they may be better able to refer you to someone who does.
 
  • #7,161
Sorry to my Libertarian ( " Big L") friends . Visit any unmoderated site and read the tons of posts that quickly degenerate into " But your a looser to".
 
  • #7,162
Our IT department just raised a new recommendation for passwords due security concerns: needs to be awful long, with numbers and capitals.
This became the first password for I had to spend a sticky note.

Congratulations, IT security.
 
  • Haha
Likes Klystron and Keith_McClary
  • #7,163
No need for a sticky note.

password_strength.png
 
  • Like
Likes BWV and BillTre
  • #7,164
Borg said:
No need for a sticky note.
We have to change our passwords every 90 day, so after a couple of years, your system is also difficult to remember.
 
  • #7,165
I have to keep track of dozens of 14+ length passwords for my work that require numbers, letters and special characters and also change frequently. It's not a lot of fun sometimes but it beats the hell out of getting hacked because of poor security.
 
  • #7,166
But somehow ATM cards only require a 4-digit code; no special characters , not even letters, just 4 digits, so a chance of 1 in 10000.
 
  • #7,167
That's a form of two factor authentication because you also have to have the ATM card. :wink:
 
  • #7,168
Borg said:
That's a form of two factor authentication because you also have to have the ATM card. :wink:
Can't you do online transactions using the ATM card alone. Besides, what if your wallet is lost or stolen?
 
  • #7,169
What exactly do you insert your ATM card into when you're online?

The ATM card is one half and the pin is the second half of the authentication process. This is similar to when a website doesn't recognize your computer (i.e. no previous cookie) and wants to email or text a short code to a known email or phone tied to your account. In this case, the original username and password is similar to the ATM card that's used at the bank.
https://en.wikipedia.org/wiki/Security_token#Loss_and_theft
 
  • #7,170
I understand. I meant if you lose your ( physical) ATM card. I assume you're temporarily blocked from the system after 3-4 failed password guesses. But maybe you can retry a few days later? Maybe 1 chance in 1500 is still a good bet for ATM card holders. I assume tougher privacy would put a dent in the economy if more people were kept from accessing their money by being locked out of their ATM.

And, related, is there any value to RF ( Radio Frequency) protectors for credit cards?
 
  • #7,171
Borg said:
I have to keep track of dozens of 14+ length passwords for my work that require numbers, letters and special characters and also change frequently. It's not a lot of fun sometimes but it beats the hell out of getting hacked because of poor security.
I use LastPass for that very reason
 
  • #7,172
Out work IT department recently switched us to 24 characters. But it is any character, no need for the numbers, caps, bangs etc. I guess as long as you don't use the well known ones (like, correct horse battery staple) you will be OK.

And they say, we can keep the same password for 5 years.
 
  • Haha
Likes atyy
  • #7,173
24 you said? This is a trap! Don't fall for it!

You can keep it for five years
123 456 7890 12 345 6789 01234
 
  • Like
Likes gmax137
  • #7,174
fresh_42 said:
24 you said? This is a trap! Don't fall for it!

You can keep it for five years
123 456 7890 12 345 6789 01234
Do the spaces count?
 
  • #7,175
How about the idea of different versions of the same arrangements? Meaning a general formula that generates different values, one for each password?
 
  • #7,176
If ever you need a 1.3 x 10^6 character password generator, here is your Source
 
  • Like
Likes WWGD
  • #7,177
 
  • #7,178
BWV said:
If ever you need a 1.3 x 10^6 character password generator, here is your Source.
Where did you get my last C compiler call under UNIX from?
 
  • Like
Likes BWV
  • #7,179
fresh_42 said:
Where did you get my last C compiler call under UNIX from?
It's a list of birthdays in Poland.
 
  • #7,180
I finally figured out how to stop Windows 10 from updating to feature build 2004 whose "security enhancements" include things like lots of in-your-face options to save your data to Microsoft's OneDrive and new abilities to blog from your Outlook email. Since when does an OS security enhancement have to go into desktop applications, completely redesign them (updated Office 2019 to Office 365), change all of the layouts and add new security holes? :headbang:

Here's the link for anyone who's interested in stopping the 2004 feature build from installing:
https://www.windowslatest.com/2020/06/29/windows-10-registry-trick-to-block-feature-updates/
 
  • Like
Likes WWGD
  • #7,181
Unless there is something very unusual with my phone, neither charging nor energy use are linear. Don't know why I assumed they would be.
 
  • #7,182
Not even the power supply is linear.
 
  • #7,183
I meant charging time or battery time, but maybe charging time is more accurate since I am not using the phone for any else. Battery time otoh may depend on what I use the phone for.
 
  • #7,184
fresh_42 said:
Not even the power supply is linear.
You mean power output, e.g., KWatts, I guess per unit of time?
 
  • #7,185
WWGD said:
You mean power output, e.g., KWatts, I guess per unit of time?
I remember that we built a clock at school in physics. We used the power supply as a pulse generator. I know ever since that what comes out of the wall is more a random number generator than anything stable.
 
  • Like
Likes Klystron
  • #7,186
Borg said:
I finally figured out how to stop Windows 10 from updating to feature build 2004 whose "security enhancements" include things like lots of in-your-face options to save your data to Microsoft's OneDrive and new abilities to blog from your Outlook email. Since when does an OS security enhancement have to go into desktop applications, completely redesign them (updated Office 2019 to Office 365), change all of the layouts and add new security holes? :headbang:

Here's the link for anyone who's interested in stopping the 2004 feature build from installing:
https://www.windowslatest.com/2020/06/29/windows-10-registry-trick-to-block-feature-updates/
I'm still running windows 7 and have been using this to keep windows 10 from doing it's thing:
GWX Control Panel
 
  • Like
Likes Keith_McClary
  • #7,187
dlgoff said:
I'm still running windows 7 and have been using this to keep windows 10 from doing it's thing:
GWX Control Panel
How do you do without the security patches/updates?
 
  • #7,188
If he had said " an outlier" , instead of " a outlier", he would have avoided the a-a " vowel movement".
 
  • #7,189
dlgoff said:
I'm still running windows 7 and have been using this to keep windows 10 from doing it's thing
I upgraded a W7 laptop to W10 and my old scanner still worked fine. Then had to get a new W10 laptop. According to everything I could find, there is no way to get that scanner to work with W10.
 
  • #7,190
WWGD said:
How do you do without the security patches/updates?
I use windows update every once in a while.
 
  • #7,191
New trick for sandwiches. Leave them out for 30 minutes after making them so they reach room temperature.
 
  • #7,192
dlgoff said:
I use windows update every once in a while.
Does that update security patches?
 
  • #7,193
WWGD said:
Does that update security patches?
yep
 
  • Like
Likes WWGD
  • #7,194
dlgoff said:
yep
Still, I assume win 7 will not be supported indefinitely. What do you do then?
 
  • Sad
Likes dlgoff
  • #7,195
WWGD said:
Still, I assume win 7 will not be supported indefinitely. What do you do then?
Sometimes, switching backward works surprisingly well.
Nobody writes new viruses for win98 for ages already.
( :wink: )
 
  • Like
Likes WWGD and dlgoff
  • #7,196
WWGD said:
Still, I assume win 7 will not be supported indefinitely. What do you do then?
I'm not even using it now. I'm using Google Chrome.
 
  • Like
Likes WWGD
  • #7,197
dlgoff said:
I'm not even using it now. I'm using Google Chrome.
Sorry, did not mean to hound you, just curious. So you're using chrome as your OS and not just a browser?
 
  • #7,198
No, my mistake. I'm actually using windows 7 as my operating system. Now I feel really dumb. :cry:
 
  • Like
Likes WWGD
  • #7,199
dlgoff said:
No, my mistake. I'm actually using windows 7 as my operating system. Now I feel really dumb. :cry:
Don't worry, you're still pretty far from asking for the latest version of the interwebs. Or heiling a cab and asking : " Quick, take me to the internet!" ;).
 
  • Haha
Likes dlgoff
  • #7,200
I've had decent results with using Google weather (I just search my zip and weather). However, the past two weeks or so have been horrendous.

Constantly says it's going to rain every day and it's never been right except once (been sunny and dry). And it constantly says it's relatively low wind (low single digits to maybe as high as 12 mph). However, it feels more like it's been 15 to even close to 20 mph lately.

Be better Google weather!
 

Similar threads

34
Replies
2K
Views
51K
Replies
3K
Views
155K
Replies
2K
Views
167K
Replies
4K
Views
230K
Replies
3
Views
2K
Replies
8
Views
2K
Back
Top