## induction – Every AVL tree can be colored to be a red-black tree

I want to prove any AVL tree can be turnt into a red-black tree by coloring nodes appropriately.
Let $$h$$ be the height of a subtree of an AVL tree.
It is given that such a coloring is constrained by these cases:

1. $$h$$ odd $$implies$$ black height $$=$$ $$frac{h}{2} + 1$$, root node black
2. $$h$$ even $$implies$$ black height $$=$$ $$frac{h+1}{2}$$, root node red

After that the root node is colored black.

I’m trying to prove this inductively. Let’s start with the base case $$h=1$$. Then there is only one node (the root node) and it gets colored black (using case 2) which yields a valid red-black tree.

Now suppose the statement is true for some $$h geq 1$$. Then for any node $$u$$ in the AVL tree, the height difference between their children is less than $$1$$. That is, for an AVL tree of height $$h+1$$ either both subtrees of the root node have height $$h$$ or one has height $$h-1$$.

By the induction hypothesis we know how to color the subtree of height $$h$$, depending on the parity of $$h$$. I’m unsure if I should use strong induction instead because it is not given in the hypothesis how to color a subtree of height $$h-1$$.

If we would know how to color both subtrees, then consider the following cases:

1. $$h+1$$ is even
• one subtree has height $$h$$, the other height $$h-1$$
• both subtrees have height $$h$$
2. $$h+1$$ is odd
• one subtree has height $$h$$, the other height $$h-1$$
• both subtrees have height $$h$$

For case 1.1 we would get
begin{align*} quad & h+1 &text{even} \ implies quad & h &text{odd} \ implies quad & text{black height} = frac{h}{2} + 1 \ implies quad & h-1 &text{even} \ implies quad & text{black height} = frac{(h-1)+1}{2} = frac{h}{2} end{align*}

So their black heights differ by $$1$$. How would I take that into consideration?

## co.combinatorics – Evenly putting colored balls into bins

Given an array of $$M$$ bins and a set of colored balls. There are $$n_i$$ balls of color $$iin cal{C}$$ with $$cal C$$ denoting the set of colors. $$M$$ is divisible by $$n_i$$ and $$sum_{iincal{C}} n_ile M$$. The problem is to find a way of putting each ball into a bin such that the balls of a same color are evenly spaced. For example, if $$M=4$$, $${cal{C}}={1,2}$$, and $$n_1=n_2=2$$, the solution is to put the two balls of the first color in bins $$1$$ and $$3$$ and the two balls of the second color in bins $$2$$ and $$4$$.

## [XenFun] Selective Username Colored Everywhere

[XenFun] Selective Username Colored Everywhere allows you to choose whether you wish to show username colors. By default, xenforo does not have this feature everywhere. We have added this feature with major positions but we will add other positions as per feature request by users.

Options
Admin can enable/disable for the feature even to choose the position for the username color.

Enable

• Node List…

## Are colored graphs and red-black trees related?

I’ve come across the concepts of colored graphs (register allocation) and red-black trees. They both seem to have this notion of "coloring", but I’ve never seen them being connected conceptually.

Do they have anything to do with each other?

## python – How do I graph an array of objects in MatPlotLib and create different colored cells and characters based on the internal variables of the objects?

I have an numpy array of 0s and objects from a class I created in Python. I want to use MatPlotLib to display them. Since MatPlotLib only takes floats, I would have to convert the objects to floats. The catch is this: the objects can have multiple internal variables with different. I want to represent that in the graph using multiple colors and numbers/characters inside the cells. Something like this:

But with characters inside the cells as well, similar to this:

Is there any way to do that in MatPlotLib?

## coloring – Four colored planar graphs with two vertices which must be colored the same

It is known that in maximal planar graphs with exactly two odd vertices, these two odd vertices must be colored the same in any four coloring. It is also possible to construct planar graphs with exactly two odd vertices which are not maximal, and such that in any four coloring the two odd vertices must be colored the same (using Hajós constructions). My question is whether all planar graphs such that two vertices must be colored the same have all vertices even except for two. And if so, how is this proved?

As an additional question, are there any references where I could look up and look at some maximal planar graphs with exactly two odd vertices?

Thank you.

## combinatorics – Colored Diagonals in Octagon

Given a regular octagon, in how many ways can we color one diagonal red and another diagonal blue so that the two colored diagonals cross (in the interior)? Consider rotations and reflections distinct.

I drew a few possibilities but I am not finding a pattern and I am stuck on how to continue.

## lens – What are these colored streaks in the front element of my lense?

Sorry to report, this looks like a separation of the optical glue used to cement together two optical elements. Camera lenses are complex arrays of multiple glass lenses. Some of these are spaced apart, some are cemented together. The cement used is water clear however age or a damaging blow can cause the cemented lens elements to separate. Repair will likely be too expensive so best you chalk this up as a loss. This separation will degrade the optical quality of this lens.

## shaders – In Unity, how can I render borders of provinces from a colored province map in a grand strategy game?

I am kind of a beginner of Unity.

I am trying do work on a grand strategy game. I already have a province map, colored by unique rgba for each province, looks like something below:

I know that the province map is kind of a look up map for province id. But when I obverse the paradox strategy games, I notice that they have render borders differently for the provinces and nations. For example, in the CK3, the Baron collars are separated with dotted lines, and the kingdoms are separated with enhanced yellow lines.

I thought they have some other maps or files containing those information, so I went to read their dev diary, and I find that all province shape information are stored in the province map.

So, my question is:

Is there any way in Unity3D to create those different borders with some shader and some province map such those given above?

## What are these colored lines on my Epson Perfection V370 scans?

I started to notice vertical stripes of color on all of my scans (table of documents). What could be the cause, and is there a solution? My scanner is an Epson Perfection V370 Photo, bought about 3 years ago. It has not been used very often.

The first image shows a solid white scan which shows light colored bands. The second image is an edited version where I increased the contrast to illustrate the problem.