why segmentation fault is arising , because of these three lines?

The code is giving segmentation fault. But it is working fine, :

  1. if i remove the first weird line “q++;”. Or
  2. if i call solve(s,1) in main function instead of solve(s,0) at third weird line.
  3. the code is working fine if i use “solve(s,q)” at second weird line.
 ''' #include using namespace std;  >bool solve(string s,int q) {     q++; //first weird line     if(q==10)         return true;     solve(s,q+1);//second weird line     return false; }  int main() {     string s;     cin>>s;     solve(s,0);//third weird line      return 0; }'''    

Channel coding and Error probability. Where are these probabilities from?

From where are the following probabilities?

We consider BSCε with ε = 0,1 and block code C = {c1, c2} with the code words c1 = 010 and c2 = 101. On the received word y we use the decoder D = {D1,D2} which decodes the word to the code word which has the lowest hamming distance to y. Determine D1 and D2 and the global error probability ERROR(D) if the code words have the same probability. Hint: To an output y there exists only one x which gets to a failing decoding. (Y = 100 will only gets wrong decoded if we sent message is x = c1 = 010.) So the term (1− p(D(y)|y)) is equal to Pr[X = x|Y = y] for a suitable x.


$ $ \begin{aligned} &\text { Hamming-Distance: }\ &\begin{array}{c|cc} \text { Code } & 010 & 101 \ \hline \hline 000 & 1 & 2 \ \hline 001 & 2 & 1 \ \hline 010 & 0 & 3 \ \hline 011 & 1 & 2 \ \hline 100 & 2 & 1 \ \hline 101 & 3 & 0 \ \hline 110 & 1 & 2 \ \hline 111 & 2 & 1 \ \hline \end{array} \end{aligned}$ $ $ $ \left.D_{1}=\{000,010,011,110\} \text { (Decides for } 010\right)$ $ \left.D_{2}=\{001,100,101,111\} \text { (Decides for } 101\right)$ $ $ $ \begin{aligned} E R R O R(D) &=\sum_{y \in \Sigma_{A}^{3}} p(y)(1-p(D(y) | y)) \ &=\overbrace{2 \cdot p(y)(1-p(D(y) | y))}+\quad \overbrace{6 \cdot p(y)(1-p(D(y) | y))}^{ } \ &=2 \cdot\left(\frac{729}{2000}+\frac{1}{2000}\right)\left(\frac{7}{250}\right)+6 \cdot\left(\frac{81}{2000}+\frac{9}{2000}\right)\left(\frac{757}{1000}\right) \end{aligned}$ $ How do I get to the probabilities $ $ \frac{7}{250}$ $ and $ $ \frac{757}{1000}$ $ ??

I don’t get this calculation. It should be right. But I don’t get how to get to these probabilities.

Could someone explain me this?

What is the subspecies name for the standard race choices in the D&D 3.5 Players Handbook? What is appearance do these subspecies, and a few others?

I am playing D&D on a Neverwinter Nights Enhanced Edition module using the D&D 3.5 ruleset. Please note that this is not a Neverwinter Nights game question. This is a D&D 3.5 lore question.

I am having difficultly finding the subspecies name for the standard race choices offered in the Players Handbook. I am also having difficulty finding descriptions and images of their appearance online. I am avoiding 4e or 5e images and information because some of the lore has changed.

Here is my list of questions. Hair and skin is all I need for description. If you can have a picture link that would be very helpful. I will also gladly look at any online resource that answers my questions and saves people time from writing out their answers.

What is the standard elf race subspecies name in D&D 3.5? What is their suggested appearance?

What is the standard gnome race subspecies name in D&D 3.5? What is their suggested appearance?

What is the standard dwarf race subspecies name in D&D 3.5? What is their suggested appearance?

What is the standard halfling subspecies name race in D&D 3.5? What is their suggested appearance?

What does a deep dwarf look like?

What does a wild elf look like?

What does a wood elf look like?

What does a gray elF look like?

What does a forest gnome look like?

What does a lightfoot halfling look like?

What does a tallfellow halfling look like?

What is a tribal orc? What does it look like?

What is a deep orc? What does it look like?

Which of these images is better?

Which of these images is better?

Attached are 2 files "arrow3" and "arrow4"
Each has 3 sets of arrow shapes in it.

The effect I am going for is:
Left arrow: rising from ground up
Middle arrow: falling from sky
Right arrow: simple shadow, like photoshop

In first image, arrow3,
the shadows are bit noisy,
and in second image, arrow4,
the shadows are much smoother.

My question:
Which of these arrows is better suited for a web logo etc


What is the difference in time-complexity for sorting these 2-d arrays?

Let $ A$ have $ n/10$ rows, $ 10$ columns and $ n$ overall elements

Let $ B$ have 10 rows, $ n/10$ columns and $ n$ overall elements.

It is given that each row in sorted in ascending order, Can you sort each of these in $ O(n\log(n))$ or better using comparison sort?

I’m leaning towards k-way merge implementing a min-heap following this implementation merging sorted arrays, but I can’t seem to figure out what the difference between this cases is.

$ B$ for example will have $ 10$ elements constantly in the min-heap, so the time complexity will be $ 10n \log(n) \in O(n)$ ? Is this even possible in comparison sorts?

While $ A$ would have $ n/10$ elements in the min-heap, but are the run times equivalent?

Are these two homebrew shields balanced?

I remember being impressed with this question, although it was closed as too broad for asking about too many things in one go. I left a comment at the time about asking less, and coming back to this later, I’ve decided to have a go at asking this. Note that I’ve also taken a look at this question about a homebrew tower shield.

This is partly based on NWN2, a video game that uses 3.5e rules, so I assume shields were broken up similarly in 3.5e, but I only know that game. In that game, there were “light shields” (i.e. “bucklers”), “heavy shields” and “tower shields”.

In short, I wanted to introduce a “light shield” and “tower shield”, keeping the RAW 5e shield as a “heavy shield”. See below for the table comparing AC and pricing, similar to the official table and the above linked question about a tower shield.

$ \begin{array}{|c|c|c|c|c|} \hline \textbf{Armor Name} & \textbf{Cost} & \textbf{Armor Class} & \textbf{Strength} & \textbf{Stealth} & \textbf{Weight} \ \hline \text{Light shield} & 5\,\text{gp} & +1 & \text{N/A} & \text{N/A} & 2\,\text{lb.} \ \hline \text{Heavy shield} & 10\,\text{gp} & +2 & \text{N/A} & \text{N/A} & 6\,\text{lb.} \ \hline \text{Tower shield} & 50\,\text{gp} & +3 & 15 & \text{Disadvantage} & 45\,\text{lb.} \ \hline \end{array} $

In addition to the above table:

  • I wanted it to be possible for the light shield to be donned and doffed as a bonus action (since otherwise why would anyone want it over a heavy shield?)
  • I wanted the tower shield to have the restriction that you needed to be proficient with heavy armor and shields, otherwise you cannot benefit from it and trying to use it imposes the same penalties as with not having proficiency with armor (from Armor Proficiency):

Armor Proficiency. Anyone can put on a suit of armor or strap a shield to an arm. Only those proficient in the armor’s use know how to wear it effectively, however. Your class gives you proficiency with certain types of armor. If you wear armor that you lack proficiency with, you have disadvantage on any ability check, saving throw, or attack roll that involves Strength or Dexterity, and you can’t cast spells.

So, my question is, are my new light shield and tower shield balanced? Meaning, are there any problems from having a light shield that you can don with a bonus action for the cost of -1 AC compared to a RAW shield (what I’m now calling the heavy shield)? Are my restrictions on the tower shield enough to justify basically being able to buy a +1 shield (albeit a nonmagical one), or is it still too strong even so?

(I also considered adding a Strength requirement to the “heavy shield”, like 13 or even just 10, but that kinda screws over Dexterity based medium armor wearing shield users, so I decided against it, but I could be easily swayed into reconsidering it; possibly a separate question to this one, though.)

Is the usage for asymptotic notation for these algorithms correct? [duplicate]

So after reading a lot of information around asymptotic analysis of algorithms and the use of Big O / Big Ω and Θ, I’m trying to grasp how to utilise this in the best way when representing algorithms and operations on data structures.

For example there is a recommended website where I got this screenshot from describing Quicksort and I’ve noticed a few issues that stand out to me based on what I’ve learnt.

  1. Is it possible for all notations to represent “Best” “Average” and “Worst” cases? and if so how is this possible? For example for a “Worst” case, How can Big Ω represent the Upper bound. The upper bound is tied to Big O.
  2. I thought in order to find Theta Θ, Big O and Big Ω had to be the same values? In the screenshot “Best” case is n log(n) and Worst case is n^2 so how can Θ(n log(n))?
  3. Take for instance a Hash Table data structure, if you were to perform an analysis on the time complexity for insertion of an element. Would I be correct is saying you could interchangeably say Ω(1) and O(N) or conversely “Average Case is O(1)” and “Worst Case is O(N)”?