GATE CSE Doubts - Recent questions and answers
https://csedoubts.gateoverflow.in/qa
Powered by Question2AnswerAnswered: compiler construction
https://csedoubts.gateoverflow.in/21524/compiler-construction?show=21563#a21563
not slr(1) but lr(1)Compiler Designhttps://csedoubts.gateoverflow.in/21524/compiler-construction?show=21563#a21563Thu, 02 Jul 2020 06:49:54 +0000TCS MockVita 2020 , Lazy Student
https://csedoubts.gateoverflow.in/21562/tcs-mockvita-2020-lazy-student
<p>There is a test of Algorithms. Teacher provides a question bank consisting of <code>N</code> questions and guarantees all the questions in the test will be from this question bank. Due to lack of time and his laziness, Codu could only practice <code>M</code> questions. There are <code>T</code> questions in a question paper selected randomly. Passing criteria is solving at least <code>1</code> of the <code>T</code> problems. Codu can't solve the question he didn't practice. What is the probability that Codu will pass the test?</p>Probabilityhttps://csedoubts.gateoverflow.in/21562/tcs-mockvita-2020-lazy-studentThu, 02 Jul 2020 04:44:12 +0000Answered: Context Free Language
https://csedoubts.gateoverflow.in/21550/context-free-language?show=21559#a21559
Yes,this is CFL PUSH $w$ then SKIP $c$ and POP $w^{r}$<br />
<br />
we can design NPDA for this Language.Theory of Computationhttps://csedoubts.gateoverflow.in/21550/context-free-language?show=21559#a21559Wed, 01 Jul 2020 22:43:32 +0000Made Easy Test Series
https://csedoubts.gateoverflow.in/21553/made-easy-test-series
Consider 2 MBPS I/O device interfaced to 64 bit CPU in a programmed-I/O mode. Data transmission between the CPU and I/O in word-wise. Interrupt overhead is 3 μ/sec. What is the performance gain when the device is operating under interrup-I/O over programmed-I/O mode?<br />
<br />
A)2 B)2.5 C)1.33 D)2.66CO & Architecturehttps://csedoubts.gateoverflow.in/21553/made-easy-test-seriesWed, 01 Jul 2020 16:20:51 +0000Testbook Question
https://csedoubts.gateoverflow.in/21552/testbook-question
<p>Consider below code , where integer k initialized to $0.$</p>
<pre class="prettyprint linenums lang-c_cpp" data-pbcklang="c_cpp" data-pbcktabsize="4">
while(k!=11){
k++;
if(k%5==0)
continue;
fork();
}</pre>
<p>What is the total number of process created here??</p>
<hr>
<p>while will be execute 1 to 10 and fork() will not execute for 5 and 10. So, my ans is $2^{8}=256$</p>
<p>but given ans 512. How?</p>Operating Systemhttps://csedoubts.gateoverflow.in/21552/testbook-questionWed, 01 Jul 2020 15:45:12 +0000Self doubt : Pipelining hazards
https://csedoubts.gateoverflow.in/21551/self-doubt-pipelining-hazards
We are having a five-stage RISC architecture pipeline where the stages are instruction fetch ->decode->execute->memory access->write back, in which we are executing a single instruction ADD R1,R2,R3. As we can see that this instruction doesn’t require a memory access stage then the total number of cycles required to execute this single instruction is 4 cycles or 5 cycles?CO & Architecturehttps://csedoubts.gateoverflow.in/21551/self-doubt-pipelining-hazardsWed, 01 Jul 2020 15:37:34 +0000asked in made easy test series
https://csedoubts.gateoverflow.in/21549/asked-in-made-easy-test-series
<p><img alt="" src="https://csedoubts.gateoverflow.in/?qa=blob&qa_blobid=3826367834775666920"></p>
<p> </p>
<p>Kindly explained this in detailed way, like why particular steps will come and reason behind it.</p>CO & Architecturehttps://csedoubts.gateoverflow.in/21549/asked-in-made-easy-test-seriesWed, 01 Jul 2020 12:14:24 +0000What-is-the-required-general-rank-for-getting-CSE-in-IIT-if-I-am-an-OBC-NCL-student
https://csedoubts.gateoverflow.in/21547/what-the-required-general-rank-for-getting-cse-iit-obc-student
Written Examhttps://csedoubts.gateoverflow.in/21547/what-the-required-general-rank-for-getting-cse-iit-obc-studentWed, 01 Jul 2020 09:29:28 +0000which College can i get Mine Gate Score is 402 OBC NCL
https://csedoubts.gateoverflow.in/21548/which-college-can-i-get-mine-gate-score-is-402-obc-ncl
IISc/IITshttps://csedoubts.gateoverflow.in/21548/which-college-can-i-get-mine-gate-score-is-402-obc-nclWed, 01 Jul 2020 09:29:25 +0000Self Doubt:Time Complexity
https://csedoubts.gateoverflow.in/21543/self-doubt-time-complexity
What is time complexity to find median of medians?Algorithmshttps://csedoubts.gateoverflow.in/21543/self-doubt-time-complexityTue, 30 Jun 2020 14:07:15 +0000Entity Relationship Diagram
https://csedoubts.gateoverflow.in/21541/entity-relationship-diagram
Knowledge about mapping cardinalitiesDatabaseshttps://csedoubts.gateoverflow.in/21541/entity-relationship-diagramTue, 30 Jun 2020 05:19:52 +0000PROBABILTY AND DISTRIBUTIONS
https://csedoubts.gateoverflow.in/21540/probabilty-and-distributions
A elevator manufacturing company believes that 'X' is the amount of that can<br />
elevator withstand without any damage with is mean 100 and standard deviation<br />
10. This elevator is used to lift the company staff persons with mean 5 and<br />
standard deviation 0.5. How many staff person would have to be in the elevator for<br />
the probability of No damage exceeds to 0.85.Mathematical Logichttps://csedoubts.gateoverflow.in/21540/probabilty-and-distributionsTue, 30 Jun 2020 04:55:57 +0000Job Scheduler
https://csedoubts.gateoverflow.in/21537/job-scheduler
As we know Job scheduler works on mainly 2 criteria - To maintain degree of multiprogramming and to maintain proper mixture of CPU bound and I/O bound processes and considering these 2 criteria, it will new process from New/Start to Ready State.<br />
<br />
So my question is how Job scheduler come to know that the process if CPU bound or I/O bound ???Operating Systemhttps://csedoubts.gateoverflow.in/21537/job-schedulerMon, 29 Jun 2020 09:53:35 +0000Self Doubt infinte series
https://csedoubts.gateoverflow.in/21529/self-doubt-infinte-series
What will be the generalized form of the sum of square roots of n natural numbers?Study Resourceshttps://csedoubts.gateoverflow.in/21529/self-doubt-infinte-seriesSun, 28 Jun 2020 16:08:28 +0000Decidability In TOC
https://csedoubts.gateoverflow.in/21528/decidability-in-toc
Turing Machine accepts a regurlar language. Is it decidable or not ?Theory of Computationhttps://csedoubts.gateoverflow.in/21528/decidability-in-tocSun, 28 Jun 2020 12:02:55 +0000Answered: pushdown automata #CFL
https://csedoubts.gateoverflow.in/21526/pushdown-automata-%23cfl?show=21527#a21527
Here,<br />
<br />
$i \neq 2 *j + 1\; means,$<br />
<br />
$L=\left \{ a^{i}b^{j} | i>2*j+1 \; or\;i<2*j+1\right \}$<br />
<br />
$and\; you \; can \;design \;CFG for\: this \: grammar$<br />
<br />
$L1 = \left \{a ^{i}b^{i} \; {|} i > 2\times j+1\right \}\;$<br />
<br />
$L2 = \left \{a ^{i}b^{i} \; {|} i < 2\times j+1\right \}$<br />
<br />
$And\; do\;L1 \cup L2$<br />
<br />
2. Now we need to check whether given Language is DCFL or not due to Union of DCFL languages may not be DCFL.<br />
<br />
First step : Modify the Language as L\$. So every string in the language ends with \$ symbol<br />
<br />
given i ≥ 1, So on empty stack on encountering first i, push three x symbols into the stack after that change the state Q2.<br />
<br />
in this state, if you encounter i, then push two x symbols into the stack but don't change the state. else on encountering j, pop x and change the state Q3.<br />
<br />
on Q3, pop x from the stack for each j.<br />
<br />
you have three scenario on Q3:<br />
<br />
1) If you encounter \$ on x then move into final state due to i > 2j+1<br />
<br />
2) If you encounter j on Z0, then move to final state due to i < 2j+1<br />
<br />
3) If you encounter \$ on Z0 then move into non-final state due to i = 2j+1Theory of Computationhttps://csedoubts.gateoverflow.in/21526/pushdown-automata-%23cfl?show=21527#a21527Sun, 28 Jun 2020 10:02:08 +0000Answered: compiler construction
https://csedoubts.gateoverflow.in/21496/compiler-construction?show=21525#a21525
<p><img alt="" src="https://csedoubts.gateoverflow.in/?qa=blob&qa_blobid=8226994082311684172"></p>
<p>you have to follow these steps for University level. In gate you can easily solve by calculating first of those symbol and taking there intersection.</p>Operating Systemhttps://csedoubts.gateoverflow.in/21496/compiler-construction?show=21525#a21525Sun, 28 Jun 2020 04:37:21 +0000Answered: Is LL(1) a subset of LALR(1)?
https://csedoubts.gateoverflow.in/21401/is-ll-1-a-subset-of-lalr-1?show=21523#a21523
<p><img alt="" src="https://csedoubts.gateoverflow.in/?qa=blob&qa_blobid=2960221937612087102"></p>
<p>So LL(1) is not subset of LALR(1) always.</p>
<p>I think this image will clear all your doubt.</p>Compiler Designhttps://csedoubts.gateoverflow.in/21401/is-ll-1-a-subset-of-lalr-1?show=21523#a21523Sat, 27 Jun 2020 19:28:37 +0000General Aptitude Self doubt
https://csedoubts.gateoverflow.in/21522/general-aptitude-self-doubt
<p>Consider a Circle with 100 points numbered 1,2,3,4,…..,99,100. Now their is a tortoise at point numbered 1 and a hare at point numbered 2 and both can only move in clockwise direction only on numbered points. Tortoise can move <strong>one</strong> point at time for eg :- from 1 to 2,from 2 to 3 and so on and hare can move<strong> two </strong>points at a time for eg :- from 2 to 4 , from 4 to 6 and so on.They start moving and move at the same time i.e, when tortoise moves from 1 to 2, then hare also moves from 2 to 4. They continue to move like this until they meet at some point. Now find the point at which they meet or if they cannot meet at some point tell why??</p>Numerical Abilityhttps://csedoubts.gateoverflow.in/21522/general-aptitude-self-doubtSat, 27 Jun 2020 19:17:03 +0000Answered: EXTERNAL FRAGMENTATION SELF DOUBT
https://csedoubts.gateoverflow.in/21081/external-fragmentation-self-doubt?show=21521#a21521
<p>No external fragmentation.</p>
<p>External fragmentation will occur if your requested process size is less than available slot,but still you can't put the process in the slot.</p>
<p>Better to see the video given in following link. It will clear your all doubt. </p>
<p>Link <a rel="nofollow" href="https://youtu.be/YcX-awpW9yc">https://youtu.be/YcX-awpW9yc</a></p>Operating Systemhttps://csedoubts.gateoverflow.in/21081/external-fragmentation-self-doubt?show=21521#a21521Sat, 27 Jun 2020 19:15:01 +0000Answered: the gatebook ts
https://csedoubts.gateoverflow.in/21304/the-gatebook-ts?show=21518#a21518
f= frequency=10MHz<br />
<br />
t=12ns<br />
<br />
As f= 1/n*t, where n is mod number.<br />
<br />
Therefore n=1/f*t<br />
<br />
Putting the value we have n=8.33<br />
<br />
So, it is mod 9 counter.Digital Logichttps://csedoubts.gateoverflow.in/21304/the-gatebook-ts?show=21518#a21518Sat, 27 Jun 2020 18:04:06 +0000Answered: ISRO CS 2017-MAY
https://csedoubts.gateoverflow.in/21488/isro-cs-2017-may?show=21517#a21517
<p>Option A.</p>
<p>The fork system call create child process. When the parent process call fork, it will return child process ID and check it in 'if' condition given in question and gives if condition false. As a result it will directly go to print statement, and print 10. </p>
<p>On other part child process will excute a++, and a value will be 11. In next print statement of child process will give value as 11.</p>
<p>So output is 10 and 11.</p>
<p><strong>Option</strong> <strong>A</strong> <strong>is</strong> <strong>right</strong>.</p>Operating Systemhttps://csedoubts.gateoverflow.in/21488/isro-cs-2017-may?show=21517#a21517Sat, 27 Jun 2020 17:46:27 +0000Please give information about Mtech admission in Maharashtra
https://csedoubts.gateoverflow.in/21516/please-give-information-about-mtech-admission-maharashtra
Written Examhttps://csedoubts.gateoverflow.in/21516/please-give-information-about-mtech-admission-maharashtraSat, 27 Jun 2020 14:12:27 +0000Made Easy timing Diagraam Q .51
https://csedoubts.gateoverflow.in/21515/made-easy-timing-diagraam-q-51
<p>I am very Confused in these types plsexplain in some detail.</p>
<p style="text-align:center"><img alt="" src="https://csedoubts.gateoverflow.in/?qa=blob&qa_blobid=4737449569554399810"></p>
<p> </p>Digital Logichttps://csedoubts.gateoverflow.in/21515/made-easy-timing-diagraam-q-51Sat, 27 Jun 2020 10:06:11 +0000compiler construction ch4
https://csedoubts.gateoverflow.in/21514/compiler-construction-ch4
Construct a recursive descent parser to parse the string “w” for the given grammar “G”. w = bdc & grammar is<br />
<br />
S → Aa | bAc | dc | bda A → dCompiler Designhttps://csedoubts.gateoverflow.in/21514/compiler-construction-ch4Sat, 27 Jun 2020 07:45:56 +0000Algorithms Master Theorem
https://csedoubts.gateoverflow.in/21503/algorithms-master-theorem
T(n) = 2T(n/4) + 2^n<br />
<br />
How to solve these kind of questions?Algorithmshttps://csedoubts.gateoverflow.in/21503/algorithms-master-theoremFri, 26 Jun 2020 21:25:11 +0000Answered: Made easy Theory book
https://csedoubts.gateoverflow.in/21376/made-easy-theory-book?show=21506#a21506
$a^{n} b^{2n} c^{3n}$ for $n>0$ ie, $n>=1$ is not context free. We can't solve this using single stack, moreover it is similar of<br />
<br />
1. $a ^{n} b^{n} c^{n} |n>=1$ or<br />
<br />
2. $a^{n} b^{m} c^{k}| n=m$ and $m=k$<br />
<br />
These two are non cfl language or csl language.Theory of Computationhttps://csedoubts.gateoverflow.in/21376/made-easy-theory-book?show=21506#a21506Fri, 26 Jun 2020 17:41:01 +0000Made easy study material
https://csedoubts.gateoverflow.in/21504/made-easy-study-material
A three level memory system having cache access time of 15 ns and disk access time of 80 ns has a cache hit ratio of 0.96 and main memory hit ratio of 0.9. What should be the main memory access time to achieve effective access time of 25 ns?CO & Architecturehttps://csedoubts.gateoverflow.in/21504/made-easy-study-materialFri, 26 Jun 2020 16:45:41 +0000Show that the language L = w1cw2 : w1, w2 ∈ {a, b}+ , {w1 ≠ w^R2 } with Σ = {a, b, c}, is context-free.
https://csedoubts.gateoverflow.in/21494/show-that-the-language-w1cw2-w1-w2-w1-r2%C2%A0%C2%A0-with-is-context-free
If w =w, then the language should be context-sensitive language.<br />
<br />
If w ≠ w, then the language should be regular.<br />
<br />
<br />
<br />
How the above language is context free, please help?Theory of Computationhttps://csedoubts.gateoverflow.in/21494/show-that-the-language-w1cw2-w1-w2-w1-r2%C2%A0%C2%A0-with-is-context-freeFri, 26 Jun 2020 08:45:27 +0000What are the relevant chapter in Gravner for Probability ?
https://csedoubts.gateoverflow.in/21490/what-are-the-relevant-chapter-in-gravner-for-probability
What are the Topics of Gravner that are related to GATE?Probabilityhttps://csedoubts.gateoverflow.in/21490/what-are-the-relevant-chapter-in-gravner-for-probabilityFri, 26 Jun 2020 08:15:04 +0000Answered: Made easy test series
https://csedoubts.gateoverflow.in/21470/made-easy-test-series?show=21480#a21480
I think 64 <br />
<br />
no of bits required for opcode=32-(4+6+16)=6 <br />
<br />
(16 bits memory address field as there are 64k words)<br />
<br />
so no of different instruction=2^6=64 <br />
<br />
is it 64?CO & Architecturehttps://csedoubts.gateoverflow.in/21470/made-easy-test-series?show=21480#a21480Thu, 25 Jun 2020 21:01:55 +0000Answered: 2D Arrays from made easy test series topic test 1
https://csedoubts.gateoverflow.in/21474/2d-arrays-from-made-easy-test-series-topic-test-1?show=21478#a21478
I think 625?Programminghttps://csedoubts.gateoverflow.in/21474/2d-arrays-from-made-easy-test-series-topic-test-1?show=21478#a21478Thu, 25 Jun 2020 20:54:26 +0000Analysis of algorithms and space and time complexity
https://csedoubts.gateoverflow.in/21472/analysis-of-algorithms-and-space-and-time-complexity
<p>Find the complexity T(n) for the following recurrence relation.</p>
<p>T(n) = T(n/5) + T(n/6) + T(n/8) + c</p>
<p>i) O(nlog53) ii) Ω(nlog53) iii) O(nlog83) iv) Ω(nlog83) v) O(nlog63)</p>
<ol style="list-style-type:decimal" type="1">
<li>i and iv</li>
<li>ii and iv</li>
<li>iv and v</li>
<li>ii and v</li>
</ol>Algorithmshttps://csedoubts.gateoverflow.in/21472/analysis-of-algorithms-and-space-and-time-complexityThu, 25 Jun 2020 14:07:14 +0000Admissions into IISc CSA Research
https://csedoubts.gateoverflow.in/21471/admissions-into-iisc-csa-research
Did anyone receive any notice/email from IISc CSA dept. regarding the video call interview dates or being shortlisted? Thanks in advance.IISc/IITshttps://csedoubts.gateoverflow.in/21471/admissions-into-iisc-csa-researchThu, 25 Jun 2020 13:05:20 +0000Answered: Made easy pls answer que no.11
https://csedoubts.gateoverflow.in/21425/made-easy-pls-answer-que-no-11?show=21468#a21468
Ans should be d.Digital Logichttps://csedoubts.gateoverflow.in/21425/made-easy-pls-answer-que-no-11?show=21468#a21468Thu, 25 Jun 2020 08:08:12 +0000deadlock in databases
https://csedoubts.gateoverflow.in/21469/deadlock-in-databases
<p><img alt="" src="https://csedoubts.gateoverflow.in/?qa=blob&qa_blobid=11419754834567332028"></p>
<p>my question is isn’t wait wound and wait die <u><strong>deadlock prevention</strong></u> algo so how can we say that they are deadlock avoidance and how they can cause more aborts than needed?</p>Databaseshttps://csedoubts.gateoverflow.in/21469/deadlock-in-databasesThu, 25 Jun 2020 08:08:03 +0000In Compiler Construction course While mapping the conditions for the Shift and Reduce actions in SLR table
https://csedoubts.gateoverflow.in/21467/compiler-construction-mapping-conditions-reduce-actions
While mapping the conditions for the Shift and Reduce actions in SLR table, if both the conditions occur at the same state number then what action should you take first and Why?Theory of Computationhttps://csedoubts.gateoverflow.in/21467/compiler-construction-mapping-conditions-reduce-actionsThu, 25 Jun 2020 07:27:00 +0000Answered: GATE1999-1.20 Video Solution
https://csedoubts.gateoverflow.in/19495/gate1999-1-20-video-solution?show=21465#a21465
<p>watch this to clear your doubt</p>
<p><iframe allowfullscreen="allowfullscreen" frameborder="0" height="360" src="https://www.youtube.com/embed/9c6JLHP3rwQ" width="640"></iframe></p>Digital Logichttps://csedoubts.gateoverflow.in/19495/gate1999-1-20-video-solution?show=21465#a21465Thu, 25 Jun 2020 03:28:34 +0000Normalization Self doubt
https://csedoubts.gateoverflow.in/21464/normalization-self-doubt
<div class="kvgmc6g5 cxmmr5t8 oygrvhab hcukyx3x c1et5uql ii04i59q">
<div style="text-align: start;"><span dir="auto">R = {Student ID, Last Name, First Name, Course ID, Course Section, Course Name, Grade, Professor Last Name, Professor First Name, Bldg, Office #, Semester} with following functional dependencies</span></div>
<div style="text-align: start;"><span dir="auto">FD1 = Student ID --> Last Name, First Name</span></div>
<div style="text-align: start;"><span dir="auto">FD2 = Student ID, Semester, C_ID, C_Section --> C_Name, Grade</span></div>
<div style="text-align: start;"><span dir="auto">FD3 = Semester, C_ID, C_Section --> Prof_LName, Prof_FName, Bldg, Office#</span></div>
</div>
<div class="o9v6fnle cxmmr5t8 oygrvhab hcukyx3x c1et5uql ii04i59q">
<div style="text-align: start;"><span dir="auto">CONVERTING IT TO 2NF IM GETTING THREE TABLES BUT ANSWER IS GIVEN AS 4 TABLES. PLEASE HELP ME.</span></div>
</div>Databaseshttps://csedoubts.gateoverflow.in/21464/normalization-self-doubtWed, 24 Jun 2020 15:36:03 +0000transactions
https://csedoubts.gateoverflow.in/21463/transactions
<p><img alt="" height="58" src="https://csedoubts.gateoverflow.in/?qa=blob&qa_blobid=7861939721946566211" width="651"></p>
<p>a) S with no dirty read then S is cascadeless rollback but may not be strict recoverable<br>
b) S with no dirty read then S is recoverable but may not be cascadeless rollback<br>
c) S with no dirty read then S is conflict serializable schedule<br>
d) S with no dirty read then S is strict recoverable<br>
</p>Databaseshttps://csedoubts.gateoverflow.in/21463/transactionsWed, 24 Jun 2020 10:24:35 +0000made_easy_test_series
https://csedoubts.gateoverflow.in/21462/made_easy_test_series
<p><img alt="" src="https://csedoubts.gateoverflow.in/?qa=blob&qa_blobid=13565289073733699525"></p>Databaseshttps://csedoubts.gateoverflow.in/21462/made_easy_test_seriesWed, 24 Jun 2020 10:24:22 +0000Answered: Data Structures
https://csedoubts.gateoverflow.in/1588/data-structures?show=21461#a21461
<p>a[5][3][2]</p>
<p>Row major order</p>
<p>5 frames, 3 rows & 2 columns</p>
<p><img alt="" height="418" src="http://testseries.ravindrababuravula.com/img/Uploads/os/127.png" width="306"></p>
<p><img alt="" height="319" src="http://testseries.ravindrababuravula.com/img/Uploads/os/128.png" width="303"></p>Programminghttps://csedoubts.gateoverflow.in/1588/data-structures?show=21461#a21461Wed, 24 Jun 2020 10:24:12 +0000Graph Theory with Applications to Engineering and Computer Science, Narsingh Deo, Chapter 4 Question 27
https://csedoubts.gateoverflow.in/21459/applications-engineering-computer-science-narsingh-question
I was working from the famous book of Deo. Then i found this problem very hard and interesting. Any ideas to give me?<br />
<br />
<br />
<br />
- “Let us define a new term called edge isomorphism as follows: Two graphs G1 and G2 are edge isomorphic if there is a one-to-one correspondence between the edges of G1 and G2 such that two edges are incident (at a common vertex) in G1 if and only if the corresponding edges are also incident in G2. Discuss the properties of edge isomorphism. Construct an example to prove that edge-isomorphic graphs may not be isomorphic.”Graph Theoryhttps://csedoubts.gateoverflow.in/21459/applications-engineering-computer-science-narsingh-questionTue, 23 Jun 2020 20:01:37 +0000Graph Theory with Applications to Engineering and Computer Science, Narsingh Deo, Chapter 2 Question 21
https://csedoubts.gateoverflow.in/21456/applications-engineering-computer-science-narsingh-question
From Narsingh Deo, Graph Theory -> A round-robin tournament (when every player plays against every other) among n players (n being an even number) can be represented by a complete graph of n vertices. Discuss how you would schedule the tournaments to finish in the shortest possible time.Othershttps://csedoubts.gateoverflow.in/21456/applications-engineering-computer-science-narsingh-questionTue, 23 Jun 2020 17:31:03 +0000Answered: Regular expression self doubt
https://csedoubts.gateoverflow.in/21415/regular-expression-self-doubt?show=21452#a21452
k* means any number of zero including NULL ( zero k's)<br />
<br />
and you can have any combination you want.<br />
<br />
you can just keep expanding 0*, keeping everything else unitary<br />
<br />
ex: 0(10) , 00(10),000(10), 0000(10) ..<br />
<br />
or, 00(100), 00(100)..<br />
<br />
or, 0(111111111),<br />
<br />
or simply 0, 00, 000, 0000, 00000<br />
<br />
they all are stings from this R.E<br />
<br />
hope you get what you have asked.<br />
<br />
(No, you don't need to keep the value of * same)Theory of Computationhttps://csedoubts.gateoverflow.in/21415/regular-expression-self-doubt?show=21452#a21452Tue, 23 Jun 2020 03:25:56 +0000Answered: #DBMS #Normalisation
https://csedoubts.gateoverflow.in/21434/%23dbms-%23normalisation?show=21440#a21440
<p>Adding extra wrong information is definitely gonna lossy It'll cost you in different way in different scenarios</p>
<p> </p>
<p>Here's a simple example</p>
<p>lets assume a very simple database of simple library..</p>
<p>now you have a table where you store name of a person and book issued to him.,</p>
<p>lets say at some instance this table exactly looks like this..</p>
<table border="1" cellpadding="1" style="height:80px; width:385px; border-spacing: 1px;">
<tbody>
<tr>
<td>Name of person</td>
<td>name or say a unique no of books issued</td>
</tr>
<tr>
<td>p1</td>
<td>B1, B2</td>
</tr>
<tr>
<td>p2</td>
<td>B3</td>
</tr>
</tbody>
</table>
<p>now say brake this table into two, one with person, and other with name of books ( This is totally a hypothetical example, I know you won't be doing this in general, this is just to give you a hint or some point of view)</p>
<p> </p>
<p>our new tables are</p>
<p>person</p>
<table border="1" cellpadding="1" style="width:135px; border-spacing: 1px;">
<tbody>
<tr>
<td style="width:125px">Name of person</td>
</tr>
<tr>
<td style="width:125px">p1</td>
</tr>
<tr>
<td style="width:125px">p2</td>
</tr>
</tbody>
</table>
<p> Books</p>
<table border="1" cellpadding="1" style="height:106px; width:151px; border-spacing: 1px;">
<tbody>
<tr>
<td>Name of book</td>
</tr>
<tr>
<td>B1</td>
</tr>
<tr>
<td>B2</td>
</tr>
<tr>
<td>B3</td>
</tr>
</tbody>
</table>
<p> </p>
<p>merge new tables by taking cartesian product</p>
<p>person x Books</p>
<table border="1" cellpadding="1" style="height:204px; width:223px; border-spacing: 1px;">
<tbody>
<tr>
<td style="width:100px">Name of Person</td>
<td style="width:109px">Name of Book</td>
</tr>
<tr>
<td style="width:100px">p1</td>
<td style="width:109px">B1</td>
</tr>
<tr>
<td style="width:100px">p1</td>
<td style="width:109px">B2</td>
</tr>
<tr>
<td style="width:100px">p1</td>
<td style="width:109px">B3</td>
</tr>
<tr>
<td style="width:100px">p2</td>
<td style="width:109px">B1</td>
</tr>
<tr>
<td style="width:100px">p2</td>
<td style="width:109px">B2</td>
</tr>
<tr>
<td style="width:100px">p2</td>
<td style="width:109px">B3</td>
</tr>
</tbody>
</table>
<p>for simplicity Group this by Name of person</p>
<table border="1" cellpadding="1" style="width:500px; border-spacing: 1px;">
<tbody>
<tr>
<td>Name of Person</td>
<td>Name of Book</td>
</tr>
<tr>
<td>p1</td>
<td>B1, B2, B3</td>
</tr>
<tr>
<td>p2</td>
<td>B1, B2, B3</td>
</tr>
</tbody>
</table>
<p> </p>
<p>Now, this new table has all information we had earlier,</p>
<p>p1 got B1, B2</p>
<p>and p2 got B3</p>
<p>additional to this we have extra false information..</p>
<p> </p>
<p>Now imagine what happens, p1 walks in with B1, B2 hand both of them to you.. and say i wanna return them.. and want a clearance(no due) slip to close my account, you say okay, let me return these and check your information..</p>
<p>your table still show that p1 has B3 as well, you'll say.. oh you have one more book to return, first you have to give it back to get a no due slip..</p>
<p>but p1 is sure about it that he doesn't have any other book..</p>
<p>this is a problem isn't it?</p>
<p>although we still have our actual information, but because of some extra false information, our original information isn't useful anymore..</p>
<p>it is giving us some faulty info. So actually we lost some info instead of gaining any.</p>
<p> </p>
<p>One more example is this say you have a banking database..</p>
<p>where you have normal bank account( say saving/current) linked with a loan account for all those customers who have taken the loans..</p>
<p> </p>
<p>now say you performed decomposition on this table, and when you join them, you have all the previous information..</p>
<p>additionally you have linked one more bank account with a loan account you had previously..</p>
<p>now this is a real problem no one wanna go.. you don't want this kind of things to happen..</p>
<p> </p>
<p>Although it seems like you have some extra rows or columns in your table, but in actual you losses the correctness and usefulness of actual information you had earlier. (this is how i imagined it might be)</p>
<p> </p>
<p>These both example aren't practical, but when decomposition where after joining you add some faulty information, stuffs like this could happen, and you can mess up thing really bad such that, you loose significance of actual information as well.</p>
<p> </p>
<p>Hope this till now clear some picture for you.. you could come up with hundreds of examples like this, where you add extra points, which will eventually lead to lose the real information.</p>Databaseshttps://csedoubts.gateoverflow.in/21434/%23dbms-%23normalisation?show=21440#a21440Mon, 22 Jun 2020 15:56:22 +0000TestBook Test
https://csedoubts.gateoverflow.in/21439/testbook-test
<p>In an SR latch by cross-coupling two NOR gates if S = 1 and R = 0, then, it’ll result in ___? Can anyone please explain the reason?</p>
<p><img alt="" src="https://csedoubts.gateoverflow.in/?qa=blob&qa_blobid=1689011370434521080"></p>Digital Logichttps://csedoubts.gateoverflow.in/21439/testbook-testMon, 22 Jun 2020 15:34:24 +0000Answered: Expectation : Self Doubt
https://csedoubts.gateoverflow.in/21416/expectation-self-doubt?show=21438#a21438
A more eligant way to solve this is exploiting the recursion out of it.<br />
<br />
$E = 1\times p\left (getting\ white \right ) + p\left (not\ getting\ white\right )\times \left [ E + 1 \right ]$<br />
<br />
$E = \frac{1}{2} + \frac{1}{2}\times\left [ E + 1 \right ]$<br />
<br />
$E - \frac{E}{2}= \frac{1}{2} + \frac{1}{2}$<br />
<br />
$\frac{E}{2}= 1$<br />
<br />
$E = 2$<br />
<br />
<br />
<br />
Explanation of this recurive equation..<br />
<br />
$E = 1\times p\left (getting\ white \right ) + p\left (not\ getting\ white\right )\times \left [ E + 1 \right ]$<br />
<br />
E : expected value of random variable<br />
<br />
$1\times p\left (getting\ white \right )$ : we get white in first trial<br />
<br />
now, it we don't get white in frist trial, then we are expecting it to come in 2nd, if not then in third so on..<br />
<br />
we know it doesn't appear in first trail..<br />
<br />
$p\left (not\ getting\ while\right )\times \left [ E + 1 \right ]$<br />
<br />
<br />
<br />
this '+1' signifies that we already lost one trail white calculating previous expected value, that's why we multiply by E+ 1.<br />
<br />
This method is a bit complicated to understand. that's why i followed a more simple way to solve this earlier.Probabilityhttps://csedoubts.gateoverflow.in/21416/expectation-self-doubt?show=21438#a21438Mon, 22 Jun 2020 06:25:46 +0000A grammar with production rules { A ->Ba|Cb, B->CA, C->c|ε contains a) left factor b) left recursion c) both d) none
https://csedoubts.gateoverflow.in/21433/grammar-with-production-rules-contains-factor-recursion-none
<p><img alt="" src="https://csedoubts.gateoverflow.in/?qa=blob&qa_blobid=13871918707054609452"></p>Compiler Designhttps://csedoubts.gateoverflow.in/21433/grammar-with-production-rules-contains-factor-recursion-noneMon, 22 Jun 2020 05:40:22 +0000Transactions
https://csedoubts.gateoverflow.in/21428/transactions
R1(X),w2(X),R3(X),W1(X),W3(X). Is this scedsche is view serializable?Databaseshttps://csedoubts.gateoverflow.in/21428/transactionsSun, 21 Jun 2020 17:06:18 +0000