data structures – If a key in a red-black tree has exactly one child (which isn’t null) then he is always red

I have the following claim:

If a key in a red-black tree has exactly one child (which isn’t null) then he is always red. prove or disprove it.


My attempt:

$Disproof.$

we shall represent a counter-example:

enter image description here

This tree satisfies the conditions of being a red-black tree,

since:

  1. the root is black.
  2. all leaves are black.
  3. there isn’t a red key.
  4. in each path there is the same amount of black keys, in particular, we have three black keys in such paths.

However, we have two keys in level-1, which have one child and he is black.

$qquad qquad qquad qquad qquad qquad qquad qquad qquad qquad qquad qquad qquad qquad blacksquare$


Is this disproof right? because perhaps I missed something, and this counter-example doesn’t represent a counter-example. Thanks!

encryption – Any reason why SHA-3 isn’t yet present in GnuPG?

I was curious about setting SHA-3 as the preferred hashing algorithm for GPG but that looks like it is not yet supported and the documentation states this:

SHA-3: SHA-3 is a completely new hash algorithm that makes a clean
break with the previous SHAs. It is believed to be safe, with no
warnings about its usage. It hasn’t yet been officially introduced
into the OpenPGP standard, and for that reason GnuPG doesn’t support
it. However, SHA-3 will probably be incorporated into the spec, and
GnuPG will support it as soon as it does.

What does this mean: “…and GnuPG will support it as soon as it does”?

Are there any development plans for supporting SHA3 or BLAKE?

auto rotation – Manual screen rotate via terminal isn’t working

So i want fix custom rom issue on my tab(portrait rotation instead of landscape on startup), but when i write command content insert --uri content://settings/system --bind name:s:user_rotation --bind value:i:1, screen doesn’t rotate(on my phone this command is working). Auto rotation is working. Any way to rotate screen via terminal?
Root access and twrp are present.

tables – How to show search results when the column isn’t there or will have too many results per row?

if I search for a User by "typing Bob" it might show 20 of them. But since I'm using a table, I can't show that many. Which is why I am showing the # of users. However I really need the ability to search by User or Deal.

The same issue can happen with Deal. If I search for “AUG” I might get 100 results for 1 Group or 1 row, so in total I may have 300 rows with 100 results per row. So I obviously can’t show that many deals. Which is why I am only showing a total # of deals. But if they search, what is the best way to show the matches? Would I put “Matched 2” after the # of total deals in a group?

boot – Does a working nomodeset means the gpu isn’t defective?

I have an M6600 which runs Kubuntu 20.04. I have problems with the screen sometimes. The laptop boots and I am able to log in. After some while I get a brownish display with vertical stripes. Sometimes it doesn’t show the login screen.

What always works is setting nomodeset in grub. Does this mean my problem is software related? I want to check first before I buy a gpu (even the M6600 gpus are quite expensive right now).

Here is some more information about the M6600:

System:
  Host: Precision-M6600 Kernel: 5.8.0-48-generic x86_64 
  bits: 64 Desktop: KDE Plasma 5 
  Distro: Ubuntu 20.10 (Groovy Gorilla) 
Machine:
  Type: Laptop System: Dell product: Precision M6600 v: 01 
  serial: <superuser/root required> 
  Mobo: Dell model: 04YY4M v: A00 
  serial: <superuser/root required> BIOS: Dell v: A04 
  date: 07/11/2011 
Battery:
  ID-1: BAT0 charge: 86.9 Wh condition: 86.9/98.2 Wh (88%) 
CPU:
  Info: Dual Core Intel Core i5-2520M (MT MCP) speed: 2394 MHz 
  min/max: 800/3200 MHz 
Graphics:
  Device-1: AMD Blackcomb (Radeon HD 6970M/6990M) driver: N/A 
  Device-2: Ricoh type: USB driver: uvcvideo 
  Display: x11 server: X.org 1.20.9 driver: vesa FAILED: ati 
  unloaded: fbdev,modesetting,radeon 
  Message: No advanced graphics data found on this system. 
Network:
  Device-1: Intel 82579LM Gigabit Network driver: e1000e 
  Device-2: Intel Centrino Ultimate-N 6300 driver: iwlwifi 
Drives:
  Local Storage: total: 592.27 GiB used: 29.86 GiB (5.0%) 
Info:
  Processes: 204 Uptime: 22m Memory: 7.73 GiB 
  used: 1.48 GiB (19.1%) Shell: Bash inxi: 3.1.07 

algebraic manipulation – Why isn’t SameQ working as expected?

First time asking a question on here so forgive my format. Basically, I’m fairly new to Mathematica and I don’t understand why SameQ isn’t working like it should. If I try

Sqrt[1/x] === 1/Sqrt[x]

and evaluate the cell, it returns False. What exactly is going on here? I tried using FullSimply, Simplify, and EqualTo in various combinations but nothing seems to work.

ios – TestFlight: Why isn’t individual tester getting notifications when new TestFlight builds are pushed to store?

I have an app on TestFlight, and I added an individual tester to version 0.1.3. I then pushed versions 0.1.4 and 0.1.5, and although this tester automatically appears under “Individual testers” for these last two builds, they didn’t receive any notifications about them, so they still have only version 0.1.3. They have auto-update set to ON. Does anyone know how I can resolve this?

difficulty – Isn’t Bitcoin’s hash target supposed to be a multiple of 2?

From Bitcoin’s whitepaper I’ve gathered that the hash of a block must start with a certain number of zeroes. And that this number of zeroes is adjusted every 2 weeks. Consequently the hash target is a multiple of two.

Requiring an extra zero for the hash function will divide the hash target by 2.

With that being said, in another question on the exchange (How is difficulty calculated?) it appears that the difficulty can be multiplied by fractions (e.g. 40%).

Does that mean that the hash targets aren’t necessarily multiples of 2? Or is the target rounded to the nearest multiple of 2?

dnd 5e – What happens when you use the knock spell on an object with a magical lock that isn’t specifically arcane lock?

The knock spell’s description reads:

Choose an object that you can see within range. The object can be a door, a box, a chest, a set of manacles, a padlock, or another object that contains a mundane or magical means that prevents access.

A target that is held shut by a mundane lock or that is stuck or barred becomes unlocked, unstuck, or unbarred. If the object has multiple locks, only one of them is unlocked.

If you choose a target that is held shut with arcane lock, that spell is suppressed for 10 minutes, during which time the target can be opened and shut normally.

When you cast the spell, a loud knock, audible from as far away as 300 feet, emanates from the target object.

As far as I see it, the description of the knock spell describes 4 things:

  • What the knock spell can target.
  • What happens if the knock spell targets something locked by a mundane lock, or is stuck or barred.
  • What happens if the locking mechanism is specifically the spell arcane lock.
  • The spell creates noise.

Valid spell targets include magical locks. But it doesn’t seem the spell says what it does when such a target is selected (except for create a loud knock sound). This is the case, unless a magical lock is considered ‘stuck’ in which it is according to the spell the lock would be unstucked.

However, the spell says what it does to stuck things where it specifies what happens to a target that is held shut by a mundane lock, or stuck or barred. If magical locks were considered stuck, there wouldn’t have been any need to specifically say what happens to a mundane lock, because it would apply to non-mundane locks too.


I originally asked this question here, but the question unfortunately got edited into a different question. The answer there addresses the question it got edited to. So I feel it is appropriate readdress the main issue in a new thread. For this reason, I don’t think this is a duplicate question, even though I copied the majority of the content of this question from that thread.