From bb6dfe8cd2675247e52f91ea516d8a64955a8b5e Mon Sep 17 00:00:00 2001 From: Crystal Date: Fri, 19 Apr 2024 20:02:21 +0100 Subject: Remove junk (html files) preparing for git exports --- .gitignore | 4 + articles/discord.html | 215 ----- articles/feminism1_alex.html | 92 --- blog/asm/1.html | 538 ------------ blog/c/cherry.html | 171 ---- blog/c/game.html | 346 -------- blog/lisp/episode1.html | 29 - blog/misc/merlin.html | 191 ----- index.html | 209 ----- links.html | 106 --- src/org/class_notes.html | 420 ++++++++++ src/org/export.sh | 8 + super_secret.html | 38 - uni_notes/algebra.html | 1870 ------------------------------------------ uni_notes/alsd.html | 109 --- uni_notes/analyse.html | 1624 ------------------------------------ uni_notes/architecture.html | 968 ---------------------- 17 files changed, 432 insertions(+), 6506 deletions(-) create mode 100644 .gitignore delete mode 100755 articles/discord.html delete mode 100644 articles/feminism1_alex.html delete mode 100644 blog/asm/1.html delete mode 100644 blog/c/cherry.html delete mode 100644 blog/c/game.html delete mode 100644 blog/lisp/episode1.html delete mode 100644 blog/misc/merlin.html delete mode 100755 index.html delete mode 100755 links.html create mode 100644 src/org/class_notes.html create mode 100755 src/org/export.sh delete mode 100755 super_secret.html delete mode 100755 uni_notes/algebra.html delete mode 100755 uni_notes/alsd.html delete mode 100755 uni_notes/analyse.html delete mode 100755 uni_notes/architecture.html diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..267df00 --- /dev/null +++ b/.gitignore @@ -0,0 +1,4 @@ +.DS_Store +.idea +*.log +tmp/ diff --git a/articles/discord.html b/articles/discord.html deleted file mode 100755 index 5e657c7..0000000 --- a/articles/discord.html +++ /dev/null @@ -1,215 +0,0 @@ - - - - - - - -**Discord** : an internet cancer - - - - - - - -
- UP - | - HOME -
-

Discord : an internet cancer

-
-

Preamble

-
-

-Before I start writing this article, I just want to clarify that I will NOT go over the technical aspect of Discord (such as the spyware and all) as it has been covered many times by other websites like This one !!!, but basically, it’s exactly how you expect it to be, spying, selling data, monitoring open processes, terrible electron based app….etc -

- -

-I also wanted to make it clear that this is PURELY from my personal experience with Discord and the Internet as a whole, this isn’t an exact science and everybody can have an - although similar - different experience with the platform. Peace and love <3 -

-
-
-
-

Chapter one : Curiosity

-
-

-Picture yourself, it’s 2018/2019 and you are playing your favorite game, be it Minecraft, League of Legends, CS:GO, doesn’t matter. You start to play nicely, you make some friends, some enemies, typical gameplay. And then, one of them decides to take a step closer into your life, so they invite you to this cool new platform you have never heard about, Discord. Upon checking, you notice it’s a modern chat application for gamers…. “huh, must be nice” you might say. And then you are faced with a choice, you either create an account, or you don’t. -

- -

-If you decide to NOT make an account, you would be made fun of by that friend, or even get blamed for loses because “you weren’t in the voice chat”, you will be called a “Skype user”, probably miss out on events, giveaways, exclusive prizes and sometimes even get banned from that game server (Yeah, it happened on Minecraft before, failure to join the discord server actually rejects you from the Minecraft server). And even if we take a more…casual example, you found a cool piece of software online, but their guides and download links are all on Discord, or Discord exclusive, maybe you want to work with a team that solely use Discord. Basically you are missing out on a LOT. -

- -

-However, if you take the path of least resistance and decide to sign up, entering your e-mail address, password, birth date, and in the unfortunate case where you use a VPN or TOR, your phone number, pick a username and a profile picture. Congratulations, you now cursed yourself for the rest of your life. Remember that friend we imagined ? You play a few games together in VC, you crack jokes, you get to know each other… it’s all fun and games, but then, they send you a link you never saw before. Apparently it’s how you add people to groups in discord, they are called “Servers” -

- -

-> emkey.jpeg -

- -

-So you join that group they invited you to, it could be anything from a small friend group, to a large server with giveaways and events. But they all share one aspect, a hierarchy. -

-
-
-
-

Chapter two : The hierarchy

-
-

-Now this hierarchy is not inherently bad, but this is how Discord (and even the communities on Discord) keep you addicted to them. When you join, you start as a peasant, a pleb, a noobie even. You have an ugly color for your username, and no access to “channels”, only few ones with cooldowns so you don’t talk much. And then you look at the members list, and you see a beautiful rainbow, people divided into categories, or roles as they like to call them!! -

- -

-At the top you will most likely find the Owner(s) or their loved ones, with colors that inspire majesty and fear, like a dark purple, these are the masters of the server, they shape it the way they want and in the rare occasion where they join the plebs in their discussions, they are met with rounds of applause. -

- -

-Then just below them you have the Right hand(s) of the owners, generally veterans and original members, they have a bright, warm yet still majestic color to their role. These have the same power as the Owners, but are more active in the server and are actually hated by a lot of users, who unfairly got banned or kicked. -

- -

-Then just below them you have the Bots, non-human, non-sentient beings, most of the time with a silvery metallic color as their username which are there to execute the Owners commands, or just to annoy the plebs, like a tax collector after a long day of work “Congratulations you just advanced to level 5” -

- -

-Now, you have the Moderators, these have some power, have an aggressive color as their role and are generally the ones who try to control the Chaos in the server, although most of the time they fail due to a lack of permissions, or threats from the Owners themselves. Regardless, these are the ones with the biggest ego, and most importantly they are the ones causing server splits. -

- -

-If the aforementioned roles are considered black, and normal users are white, then Helpers are definitely the gray line separating them. They are peasants who strive to go a rank higher, to be a majesty, and have some power. But most of the time, they are there for an eternity, or they just go from there all the way up to a Right hand using some witchcraft….Oh and their color is almost always Green :D -

- -

-After that we have the Plebeians which are also separated in an attempt to control them easily. But I’m going to go through the list quickly otherwise this article will take ages : you have the supporters - people who helped the server financially or in other ways -, partners which are just owners of other servers who decided to become living billboards, you have event winners to remind the others of what they can achieve if they wait long enough, then we have the activity roles, the more you are active, the more you have rights over casual users, this is definitely not a way to keep you addicted to the group discussion ;3 -

- -

-And finally, you have the outcasts, warned or muted people are all the way down the list, and they have little to no rights or uses in the server, quite frankly if they left they would have a better time !!!! -

- - -

-Okay so, in all seriousness. This at first glance doesn’t seem like a bad idea, after all you need order and laws in an easily accessible group. But this is not the way it’s used, this hierarchy is constantly there to remind you of what you can be if you are liked enough by the owners, what you can achieve. And in most cases, you get access to exclusive channels, a secret club, creating a sense of scarcity and power. This is bad because it keeps people invested in discussions they honestly don’t want nor need to have, but they are obliged, otherwise they are just a “powerless normie”. -

- -

-Now what happens if a Mod or an Owner decides to abuse their power ? Well in this case, here are the different outcomes : -

- -
    -
  • Either people get angry and start spamming and protesting (usually ends with a purge or a mass ban)
  • -
  • People just blame the victim because it’s more profitable
  • -
  • An other rogue mod decides to take control and destroy the server
  • -
  • Or if it’s a disagreement between Owners, the server undergoes a split
  • -
- - -

-If you are paying attention, you would know that all of these will always end with the same ending : “Another server gets created”, and so this is how… -

-
-
-
-

Chapter three : Discord takes a once thriving community and splits it

-
-

-Yes, there are always splits, and communities divide into multiple tiny sub-communities with their own opinions about useless matters. That is how you are kept invested. People love Drama, they love wars and they love picking sides. -

- -

-Let’s imagine together a simulation for what i mean, since i can’t draw or animate, use your imagination: -

-
    -
  • You have a big red circle, its Group A, a pretty large tech community, with tiny dots inside with different colors, these are members and the colors represent their roles.
  • -
  • Once in a while, a fight happens in this group. Let’s say there is a fight between two normal users, a mod steps in and bans the user who is in the wrong. Not a big deal so far !
  • -
  • Now let’s imagine this scenario again, but with a different person, Kevin, a normal user in the group, but with a consistent presence, he is loved by a handful of people. Sadly he gets wrongly banned… wrong move for the mod, because now Kevin takes his supporters and make their own group, a blue one called Group B
  • -
  • Group A’s growth is starting to diminish because there is nothing to do there, and people are slowly moving to group Group B because of the overall aesthetic, in an attempt to win back their following, Group A decide to make events and reward their loyal followers. It kinda works but Group B is in a study growth
  • -
  • Oopsie, there is a minor disagreement between Group A owners, and it turns into a big war between them. which ends up with members taking sides and dividing the server in half, creating two new communities Group C and Group D
  • -
  • And now, you know what is interesting ? is that all these 4 groups are not only semi-dead, but have the same users in them. AND SHARE THE SAME TOPIC
  • -
- -

-So you basically killed a community, in 6 easy steps !!! And of course this will end up either by a mass deletion of these groups by a rogue Moderator, or a ban, or a screw up. So if the server contained important non-archived data. They are looong gone!!! -

-
-
-
-

Chapter four : Discord users are NOT your friends

-
-

-Discord is made in a way that makes it easy to get attached to people, and also really hard to get rid of them, because you share the same servers, same friends, and the border between Private talk and Public talk is really blurred. Not to mention how hard, if not impossible it is to find someone who you met before but lost their contact. Because not only could they change their tag, but there is no way to search their username, and the servers can disappear from a minute to an other, or go private, or anything really !!! Now Shy actually talked about this issue on their article about Discord, but here I’m making a different point, in their article they say that it’s hard to get rid of someone you know via Discord, which is absolutely true. But it’s also easy to lost contact with someone literally in a split second, even people you deem “close” to you, they just…disappear!! So for y’all thinking about dating on Discord, that’s a terrible idea !!!! -Imagine you’re in a Discord server, vibing with some awesome people, chatting about everything from the latest memes to the mysteries of the universe. You’ve become practically inseparable online pals, sharing inside jokes and bonding over your mutual hatred for pineapple on pizza. Life is grand, right? -

- -

-But, brace yourself for the plot twist: Discord friendships are like a box of chocolates - you never know what you’re going to get. People appear and disappear from servers faster than you can say “dank meme.” One day, your best Discord buddy is there, cracking jokes and sharing dog pics, and the next day, poof, they’re gone. Maybe they got bored, maybe real life called, or maybe they wandered into the Discord Bermuda Triangle. Who knows? -

- -

-Now, here’s the kicker: finding a lost Discord friend is like trying to find a grain of sand on a beach during a hurricane. You can’t just Google them, and even if you know their username, it’s about as useful as a chocolate teapot if they’ve changed it. Servers vanish, go private, or morph faster than a Pokémon in a battle. It’s like trying to capture smoke with a butterfly net. -

- -

-So, for those pondering the idea of Discord romance, think twice! While forming connections is a breeze, keeping tabs on those connections is like herding cats in a hurricane! -

-
-
-
-

Final Chapter : Login-walls

-
-

-People have made this point before and i will make it again, but locking important information behind a log-in page, with no way to find them using a Google search is stupid at best and manipulative at worst, because in this situation. Not only are you putting your faith on Discord servers to not fail one day, but on server Owners to not delete their work (and potentially rare unrecoverable work from other users). Not to mention that you actually need to be in that server to even know of the existence of these kind of resources. Regardless of how you see it, this is just putting valuable info in the hands of random people who could easily lock them behind a specific role that can be obtained either by paying, or by stroking their digital e-penis !!! -

- -

-You see, Discord, in all its infinite wisdom, believes it’s a brilliant idea to squirrel away precious knowledge behind a digital fortress that demands a username and password. It’s like saying, “Sure, I’ll share this life-changing information with you, but only if you can recall your umpteenth password!” -

- -

-Now, let’s break this down. First, you’re entrusting your prized data to Discord servers, which, let’s face it, are about as stable as a Jenga tower during an earthquake. One moment they’re there, and the next… poof! Gone with the wind. So much for your treasure trove of wisdom. -

- -

-And it gets even better. Server owners have the power to lock away valuable resources behind specific roles, which can be obtained through a combination of charm, flattery, or, heaven forbid, a cash transaction. It’s like saying, “Want to see the good stuff? Well, pony up or start groveling!” -

- -

-So, what’s the bottom line here? Discord has effectively become a modern-age Sphinx, guarding its secrets with a riddle of log-in screens. Your valuable info? In the hands of random folks who could decide to hoard it like misers guarding their gold or sell it to the highest bidder. It’s like a digital Wild West, and your information is the wild mustang everyone’s trying to wrangle. -

- -

-In conclusion, Discord’s penchant for login-walls is like locking away the Ark of the Covenant in a storage locker and hoping for the best. It’s the digital equivalent of hiding your keys in a haystack and hoping you can find them before the cows come home. -

-
-
-
-

Conclusion

-
-

-While Discord has its quirks and pitfalls, it’s essential to remember that it’s a reflection of the internet itself - a vast, ever-changing landscape filled with both wonder and peril. Your experience on Discord is uniquely yours, but it’s bound to be filled with surprises, friendships, and even the occasional drama. -

- -

-As we wrap up this exploration, it’s worth noting that Discord, like any digital space, is shaped by its users. The tales of adventures and misadventures, the rise and fall of servers, and the endless cycle of drama are all part of the grand tapestry of online life. -

- -

-So, if you find yourself lost in the labyrinthine corridors of Discord or stumble upon its peculiarities, remember, you’re not alone. Many have ventured before you, and many more will follow. The internet, after all, is an ever-evolving, enigmatic landscape where, as in life, every twist and turn holds the promise of a new adventure. -

- -

-If you ever have more anecdotes, insights, or questions to add to this digital saga, feel free to reach out. The story of Discord is far from over, and your voice could be the missing piece of the puzzle in this fascinating online journey. Until then, peace and love in your digital endeavors, and may your Discord adventures be filled with more joy than chaos! -

-
-
-
-
-

Author: Crystal

-

Created: 2024-03-01 Fri 15:06

-
- - diff --git a/articles/feminism1_alex.html b/articles/feminism1_alex.html deleted file mode 100644 index 57e9271..0000000 --- a/articles/feminism1_alex.html +++ /dev/null @@ -1,92 +0,0 @@ - - - - - - - -Existing as a woman is a rebellion. - - - - - - - -
- UP - | - HOME -
-

Existing as a woman is a rebellion.

-

-Original Link (You should def check it out): -

- - - -
-

gay_gemstone.gif -

-
-
-

Original Article :

-
-

-(Before starter, I want to note that I did make a tiny little mistake in my previous post, and I apologize for that! )
-
-What is a woman without a man? What is a free woman ? And can we affirm that women in our modern world are truly free?
-
-The simple act of existing freely as a woman is seen as a rebellion in this society, and by free I mean not basing her entire existence around men and how to please them.
-
-Women’s rights have been discussed for centuries, and are still an on going discussion excluding women themselves from it. (for instance: in Afghanistan, women don’t have the right for an education anymore, and in the United States, abortion is now illegal in some of the states.) We sexualise her, objectify her, we deprive her of her humanity and treat her like an animal. A woman is never seen as what she is and who is she, a simple human being.
-
-We could clearly see how much women are oppressed nowadays, if the world wasn’t purposefully blind. We shame them for enjoying their time on earth, we dismiss them, we silence them, we ruin them psychologically, We question their opinions, and their choices, we assault them, physically, verbally or both and blame them for it… These are just a few examples on how oppression towards women is still present.
-
-The women of the past fought for the ones of today, for them to have rights as human beings and to be free from oppression, and while the fruit of their efforts have payed, and gave women a better life, we still have a long way to go from finding true freedom. The assault that we face daily are just but one example out of many that men use to remind us of how much the world hates women, that the world we live in is still theirs, and that we are only viewed through their gaze.
-
-When I say men, I do mean all men. Even the ones who stays silent, especially the ones who stay silent. They maybe are not the ones assaulting but they surely are benefiting from the ones that do, so they certainly don’t condemn them. They are the ones questioning a woman’s sincerity, how many times did we hear statements such as « he would never do that », « he’s still my friend » and « it is none of my business »? This highlights how much a woman’s voice is muffled, and is questioned before being believed, and how little empathy men have towards the victims. They will also use the argument of fake accusation knowing very well that the statistic shows that less than 1% of the claims made by sexual assault victims are fake. Statistics also shows that one in three woman is victim of assault in her life, and that 98% of the assaulters are men. But they do not care about the statistics. In fact they are very well aware of the truth but choose to instead dismiss it.
-
-To respond clearly to the questions asked in the beginning: A woman without a man is simply a woman, a human being with a body and mind, with thoughts and ideas, with opinions and dreams, with urges,… just a simple human being.
-
-A free woman as of today, is a woman who doesn’t center her life around men, and thinks freely, she is provocative, affirm and validates her opinions, she is passionate about her dreams, she does not worry on how the world views her because she already knows, she is feared, because she has freed herself from the patriarchal and sexist ideas that the world has put into our minds.
-
-Unfortunately, women in this society are not free, their souls and bodies are still imprisoned in the very core of the patriarchy. Like I said earlier, men are going out of their ways to make sure the world is still theirs, and moreover, misogynistic behaviors are still present between women, since we have incorporated it so deeply in our lives, and in our way of thinking that it is easier for women to accept misogyny as the way of things than to question why we are so mean and cruel towards our own kind and notice the injustices.
-
-I could go on and on as to why women in this modern society are still oppressed, but I will only say this: to you dear reader, reading this essay (more a stream of consciousness than essay honestly) with knitted eyebrows and an angry face, open your eyes, and start seeing the world as it really is.
-
-To conclude, I do not think, I do not suppose, I do not express an opinion, I know, and I’m expressing facts, that the world is not ready to acknowledge.
-
-

-
-
-
-

Webmaster’s response :

-
-

-While I do agree with mostly everything written above, I think there is much to add from multiple point of views and experiences, so I’m sharing mine here which, and following the general theme of the website, would be the technological aspect of being a women. -

- -

-When you first use the internet, you instantaneously assume that everyone is a man…I mean, that is one of the numerous rules of the web : Rule 24: On the internet men are men, women are also men, and kids are undercover FBI agents. Which is plain wrong, stupid, and sexist to a larger extent, assuming that women are not “smart enough” to be regular internet users. And this idea of course didn’t come from nowhere, i blame it mostly on American movies about “Tech-geeks” and all. But hey, we are not here to blame someone, just to notice! A lot of women are programmers, devs, cybersecurity experts, literal queens of the internet, yet a lot of people assume that women only use the internet to either bait you into buying their OnlyFans, or as a casual user, an easy to scam one too……Reminds you of something ? smells like patriarchy my dudes. -

- - -

-A lot of women, especially biological ones are seen as inferior programmers compared to biological men (I say biological men here, because it seems like cisgendered men prefer saying that a transfem is a better programmer than them, rather than saying that a WOMAN is better. Again, sexism down to the subatomic level) which, again, is not the case. And I know that from experience, one of the best Hackers I know is actually a girl!! -

- - -

-In the end, I think that no matter what we do, we won’t be able to change the image of the powerless skill-less woman that social media (and media in general) have created about women. So what should we do ? Should we go full Amish mode ? Or even do it Ted K style and ditch them all ? I will let you decide -

-
-
-
-
-

Author: Alex

-

Created: 2023-11-10 Fri 21:45

-
- - \ No newline at end of file diff --git a/blog/asm/1.html b/blog/asm/1.html deleted file mode 100644 index 4ed3574..0000000 --- a/blog/asm/1.html +++ /dev/null @@ -1,538 +0,0 @@ - - - - - - - -x86 Assembly from my understanding - - - - - - - -
- UP - | - HOME -
-

x86 Assembly from my understanding

-

-Soooo this article (or maybe even a series of articles, who knows ?) will be about x86 assembly, or rather, what I understood from it and my road from the bottom-up hopefully reaching a good level of understanding -

-
-

Memory :

-
-

-Memory is a sequence of octets (Aka 8bits) that each have a unique integer assigned to them called The Effective Address (EA), in this particular CPU Architecture (the i8086), the octet is designated by a couple (A segment number, and the offset in the segment) -

- - -
    -
  • The Segment is a set of 64 consecutive Koctets (1 Koctet = 1024 octets).
  • -
  • And the offset is to specify the particular octet in that segment.
  • -
- -

-The offset and segment are encoded in 16bits, so they take a value between 0 and 65535 -

-
-
-

Important :

-
-

-The relation between the Effective Address and the Segment & Offset is as follow : -

- -

-Effective address = 16 x segment + offset keep in mind that this equation is encoded in decimal, which will change soon as we use Hexadecimal for convention reasons. -

-
-
    -
  • Example :
    -
    -

    -Let the Physical address (Or Effective Address, these two terms are interchangeable) 12345h (the h refers to Hexadecimal, which can also be written like this 0x12345), the register DS = 1230h and the register SI = 0045h, the CPU calculates the physical address by multiplying the content of the segment register DS by 10h (or 16) and adding the content of the register SI. so we get : 1230h x 10h + 45h = 12345h -

    - - -

    -Now if you are a clever one ( I know you are, since you are reading this <3 ) you may say that the physical address 12345h can be written in more than one way….and you are right, more precisely : 212 = 4096 different ways !!! -

    -
    -
  • -
-
-
-

Registers

-
-

-The 8086 CPU has 14 registers of 16bits of size. From the POV of the user, the 8086 has 3 groups of 4 registers of 16bits. One state register of 9bits and a counting program of 16bits inaccessible to the user (whatever this means). -

-
-
-

General Registers

-
-

-General registers contribute to arithmetic’s and logic and addressing too. -

- - -

-Each half-register is accessible as a register of 8bits, therefor making the 8086 backwards compatible with the 8080 (which had 8bit registers) -

- - -

-Now here are the Registers we can find in this section: -

- - -

-AX: This is the accumulator. It is of 16 bits and is divided into two 8-bit registers AH and AL to also perform 8-bit instructions. It is generally used for arithmetical and logical instructions but in 8086 microprocessor it is not mandatory to have an accumulator as the destination operand. Example: -

-
-
ADD AX, AX ;(AX = AX + AX)
-
-
- -

-BX: This is the base register. It is of 16 bits and is divided into two 8-bit registers BH and BL to also perform 8-bit instructions. It is used to store the value of the offset. Example: -

-
-
MOV BL, [500] ;(BL = 500H)
-
-
- -

-CX: This is the counter register. It is of 16 bits and is divided into two 8-bit registers CH and CL to also perform 8-bit instructions. It is used in looping and rotation. Example: -

-
-
MOV CX, 0005
-LOOP
-
-
- -

-DX: This is the data register. It is of 16 bits and is divided into two 8-bit registers DH and DL to also perform 8-bit instructions. It is used in the multiplication and input/output port addressing. Example: -

-
-
MUL BX (DX, AX = AX * BX)
-
-
-
-
-
-
-

Addressing and registers…again

-
-
-
-

I realized what I wrote here before was almost gibberish, sooo here we go again I guess ?

-
-

-Well lets take a step back to the notion of effective addresses VS relative ones. -

-
-
-
-

Effective = 10h x Segment + Offset . Part1

-
-

-When trying to access a specific memory space, we use this annotation [Segment:Offset], so for example, and assuming DS = 0100h. We want to write the value 0x0005 to the memory space defined by the physical address 1234h, what do we do ? -

-
-
    -
  • Answer :
    -
    -
    -
    MOV [DS:0234h], 0x0005
    -
    -
    - -

    -Why ? Let’s break it down : -

    - - - -
    -

    lain-dance.gif -

    -
    - - -

    -We Already know that Effective = 10h x Segment + Offset, So here we have : 1234h = 10h x DS + Offset, we already know that DS = 0100h, we end up with this simple equation 1234h = 1000h + Offset, therefor the Offset is 0234h -

    - - -

    -Simple, right ?, now for another example -

    -
    -
  • -
-
-
-

Another example :

-
-

-What if we now have this instruction ? -

-
-
    MOV [0234h], 0x0005
-
-
-

-What does it do ? You might or might not be surprised that it does the exact same thing as the other snipped of code, why though ? Because apparently and for some odd reason I don’t know, the compiler Implicitly assumes that the segment used is the DS one. So if you don’t specify a register( we will get to this later ), or a segment. Then the offset is considered an offset with a DS segment. -

-
-
-
-

Segment + Register <3

-
-

-Consider DS = 0100h and BX = BP = 0234h and this code snippet: -

-
-
    MOV [BX], 0x0005 ; NOTE : ITS NOT THE SAME AS MOV BX, 0x0005. Refer to earlier paragraphs
-
-
- - -

-Well you guessed it right, it also does the same thing, but now consider this : -

-
-
    MOV [BP], 0x0005
-
-
- -

-If you answered that its the same one, you are wrong. And this is because the segment used changes according to the offset as I said before in an implicit way. Here is the explicit equivalent of the two commands above: -

-
-
    MOV [DS:BX], 0x0005
-    MOV [SS:BP], 0x0005
-
-
- -

-The General rule of thumb is as follows : -

-
    -
  • If the offset is : DI SI or BX, the Segment used is DS.
  • -
  • If its BP or SP, then the segment is SS.
  • -
-
-
    -
  • Note
    -
    -

    -The values of the registers CS DS and SS are automatically initialized by the OS when launching the program. So these segments are implicit. AKA : If we want to access a specific data in memory, we just need to specify its offset. Also you can’t write directly into the DS or CS segment registers, so something like -

    -
    -
    MOV DS, 0x0005 ; Is INVALID
    -MOV DS, AX ; This one is VALID
    -
    -
    -
    -
  • -
-
-
-
-
-

The ACTUAL thing :

-
-

-Enough technical rambling, and now we shall go to the fun part, the ACTUAL CODE. But first, some names you should be familiar with : -

- -
    -
  • Mnemonics : Or Instructions, are the…well…Instructions executed by the CPU like MOV , ADD, MUL…etc, they are case insensitive but i like them better in UPPERCASE.
  • -
  • Operands : These are the options passed to the instructions, like MOV dst, src, and they can be anything from a memory location, to a variable to an immediate address.
  • -
-
-
-

Structure of an assembly program :

-
-

-While there is no “standard” structure, i prefer to go with this one : -

- -
-
    org 100h
-.data
-                                ; variables and constants
-
-.code
-                                ; instructions
-
-
-
-
-
-

MOV dst, src

-
-

-The MOV instruction copies the Second operand (src) to the First operand (dst)… The source can be a memory location, an immediate value, a general-purpose register (AX BX CX DX). As for the Destination, it can be a general-purpose register or a memory location. -

- - -

-these types of operands are supported: -

-
-
MOV REG, memory
-MOV memory, REG
-MOV REG, REG
-MOV memory, immediate
-MOV REG, immediate
-
-
-

-REG: AX, BX, CX, DX, AH, AL, BL, BH, CH, CL, DH, DL, DI, SI, BP, SP. -

- -

-memory: [BX], [BX+SI+7], variable -

- -

-immediate: 5, -24, 3Fh, 10001101b -

- - -

-for segment registers only these types of MOV are supported: -

-
-
MOV SREG, memory
-MOV memory, SREG
-MOV REG, SREG
-MOV SREG, REG
-SREG: DS, ES, SS, and only as second operand: CS.
-
-
-

-REG: AX, BX, CX, DX, AH, AL, BL, BH, CH, CL, DH, DL, DI, SI, BP, SP. -

- -

-memory: [BX], [BX+SI+7], variable -

-
-
-

Note : The MOV instruction cannot be used to set the value of the CS and IP registers

-
-
-
-

Variables :

-
-

-Let’s say you want to use a specific value multiple times in your code, do you prefer to call it using something like var1 or E4F9:0011 ? If your answer is the second option, you can gladly skip this section, or even better, seek therapy. -

- -

-Anyways, we have two types of variables, bytes and words(which are two bytes), and to define a variable, we use the following syntax -

- -
-
name DB value ; To Define a Byte
-name DW value ; To Define a Word
-
-
- -

-name - can be any letter or digit combination, though it should start with a letter. It’s possible to declare unnamed variables by not specifying the name (this variable will have an address but no name). -value - can be any numeric value in any supported numbering system (hexadecimal, binary, or decimal), or “?” symbol for variables that are not initialized. -

-
-
-

Example code :

-
-
-
    org 100h
-    .data
-    x db 33
-    y dw 1350h
-
-    .code
-    MOV AL, x
-    MOV BX, y
-
-
-
-
-
-

Arrays :

-
-

-We can also define Arrays instead of single values using comma separated vaues. like this for example -

-
-
    a db 48h, 65h, 6Ch, 6Fh, 00H
-    b db 'Hello', 0
-
-
- -

-Surprise Surprise, the arrays a and b are identical, the reason behind it is that characters are first converted to their ASCII values then stored in memory!!! Wonderful right ? And guess what, accessing values in assembly IS THE SAME AS IN C !!! -

-
-
    MOV AL, a[0] ; Copies 48h to AL
-    MOV BL, b[0] ; Also Copies 48h to BL
-
-
-

-You can also use any of the memory index registers BX, SI, DI, BP, for example: -

-
-
MOV SI, 3
-MOV AL, a[SI]
-
-
- -

-If you need to declare a large array you can use DUP operator. -The syntax for DUP: -

- -

-number DUP ( value(s) ) -number - number of duplicate to make (any constant value). -value - expression that DUP will duplicate. -

- -

-for example: -

-
-
c DB 5 DUP(9)
-;is an alternative way of declaring:
-c DB 9, 9, 9, 9, 9
-
-
-

-one more example: -

-
-
d DB 5 DUP(1, 2)
-;is an alternative way of declaring:
-d DB 1, 2, 1, 2, 1, 2, 1, 2, 1, 2
-
-
-

-Of course, you can use DW instead of DB if it’s required to keep values larger then 255, or smaller then -128. DW cannot be used to declare strings. -

-
-
-
-

LEA

-
-

-LEA stands for (Load Effective Address) is an instruction used to get the offset of a specific variable. We will see later how its used, but first. here is something we will need : -

- -

-In order to tell the compiler about data type, -these prefixes should be used: -

- -

-BYTE PTR - for byte. -WORD PTR - for word (two bytes). -

- -

-For example: -BYTE PTR [BX] ; byte access. - or -WORD PTR [BX] ; word access. -assembler supports shorter prefixes as well: -

- -
    -
  • b. - for BYTE PTR
  • -
  • w. - for WORD PTR
  • -
- -

-in certain cases the assembler can calculate the data type automatically. -

-
-
    -
  • Example :
    -
    -
    -
        org 100h
    -    .data
    -    VAR1 db 50h
    -    VAR2 dw 1234h
    -    .code
    -    MOV AL, VAR1 ; We check the value of VAR1 by putting it in AL
    -    MOV AX, VAR2 ; Same here
    -    LEA BX, VAR1 ; BX receives the Address of VAR1
    -    MOV b.[BX], 44h
    -    MOV AL, VAR1 ; We effectively changed the content of the VAR1 variable
    -    LEA BX, VAR2
    -    MOV w.[BX], 5678h
    -    MOV AX, VAR2
    -
    -
    -
    -
  • -
-
-
-

Constants :

-
-

-Constants in Assembly only exist until the code is assembled, meaning that if you disassemble your code later, you wont see your constant definitions. -

- -

-Defining constants is pretty straight forward : -

-
-
    name EQU value
-
-
- -

-Of course constants cant be changed, and aren’t stored in memory. So they are like little macros that live in your code. -

-
-
-
-
-

⚐ :

-
-

-Now comes the notion of Flags, which are bits in the Status register, which are used for logical and arithmetical instructions and can take a value of 1 or 0 . Here are the 8 flags that exist for the 8086 CPU : -

-
    -
  • Carry Flag(CF): Set to 1 when there is an unsigned overflow, for example when you add 255 + 1( not in range [0,255] ). by default its set to 0.
  • -
  • Overflow Flag(CF): Set to 1 when there is a signed overflow, for example when you add 100 + 50( not in range [-128, 128[ ). by default its set to 0.
  • -
  • Zero Flag(ZF): Set to 1 when the result is 0. by default its set to 0.
  • -
  • Auxiliary Flag(AF): Set to 1 when there is an unsigned overflow for low nibble (4bits), or in human words : when there is a carry inside the number. for example when you add 29H + 4CH , 9 + C => 15. So we carry the 1 to 2 + 4 and AF is set to 1.
  • -
  • Parity Flag(PF): Set to 1 when the result has an even number of one bits. and 0 if it has an odd number of one bits. Even if a result is a word, only the Low 8bits are analyzed.
  • -
  • Sign Flag(SF): Self explanatory, set to 1 if the result is negative and 0 if its positive.
  • -
  • Interrupt Enable Flag(IF): When its set to 1, the CPU reacts to interrupts from external devices.
  • -
  • Direction Flag(DF): When this flag is set to 0, the processing is done forward, if its set to 1, its done backward.
  • -
-
-
-
-
-
-

Author: Crystal

-

Created: 2024-04-10 Wed 21:05

-
- - diff --git a/blog/c/cherry.html b/blog/c/cherry.html deleted file mode 100644 index e2d9221..0000000 --- a/blog/c/cherry.html +++ /dev/null @@ -1,171 +0,0 @@ - - - - - - - -Reviving Caesar with a Cherry-flavored Crystal - - - - - - - -
- UP - | - HOME -
-

Reviving Caesar with a Cherry-flavored Crystal

-
-

What ?…

-
-

-That is probably your reaction reading this title, and no, this isn’t a randomly generated sentence, but rather a simple encryption algorithm I recently made (Actually the first encryption algorithm i make at all!!). Meet Cherry-Crystal Encryption. -

-
-
-
-

Okay so, what is this all about ?

-
-

-This encryption Algorithm that we will call CCE for short, takes inspiration from the Caesar cipher which needn’t an introduction (you can find great explanations online). But what about mine you might ask ? -

- - -
    -
  • It’s actually pretty simple. We start with a Cherry or a Visible phrase, or a Decoy, that we will share to people who we don’t want to know the secret phrase..
  • -
  • Then we ask the user to enter their Crystal, invisible phrase or secret.
  • -
  • The program then outputs an array of Integers called the Mask, or the Shift. That is, the shift required to go from cherryi to crystali.
  • -
  • Finally, we use both the Cherry and Mask to get the Crystal, a single missing number or letter from both of them can and will output rubbish content.
  • -
-
-
-
-

The Code :

-
-
-
#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-
-void sloth(char cherry[], char crystal[], int mask[]) {
-  int i;
-  for (i = 0; i < strlen(cherry) - 1; i++) {
-    mask[i] = cherry[i] - crystal[i];
-  }
-  for (i = strlen(cherry) - 1; i < strlen(crystal) - 1; i++) {
-    mask[i] = crystal[i];
-  }
-}
-void moon(char cherry[], char crystal[], int mask[], int length) {
-  int i, end = 1;
-  for (i = 0; i < length; i++) {
-    if (i == strlen(cherry) - 1 || end == 0) {
-      crystal[i] = mask[i];
-      end = 0;
-    } else {
-      crystal[i] = cherry[i] - mask[i];
-    }
-  }
-}
-int main(int argc, char *argv[]) {
-  const int size = 1028;
-  char cherry[size], cherry2[size], crystal[size], crystal2[size];
-  int mask[size], mask2[size], i;
-  int length = 0;
-  puts("Enter the Cherry: ");
-  fgets(cherry, size, stdin);
-  puts("Enter the Crystal: ");
-  fgets(crystal, size, stdin);
-  sloth(cherry, crystal, mask);
-  for (i = 0; i < strlen(crystal) - 1; i++) {
-    printf("%d ", mask[i]);
-    length++;
-  }
-  printf("\nYour mask is : %d characters long", length);
-  puts("\n===Decryption: ===\n");
-  puts("Enter the Cherry: ");
-  fgets(cherry2, size, stdin);
-  puts("Enter the size of the Mask: ");
-  scanf("%d", &length);
-  puts("Enter the mask: ");
-  for (i = 0; i < length; i++) {
-    scanf("%d", &mask2[i]);
-  }
-  puts("The Crystal is: ");
-  moon(cherry2, crystal2, mask2, length);
-  puts(crystal2);
-  return 0;
-}
-
-
-
- -

-The program has been tested both on Alpine OS with Musl libc (thanks Kin) and on OpenBSD 7.5-current. In the close future I will make a git repo as i’m planning to upgrade it and just make it better overall, who knows, maybe i will make a library out of it!! -

-
-
-
-

How does it work ?

-
-
-
-

Slothing (Encrypting) 🦥:

-
-

-What is it with these names I pick ? Anyways, the sloth(char *cherry, char *crystal, int *mask) void function takes as parameters three variables: -

- -
    -
  • A pointer to a char array or simply said a string, It’s the Cherry.
  • -
  • Another pointer to the Crystal.
  • -
  • And Finally, a pointer to an array of integers The Mask which will be output-ed by the function.
  • -
- - -

-The general idea of it is like this : (we will use a quick example) -

- -
    -
  • Cherry: H e l l o \0.
  • -
  • Crystal: W o r l d \0.
  • -
  • Cherry[0] here is H, or in ASCII 72. And Crystal[0] is W or 87.
  • -
  • Mask[0] in this case is : Cherry[0] - Crystal[0]. which is -15. We then repeat the same steps for each letter on the Crystal.
  • -
- -

-Why the emphasis on Crystal ? Because we might end up with a case of a Crystal larger than a Cherry. we set the offset to the ASCII value of Crystal[i], okay which to be fair is not the safest option out there, but I’m planning on fixing it sooner or later. In the case of a large Cherry but a small Crystal…it works but now looking at the code, i have no idea why it works the intended way…. -

-
-
-
-

Mooning (Decrypting) 🌕:

-
-

-The function moon(char *cherry, char *crystal, int *mask, int length) works the same way as the sloth function, but in reverse and a small change. -

- -
    -
  • The for loop goes through all the elements of the Mask and reconstructing the Crystal using the reverse equation of the encryption. But when it arrives at the end of the Cherry (here we enter the case of a Cherry smaller than a Crystal). Then we will just assume that Mask[i] is the ASCII code of Crystal[i], and we continue this assumption until the end of the loop.
  • -
- - -

-And voila that’s it. Of course there might be some things I will change, but the overall concept is here! -

-
-
-
-
-
-

Author: Crystal & Sloth

-

Created: 2024-03-17 Sun 21:46

-
- - diff --git a/blog/c/game.html b/blog/c/game.html deleted file mode 100644 index 90c1965..0000000 --- a/blog/c/game.html +++ /dev/null @@ -1,346 +0,0 @@ - - - - - - - -The loneliness Game - - - - - - - -
- UP - | - HOME -
-

The loneliness Game

-

-Hello !!, I hope you are doing great you amazing person whoever you are, and I really appreciate you reading my little C programming adventure. Soo basically I wanted to blog about a little game I made when bored, and figured out it would be a great way to optimize it, and learn new stuff too by documenting the process! -

-
-

The concept :

-
-

-Basically the player is faced with a NxM field made up with the sign “-” and the player is denoted by the symbol “+”, there are also Bonuses “B” which add 1 to your score, Traps “T”, that remove one from your score, and Dead “D” which resets the score to 0. I will go into more of the specifics later but for now this is how it works, and the controls are Basic WASD bindings, though i may go for a HJKL style later. -

-
-
-
-

The code :

-
-
-
  1: #include <stdio.h>
-  2: #include <stdlib.h>
-  3: int main(int argc, char *argv[]) {
-  4:     char input,map[5][5] = {
-  5:         {'-', '-', '-', '-', '-'},
-  6:         {'-', '-', '-', '-', '-'},
-  7:         {'-', '-', '-', '-', '-'},
-  8:         {'-', '-', '-', '-', '-'},
-  9:         {'-', '-', '-', '-', '-'}
- 10:     };
- 11:     int stop=0,i=0,moves=0,score=0,pos[2] = {2, 2};
- 12:     int bonus[2];
- 13:     int trap[2] ;
- 14:     int death[2];
- 15:     map[pos[0]][pos[1]] = '+';
- 16:     do{
- 17:     bonus[0] = arc4random_uniform(5); bonus[1] = arc4random_uniform(5);
- 18:     trap[0] = arc4random_uniform(5); trap[1] = arc4random_uniform(5);
- 19:     death[0] = arc4random_uniform(5); death[1] = arc4random_uniform(5);
- 20:     }while((bonus[0] == trap[0] && bonus[1] == trap[1]) || (bonus[0] == death[0] && bonus[1] == death[1]) || (trap[0] == death[0] && trap[1] == death[1]) || (bonus[0] == pos[0] && bonus[1] == pos[1]) || (trap[0] == pos[0] && trap[1] == pos[1]) || (death[0] == pos[0] && death[1] == pos[1]));
- 21:     map[bonus[0]][bonus[1]] = 'B';
- 22:     map[trap[0]][trap[1]] = 'T';
- 23:     map[death[0]][death[1]] = 'D';
- 24:     do{
- 25:     printf("Map:\n");
- 26:     for (int i = 0; i < 5; i++) {
- 27:         for (int j = 0; j < 5; j++) {
- 28:             printf("%c ", map[i][j]);
- 29:         }
- 30:         printf("\n");
- 31:     }
- 32:     printf("Score: %d\n", score);
- 33:     printf("Moves: %d\n", moves);
- 34:     printf("Enter a direction (w,a,s,d) or c to quit: ");
- 35:     scanf(" %c", &input);
- 36: // pos[0] updown pos[1] lr
- 37:     if (input == 'w') {
- 38:         printf("Moving up\n");
- 39:         map[pos[0]][pos[1]] = '-';
- 40:         if (pos[0] == 0) {
- 41:             pos[0] = 4;
- 42:         }
- 43:         else {
- 44:             pos[0]--;
- 45:         }
- 46:     } else if (input == 'a') {
- 47:         printf("Moving left\n");
- 48:         map[pos[0]][pos[1]] = '-';
- 49:         if (pos[1] == 0) {
- 50:             pos[1] = 4;
- 51:         }
- 52:         else {
- 53:             pos[1]--;
- 54:         }
- 55:     } else if (input == 's') {
- 56: 
- 57:         printf("Moving down\n");
- 58:         map[pos[0]][pos[1]] = '-';
- 59:         if (pos[0] == 4) {
- 60:             pos[0] = 0;
- 61:         }
- 62:         else {
- 63:             pos[0]++;
- 64:         }
- 65:     } else if (input == 'd') {
- 66:         printf("Moving right\n");
- 67:         map[pos[0]][pos[1]] = '-';
- 68:         if (pos[1] == 4) {
- 69:             pos[1] = 0;
- 70:         }
- 71:         else {
- 72:             pos[1]++;
- 73:         }
- 74:     } else if (input == 'c') {
- 75:         printf("Quitting\n");
- 76:     } else {
- 77:         printf("Invalid input\n");
- 78:     }
- 79:     map[pos[0]][pos[1]] = '+';
- 80:     if (pos[0] == bonus[0] && pos[1] == bonus[1]) {
- 81:         score++;
- 82:         do{
- 83:         bonus[0]= arc4random_uniform(5);
- 84:         bonus[1]= arc4random_uniform(5);
- 85:         }while((bonus[0] == trap[0] && bonus[1] == trap[1]) || (bonus[0] == death[0] && bonus[1] == death[1]) || (bonus[0] == pos[0] && bonus[1] == pos[1]));
- 86:     }
- 87:     if (pos[0] == trap[0] && pos[1] == trap[1]) {
- 88:         score--;
- 89:         do{
- 90:         trap[0]= arc4random_uniform(5);
- 91:         trap[1]= arc4random_uniform(5);
- 92:         }while((trap[0] == bonus[0] && trap[1] == bonus[1]) || (trap[0] == death[0] && trap[1] == death[1]) || (trap[0] == pos[0] && trap[1] == pos[1]));
- 93:         }
- 94:     if (pos[0] == death[0] && pos[1] == death[1]) {
- 95:         score = 0;
- 96:         do{
- 97:         death[0]= arc4random_uniform(5);
- 98:         death[1]= arc4random_uniform(5);
- 99:         }while((death[0] == bonus[0] && death[1] == bonus[1]) || (death[0] == trap[0] && death[1] == trap[1]) || (death[0] == pos[0] && death[1] == pos[1]));
-100:     }
-101:     if (score % 3 == 0 && score != 0 && stop == 0) {
-102:         map[death[0]][death[1]] = '-';
-103:         do{
-104:         death[0]= arc4random_uniform(5);
-105:         death[1]= arc4random_uniform(5);
-106:         }while((death[0] == bonus[0] && death[1] == bonus[1]) || (death[0] == trap[0] && death[1] == trap[1]) || (death[0] == pos[0] && death[1] == pos[1]));
-107:         stop = 1;
-108:     }
-109:     else if (score % 3 != 0) {
-110:     stop = 0;
-111:     }
-112:     if (moves % 5 == 0 && moves != 0) {
-113:         do{
-114:             map[trap[0]][trap[1]] = '-';
-115:         trap[0]= arc4random_uniform(5);
-116:         trap[1]= arc4random_uniform(5);
-117:         }while((trap[0] == bonus[0] && trap[1] == bonus[1]) || (trap[0] == death[0] && trap[1] == death[1]) || (trap[0] == pos[0] && trap[1] == pos[1]));
-118: 
-119:     }
-120:     map[bonus[0]][bonus[1]] = 'B';
-121:     map[trap[0]][trap[1]] = 'T';
-122:     map[death[0]][death[1]] = 'D';
-123:     moves++;
-124:     }while(input != 'c');
-125:     return 0;
-126: }
-127: 
-
-
- - -

-Let’s go step by step and see what we can fix or improve, to start off, line 4 to 10 can be reduced to 7 or 8 lines (which will be beneficial later too) -

-
-
 4: int n=5,m=5;
- 5: char input,map[50][50];
- 6:     for (int i = 0; i < n; i++) {
- 7:         for (int j = 0; j < m; j++) {
- 8:             map[i][j] = '-';
- 9:         }
-10:     }
-11: 
-
-
- -

-For now at least, n and m are hardcoded to 5, but this will change later. And I picked 50x50 as a max size because why not -

- -

-Of course we have the usual inits on line 11, though since we are using variables instead of hardcoding 5, we will have to find the center by ourselves -

-
-
11:     int stop=0,i=0,moves=0,score=0,pos[2] = {n/2,m/2};
-
-
- -

-This is getting better, of course we then initialize the coordinates of bonus, trap, and death, and set the player as a ’+’ in the field. -

- - -

-Here comes the line 17-21, where it generates a random coordinate for the aforementioned pickups, and do that until there is no conflict between eachother and the player) here we will need to change it a tiny bit. -

-
-
17:     bonus[0] = arc4random_uniform(n); bonus[1] = arc4random_uniform(m);
-18:     trap[0] = arc4random_uniform(n); trap[1] = arc4random_uniform(m);
-19:     death[0] = arc4random_uniform(n); death[1] = arc4random_uniform(m);
-
-
- -

-Looking good so far!!, We then have line 21-23 which also shows the pickups as their respective symbols in the map. -

- - -

-The main interactive program starts here, which will learn at least one time and stop if the received input is a ’c’, it starts with a nested for loop on line 26 up to 31 to show the content of the map, nothing fancy, just some matrix stuff. we need to change the 5 though! -

-
-
26:   for (int i = 0; i < n; i++) {
-27:         for (int j = 0; j < m; j++) {
-28:             printf("%c ", map[i][j]);
-29:         }
-30:         printf("\n");
-31:     }
-32: 
-
-
-

-We show the score and the moves too, which at the start of the game are set to 0. and we prompt the user for a direction. Note here the space before the %c, this basically allows for the program to not choke on newlines and also even if the user writes multiple keys at the same time, they will still be done, like ww will make the player move twice up. -

- -

-After that we have some logic which should also be changed to account for the n and m changes yet again -

-
-
37:     if (input == 'w') {
-38:         printf("Moving up\n");
-39:         map[pos[0]][pos[1]] = '-';
-40:         if (pos[0] == 0) {
-41:             pos[0] = n-1;
-42:         }
-43:         else {
-44:             pos[0]--;
-45:         }
-46:     } else if (input == 'a') {
-47:         printf("Moving left\n");
-48:         map[pos[0]][pos[1]] = '-';
-49:         if (pos[1] == 0) {
-50:             pos[1] = m-1;
-51:         }
-52:         else {
-53:             pos[1]--;
-54:         }
-55:     } else if (input == 's') {
-56: 
-57:         printf("Moving down\n");
-58:         map[pos[0]][pos[1]] = '-';
-59:         if (pos[0] == n-1) {
-60:             pos[0] = 0;
-61:         }
-62:         else {
-63:             pos[0]++;
-64:         }
-65:     } else if (input == 'd') {
-66:         printf("Moving right\n");
-67:         map[pos[0]][pos[1]] = '-';
-68:         if (pos[1] == m-1) {
-69:             pos[1] = 0;
-70:         }
-71:         else {
-72:             pos[1]++;
-73:         }
-74:     } else if (input == 'c') {
-75:         printf("Quitting\n");
-76:     } else {
-77:         printf("Invalid input\n");
-78:     }
-
-
- -

-What this achieves is the “teleportation effect” whenever you are at the border of the screen! -

- - -

-Now we fix things from line 80 to the end of the program, aka replacing ever occurrence of 5 with n or m -

-
-
 80:     if (pos[0] == bonus[0] && pos[1] == bonus[1]) {
- 81:         score++;
- 82:         do{
- 83:         bonus[0]= arc4random_uniform(n);
- 84:         bonus[1]= arc4random_uniform(m);
- 85:         }while((bonus[0] == trap[0] && bonus[1] == trap[1]) || (bonus[0] == death[0] && bonus[1] == death[1]) || (bonus[0] == pos[0] && bonus[1] == pos[1]));
- 86:     }
- 87:     if (pos[0] == trap[0] && pos[1] == trap[1]) {
- 88:         score--;
- 89:         do{
- 90:         trap[0]= arc4random_uniform(n);
- 91:         trap[1]= arc4random_uniform(m);
- 92:         }while((trap[0] == bonus[0] && trap[1] == bonus[1]) || (trap[0] == death[0] && trap[1] == death[1]) || (trap[0] == pos[0] && trap[1] == pos[1]));
- 93:         }
- 94:     if (pos[0] == death[0] && pos[1] == death[1]) {
- 95:         score = 0;
- 96:         do{
- 97:         death[0]= arc4random_uniform(n);
- 98:         death[1]= arc4random_uniform(m);
- 99:         }while((death[0] == bonus[0] && death[1] == bonus[1]) || (death[0] == trap[0] && death[1] == trap[1]) || (death[0] == pos[0] && death[1] == pos[1]));
-100:     }
-101:     if (score % 3 == 0 && score != 0 && stop == 0) {
-102:         map[death[0]][death[1]] = '-';
-103:         do{
-104:         death[0]= arc4random_uniform(n);
-105:         death[1]= arc4random_uniform(m);
-106:         }while((death[0] == bonus[0] && death[1] == bonus[1]) || (death[0] == trap[0] && death[1] == trap[1]) || (death[0] == pos[0] && death[1] == pos[1]));
-107:         stop = 1;
-108:     }
-109:     else if (score % 3 != 0) {
-110:     stop = 0;
-111:     }
-112:     if (moves % 5 == 0 && moves != 0) {
-113:         do{
-114:             map[trap[0]][trap[1]] = '-';
-115:         trap[0]= arc4random_uniform(n);
-116:         trap[1]= arc4random_uniform(m);
-117:         }while((trap[0] == bonus[0] && trap[1] == bonus[1]) || (trap[0] == death[0] && trap[1] == death[1]) || (trap[0] == pos[0] && trap[1] == pos[1]));
-118: 
-119:     }
-
-
- - -

-Aaaaand this should be it -

-
-
-
-
-

Author: Crystal

-

Created: 2024-02-22 Thu 19:09

-
- - diff --git a/blog/lisp/episode1.html b/blog/lisp/episode1.html deleted file mode 100644 index 72c5b97..0000000 --- a/blog/lisp/episode1.html +++ /dev/null @@ -1,29 +0,0 @@ - - - - - - - -Learn Lisp With me. Episode 1 - - - - - - - -
- UP - | - HOME -
-

Learn Lisp With me. Episode 1

-
-
-

Author: Crystal

-

Created: 2023-12-17 Sun 19:04

-
- - diff --git a/blog/misc/merlin.html b/blog/misc/merlin.html deleted file mode 100644 index ec7f975..0000000 --- a/blog/misc/merlin.html +++ /dev/null @@ -1,191 +0,0 @@ - - - - - - - -ON MERLIN'S BEARD - - - - - - - -
- UP - | - HOME -
-

ON MERLIN’S BEARD

-

-Let’s say, hypothetically, you have a Xiaomi Redmi Note 9 (codenamed Merlin), and we would assume that it’s broken in a way that it shows the Xiaomi logo only then reboots/shuts-down, your first solution would be “Oh let’s take it to a repairshop, they would fix it” but why do so when you could fix it at home, alone, with the help of this little guide. -

-
-

Axioms :

-
-

-We will assume the following things : -

-
    -
  • You have a Redmi Note 9…or any Redmi, but some steps WILL vary ever so slightly.
  • -
  • The phone at least gives a sign of life, the Xiaomi logo is well enough.
  • -
  • You have a PC, preferably running the second best OS known to mankind, Linux !!!. If you are not running Linux, a good start is Ubuntu (we will assume the usage of a Debian-based distro here, if you use anything other than them, you are probably smart enough to figure this shit yourself)
  • -
  • You have a good USB-C cable.
  • -
  • You have a working brain.
  • -
-
-
-
-

Step Uno : Downloading the required files and the medkits :

-
-
-
-

android-tools :

-
-
-
sudo apt update
-sudo apt install android-tools-adb android-tools-fastboot
-
-
-
-
-
-

mtkclient and it’s dependencies :

-
-
-
-

Dependencies :

-
-
-
sudo apt install python3 git libusb-1.0-0 python3-pip
-
-
-
-
-
-

Grab the files :

-
-
-
git clone https://github.com/bkerler/mtkclient
-cd mtkclient
-pip3 install .
-
-
-
-
-
-

Install rules :

-
-
-
sudo usermod -a -G plugdev $USER
-sudo usermod -a -G dialout $USER
-sudo cp mtkclient/Setup/Linux/*.rules /etc/udev/rules.d
-sudo udevadm control -R
-
-
-

-and do NOT forget to reboot, otherwise you will face errors. -

-
-
-
-
-

Fastboot image :

-
-

-Personally, I prefer to use a custom ROM for these XIMI phones, but since this is a fool-proof guide, we will use the latest Global fastboot image, note that the difference between Global , EEA (European Economic Area) , Turkish , Russian and Taiwan ROMS are little though the Global version is most of the time behind the other ones in terms of updates , but the biggest one comes with the Chinese one, it’s more polished, runs faster, but is filled with Chinese-only apps, and does not have Google services (which is a huge W for me). But at the end of the day, it’s up to you! -

- -

-We will be using this one https://xiaomifirmwareupdater.com/miui/merlin/stable/V13.0.2.0.SJOMIXM/ which is the Global version of miui. Make sure to scroll all the way Down and download the one with Type: Fastboot, it will be larger in size, but it’s the one we need. Use any mirror that you want, and wait patiently for it to download. Once it finishes, extract it to a folder, it’s a big archive so it will take time. -

-
-
-
-

Meanwhile, mtkclient :

-
-

-While waiting for your download to finish, go to your mtkclient folder and run this command: -

-
-
python mtk_gui
-
-
-

-this should bring up the GUI client, if it doesn’t, replace python with python3. Once it’s running, make sure your phone is powered-off, and plug the USB-C cable into your PC While holding both the Up and Down volume buttons until you see a change in the GUI app. If you notice a red error message on the console which will be running in the background, relaunch using sudo. -

- -

-Now explore the app but do NOT touch anything with the word Write or Erase, also the ones with Read are useless for you, what is important is looking for the Unlock bootloader button, click on it, and wait until it’s okay, then remove your phone from the cable. aaaand we shoould be done for this part. -

-
-
-
-

The Fun Part :

-
-

-Once the fastboot image is downloaded and extracted, go to the folder and look for this file flash_all_except_storage.sh this will be the one you would need. -

- -

-DO NOT EVER EVER EVER, UNDER ANY CASE, TOUCH A FILE THAT HAS THE WORD LOCK IN IT. -

- -

-Once you located this file, open a terminal there, and give it exec permissions. Or in other words : -

-
-
chmod +x ./flash_all_except_storage.sh
-
-
-

-and now take your phone again and now Power it on while holding the Vol DOWN button, keep that position until you see a fastboot screen, or a Russian robot rewiring the organs of it’s victim. -

- -

-Once you see it, plug the phone to the pc, and run -

-
-
sudo fastboot devices
-
-
-

-sudo might not be needed for you, but i dont know why, it never worked for me without sudo (probably the rules step) -

- -

-Once you see your device in there, it means it recognized it, go again to the folder with flash_all_except_storage and run it -

-
-
sudo ./flash_all_except_storage.sh
-
-
-
-
-
-

Waiting :

-
-

-This step takes a lot of time, so be sure to let your pc in a place where you don’t risk accidentally moving your phone and disconnecting it. DO NOT CLOSE THE TERMINAL, once it’s finished, it should reboot automatically and voila !! good as knew, and you might even keep your local files if you provide your password -

-
-
-
-
-

Edge cases :

-
-
    -
  • If the initial setup (after the reboot) doesn’t work, try the flash_all.sh file instead.
  • -
-
-
-
-
-

Author: Crystal for my sloth

-

Created: 2024-04-12 Fri 19:51

-
- - diff --git a/index.html b/index.html deleted file mode 100755 index cb45c72..0000000 --- a/index.html +++ /dev/null @@ -1,209 +0,0 @@ - - - - - - - -Crystal's Website 💜 - - - - - - - -
-

Crystal’s Website 💜

-
-

Welcome to the wired

-
-

-Hi there, adorable you! -

- -

-And welcome to my little corner of the internet, here I will be posting my random thoughts, some class notes, random articles, funny links…etc. Basically a way for me to play around with HTML and CSS. -

- - -

-Note: This web page is designed to be viewed even without JavaScript, the only place where I use JS is in the webring page (If I use them elsewhere, I will put a warning) -

- - - -
-

Lain_chibi.png -

-
-
-
-
-

Articles ( NEW !!!! )

-
- -
-
-
-

Blogs ( NEWER !!!! )

-
-
-
-

C programming :

-
- -
-
-
-

x86 ASM Programming:

- -
-
-
-

root@localhost $ whoami

-
-
-
-

About me :

-
-
    -
  • Name : Crystal
  • -
  • Age : 18 years old
  • -
  • Nationality : Algerian
  • -
  • Pronouns : *(Any)
  • -
  • Sexuality : Aro/Ace cis
  • -
  • Political affiliation : Anarchism
  • -
  • Hobbies : Include but not limited to programming, exploring new OSes, new music genres and making friends
  • -
-

-This might surprise you, but I also listen to music (A shocker, right?) though I mostly listen to vaporwave glitchore weirdcore synthwave and dreamcore -

- -

-If you want to contact me (which would be really surprising) contact me via mailto:crystaltrd@cumallover.me -

-
-
-
-

About my Navi :

-
-

-My current setup is : -

-
    -
  • Primary OS: OpenBSD -current
  • -
  • Text Editor: Doom Emacs
  • -
  • Web Browser: Ungoogled-chromium
  • -
  • Desktop Environment: NsCDE
  • -
  • Shell: Historic Ksh93
  • -
  • Secondary OS: Void Linux
  • -
  • Games I play: Hollow Knight, Cult of the lamb, Dead Cells & Rythm games(like Phigros and A dance of fire and ice)
  • -
-

-I also host this website on the https://tilde.institute pubNIX which also runs OpenBSD -

- - -

-This website is fully open-source with no licensing restrictions, check the source code and feel free to reuse everything!!! -

-
-
-
-
-

Sign my Guestbook (External website warning)

-
-

-Want to leave a message, opinion, review or a salty insult ? Be sure to Sign my Guestbook then, it takes two seconds but it will mean the world to me !!! -

- - -
-

sign_my_guestbook-anim.gif -

-
-
-
-
-

Blinkies

-
-Valid XHTML 1.0 Strict - - Valid CSS! - -

-nishiboats.jpg girlsnow.png cookiefree.gif transnow2.gif gaywebring.gif tranarchy.gif button-torrents.gif tyg.gif fuck-google.gif fuck_facebook.gif graphics_by_gimp.gif learn_html.gif leave-twitter.gifstop_microsoft.gif web-pi.png piracy.gif best_viewed_with_eyes.gif discord-no-way-2.gif roly-saynotoweb3.gif -myfaithrip.gif -wiredcollectivebutton.png -rz95_button.gif -blueos_button.gif -mafumafu.gif -winxp.gif -ihatems.gif -openbsdart.gif -win10no.gif -seedyourtorrents.gif -chrmevil.gif -3dot5mmfc-button.gif -iecrash.gif -gregdock.gif -sapphic-cafe-button.png -neotomic.gif -openbsd.png -partysepe.png -

-
-
-

My banner

-
-

-If you enjoyed my website, you could link me on your personal website using this banner. If you don’t want to, then no pressure 💜 I still love you and I hope that this small shrine of mine will impress you in the future!!! -

- - -
-

crystal-tilde.gif -

-
- -
-

lain_crystal_glitch.gif -

-
- -

-And others too are in this directory ./src/gifs/my_buttons/. All of them were made by https://julians-art.neocities.org Thanks a lot Julian !!!/ -

-
-
-
-
-

Close this website, txEn eht nepO.( Webrings , so expect JavaScript on this page)!!

-
-

-Geekring secret : 8e171c39-fb7c-465e-96df-bc110c9257f2 -

-
-
-
-
-

Author: Crystal

-

Created: 2024-04-15 Mon 19:35

-
- - diff --git a/links.html b/links.html deleted file mode 100755 index 98cce8a..0000000 --- a/links.html +++ /dev/null @@ -1,106 +0,0 @@ - - - - - - - -Close this website, txEn eht nepO.(JavaScript ahead) 💜 - - - - - - - -
- UP - | - HOME -
-
-

- - Close this website,
Open the nExt
.
-
-

-
-
-

Webrings & Links

-
-

-This site is a proud member of the geekring! Check some other geeky websites here!
-

- -

-Previous siteRandom SiteNext Site
-

- -

-Do you long for a simpler time, when America was Online and the only person you could Ask was Jeeves? Hotline Webring is bringing that time back, with Webrings! This website is part of the Hotline Webring
-

- -

-Previous siteNext site
-

- - - -
- - -
- -
- - -
- - - - - - -
-
-
-

Lainchan Webring

-
-

-Lainring is a decentralized webring created by the users of Lainchan, an anonymous image board. If you want to be added, go to the Lainchan thread and post your website there, together with a 240x60 button image.
-

- - -
... Loading, please wait ...
- -
-
-
-
-
-

Author: Crystal

-

Created: 2023-11-10 Fri 11:11

-
- - \ No newline at end of file diff --git a/src/org/class_notes.html b/src/org/class_notes.html new file mode 100644 index 0000000..4f7a736 --- /dev/null +++ b/src/org/class_notes.html @@ -0,0 +1,420 @@ + + + + + + + +Class notes + + + + + +
+

Class notes

+ + + +
+

1. class 1 sun sep 17 13:04:43 2023

+
+
+
+

1.1. Les Reseaux locaux (LAN)

+
+

+Cable 10 mbps ou moins = Ethernet +Cable 100 mbps = Fast Ethernet +Cable 1000 mbps ou plus = Giga Ethernet +

+
+
+ +
+

1.2. MAC Address :

+
+

+First three Bytes : vendor +Last three Bytes : Unique ID +(In Hexadecimal) +

+ +

+TODO: CSMA/ CA CD +

+
+
+ +
+

1.3. RJ-45 connecteurs

+
+
+
    +
  1. Straight
  2. +
  3. Crossover (croisé)
  4. +
  5. Rollover (console)
  6. +
+
+ +
+

1.4. IPV4 classes :

+
+
    +
  • Classe A : 0 - 127 /8 +
      +
    • 0.0.0.0/0 : route par default
    • +
    • 127.0.0.0/8 : bouclage
    • +
  • +
  • Classe B : 128 - 191 /16 +
      +
    • 169.254.0.0/16 : APIPA
    • +
  • +
  • Classe C : 192 - 223 /24
  • +
  • Classe D : 224 - 239 +
      +
    • Multicast
    • +
  • +
  • Classe E : 240 - 255
  • +
+
+
+ +
+

1.5. Adresses privées:

+
+
    +
  • Classe A : 10.0.0.0 - 10.255.255.255 /8
  • +
  • Classe B : 172.16.0.0 - 172.31.255.255 /12
  • +
  • Classe C : 192.168.0.0 - 192.168.255.255 /16
  • +
+ + +

+8 7 6 5 4 3 2 1 +128 64 32 16 8 4 2 1 +256 128 64 32 16 8 4 2 +/24 /25 /26 /27 /28 /29 /30 /31 +

+ +

+500 +150 +60 +30 +20 +15 +

+
+
+
+

1.6. 500 hosts :

+
+

+Addresse: 10.0.0.0 /23 +

+ +

+500 - 256 = 244 +

+ +

+First IP : 10.0.0.1 /23 +Last IP : 10.0.1.254 /23 +@B IP : 10.0.1.255 /23 +Mask : 255.255.254.0 +

+
+
+ +
+

1.7. 150 hosts :

+
+

+Addresse: 10.0.2.0 /24 +First IP: 10.0.2.1 /24 +Last IP: 10.0.2.254 /24 +@B IP: 10.0.2.255 /24 +Mask: 255.255.255.0 +

+
+
+ +
+

1.8. 60 hosts :

+
+

+Addresse: 10.0.3.0 /26 +First IP: 10.0.3.1 /26 +Last IP: 10.0.3.63 /26 +@B IP: 10.0.3.64 /26 +Mask: 255.255.255.191 +

+
+
+ +
+

1.9. 30 hosts:

+
+

+Addresse: 10.0.3.63/8 +First IP: 10.0.3.64/8 +Last IP: 10.0.3.96/8 +@B IP: 10.0.3.97/8 +Mask: 255.255.255.158/11 +

+
+
+ +
+

1.10. 20

+
+

+Addresse: 10.0.3.97/8 +First IP: 10.0.3.98/8 +Last IP: 10.0.3.128/8 +@B IP: 10.0.3.129/8 +Mask: 255.255.255.126/11 +

+
+
+
+

1.11. 15

+
+

+Addresse: 10.0.3.129/8 +First IP: 10.0.3.130/8 +Last IP: 10.0.3.144/8 +@B IP: 10.0.3.145/8 +Mask: 255.255.255.110/12 +

+
+
+
+ +
+

2. Class 2Sun Sep 24 09:09:28 2023

+
+
+
+

2.1. CCTV (finally)

+
+
+
+
+

Author: Crystal

+

Created: 2024-04-19 Fri 19:58

+

Validate

+
+ + diff --git a/src/org/export.sh b/src/org/export.sh new file mode 100755 index 0000000..a6ca475 --- /dev/null +++ b/src/org/export.sh @@ -0,0 +1,8 @@ +#!/usr/local/bin/bash + +# Set the directory to search (replace with your actual path) +TARGET_DIR="." + +# Function to process each .org file +# Find all .org files recursively +find "$TARGET_DIR" -type f -name "*.org" -exec emacs {} --batch -f org-html-export-to-html --kill \; diff --git a/super_secret.html b/super_secret.html deleted file mode 100755 index 1bc8695..0000000 --- a/super_secret.html +++ /dev/null @@ -1,38 +0,0 @@ - - - - - - - -SUPER SECRET WEBSITE - - - - - - -
-

SUPER SECRET WEBSITE

-
- - -
-

smurf.jpg -

-
-
- - - -
-
-

Author: Crystal

-

Created: 2023-09-10 Sun 19:11

-
- - \ No newline at end of file diff --git a/uni_notes/algebra.html b/uni_notes/algebra.html deleted file mode 100755 index 0e223c5..0000000 --- a/uni_notes/algebra.html +++ /dev/null @@ -1,1870 +0,0 @@ - - - - - - - -Algebra 1 - - - - - - - -
- UP - | - HOME -
-

Algebra 1

-
-

Table of Contents

-
- -
-
-
-

Contenu de la Matiére

-
-
-
-

Rappels et compléments (11H)

-
-
    -
  • Logique mathématique et méthodes du raisonnement mathématique
  • -
  • Ensembles et Relations
  • -
  • Applications
  • -
-
-
-
-

Structures Algébriques (11H)

-
-
    -
  • Groupes et morphisme de groupes
  • -
  • Anneaux et morphisme d’anneaux
  • -
  • Les corps
  • -
-
-
-
-

Polynômes et fractions rationnelles

-
-
    -
  • Notion du polynôme à une indéterminée á coefficients dans un anneau
  • -
  • Opérations Algébriques sur les polynômes
  • -
  • Arithmétique dans l’anneau des polynômes
  • -
  • Polynôme dérivé et formule de Taylor
  • -
  • Notion de racine d’un polynôme
  • -
  • Notion de Fraction rationelle á une indéterminée
  • -
  • Décomposition des fractions rationelles en éléments simples
  • -
-
-
-
-
-

Premier cours : Logique mathématique et méthodes du raisonnement mathématique Sep 25 :

-
-

-Let P Q and R be propositions which can either be True or False. And let’s also give the value 1 to each True proposition and 0 to each false one.
-

- -

-Ex:
-

-
    -
  • 5 ≥ 2 is a proposition, a correct one !!!
  • -
  • The webmaster is a girl is also a proposition, which is also correct.
  • -
  • x is always bigger than 5 is not a proposition, because we CAN’T determine if it’s correct or not as x changes.
  • -
-

-…etc
-

- -

-In order to avoid repetition, and rewriting the proposition over and over, we just assign a capital letter to them such as P Q or R.
-

- -

-So now we could write :
-Let the proposition P be 5 ≥ 2, we notice that P is always True, therefor its validity is 1
-

- -

-We also have the opposite of P, which is not(P) but for simplicity we use (A P with a bar on top, in case it doesn’t load for you), now let’s go back to the previous example:
-

- -

-Since we know that the proposition P is true, we can conclude that P̅ is false. As P and P̅ can NOT be true at the same time. It’s like saying 5 is greater and also lesser than 2…doesn’t make sense, does it ?
-

- -

-Now let’s say we have two propositions, and we want to test the validity of their disjunction….. Okay what is this “disjunction” ? Great Question Billy !!! A disjunction is true if either propositions are true
-

- -

-Ex:
-Let proposition P be “The webmaster is asleep”, and Q be “The reader loves pufferfishes”. The disjunction of these two propositions can have 4 different values showed in this Table of truth (such a badass name):
-

- - - - --- -- -- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
PQDisjunction
111
101
011
000
- -

-What the hell is this ?
-The first colomn is equivalent to saying : “The webmaster is asleep AND The reader loves pufferfishes”
-The second one means : “The webmaster is asleep AND The reader DOESN’T love pufferfishes (if you are in this case, then I HATE YOU)”
-The third one… zzzzzzz
-

- -

-You got the idea !!!
-And since we are talking about a disjunction here, one of the propositions need to be true in order for this disjunction to be true.
-

- -

-You may be wondering…. Crystal, can’t we write a disjunction in magical math symbols ? And to this I respond with a big YES. A disjunction is symbolized by a . So the disjunction between proposition P & Q can be written this way : P ∨ Q
-

- -

-What if, we want to test whether or not two propositions are true AT THE SAME TIME ? Long story short, we can, it’s called a conjunction, same concept, as before, only this time the symbol is P ∧ Q, and is only true if P and Q are true. So we get a Table like this :
-

- - - - --- -- -- -- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
PQP ∨ QP ∧ Q
1111
1010
0110
0000
- -

-Always remember: 1 means true and 0 means false
-

- -

-There are two more basics to cover here before going to some properties, the first one is implication symbolized by the double arrow
-

- -

-Implication is kinda hard for my little brain to explain, so I will just say what it means:
-

- -

-If P implies Q, this means that either Q, or the opposite of P are correct
-

- -

-or in math terms
-

- -

-P ⇒ Q translates to P̅ ∨ Q
-Let’s illustrate :
-

- - - - --- -- -- -- -- -- -- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
PQP ∨ QP ∧ QP ⇒ Q (P̅ ∨ Q)
1100111
1001100
0110101
0011001
- -

-If you look clearly, there is only one case where an implication is false. therefor you just need to find it, and blindly say that the others are correct. A rule of thumb is that: “A correct never implies a false”, or “If a 1 tries to imply a 0, the implication is a 0”
-

- -

-Aight, a last one and we are done!!! Equivalence, which is fairly easy, symbolized by a symbol.
-

- -

-A proposition is equivalent to another only when both of them have the same value of truth AKA: both true or both false. a little table will help demonstrate what i mean.
-

- - - - --- -- -- -- -- -- -- -- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
PQP ∨ QP ∧ QP ⇒ Q (P̅ ∨ Q)P ⇔ Q
11001111
10011000
01101010
00110011
- -

-Note: P implying Q is equivalent to P̅ implying Q̅, or: (P ⇒ Q) ⇔ (P̅ ⇒ Q̅)
-

-
-
-

Properties:

-
-
-
-

Absorption:

-
-

-(P ∨ P) ⇔ P
-

- -

-(P ∧ P) ⇔ P
-

-
-
-
-

Commutativity:

-
-

-(P ∧ Q) ⇔ (Q ∧ P)
-

- -

-(P ∨ Q) ⇔ (Q ∨ P)
-

-
-
-
-

Associativity:

-
-

-P ∧ (Q ∧ R) ⇔ (P ∧ Q) ∧ R
-

- -

-P ∨ (Q ∨ R) ⇔ (P ∨ Q) ∨ R
-

-
-
-
-

Distributivity:

-
-

-P ∧ (Q ∨ R) ⇔ (P ∧ Q) ∨ (P ∧ R)
-

- -

-P ∨ (Q ∧ R) ⇔ (P ∨ Q) ∧ (P ∨ R)
-

-
-
-
-

Neutral element:

-
-

-We define proposition T to be always true and F to be always false
-

- -

-P ∧ T ⇔ P
-

- -

-P ∨ F ⇔ P
-

-
-
-
-

Negation of a conjunction & a disjunction:

-
-

-Now we won’t use bars here because my lazy ass doesn’t know how, so instead I will use not()!!!
-

- -

-not(P ∧ Q) ⇔ P̅ ∨ Q̅
-

- -

-not(P ∨ Q) ⇔ P̅ ∧ Q̅
-

- -

-A rule I really like to use here is: Break and Invert. Basically you break the bar into the three characters of the propositions, so you get not(P) not(∧ or ∨) NOT AN ACTUAL MATH WRITING. DONT USE IT ANYWHERE ELSE OTHER THAN YOUR BRAIN and not(Q)
-

-
-
-
-

Transitivity:

-
-

-[(P ⇒ Q) AND (Q ⇒ R)] ⇔ P ⇒ R
-

-
-
-
-

Contraposition:

-
-

-(P ⇒ Q) ⇔ (Q̅ ⇒ P̅)
-

-
-
-
-

God only knows what this property is called:

-
-

-If
-

- -

-(P ⇒ Q) is true
-

- -

-and
-

- -

-(P̅ ⇒ Q) is true
-

- -

-then
-

- -

-Q is always true
-

-
-
-
-
-

Some exercices I found online :

-
-
-
-

USTHB 2022/2023 Section B :

-
-
-
    -
  • Exercice 1: Démontrer les équivalences suivantes:
    -
    -
      -
    1. -(P ⇒ Q) ⇔ (Q̅ ⇒ P̅)
      -

      - -

      -Basically we are asked to prove contraposition, so here we have ( P ⇒ Q ) which is equivalent to P̅ ∨ Q By definition : (P ⇒ Q) ⇔ (P̅ ∨ Q)
      -

    2. -
    - - -

    -So we end up with : (P̅ ∨ Q) ⇔ (Q̅ ⇒ P̅), now we just do the same with the second part of the contraposition. (Q̅ ⇒ P̅) ⇔ (Q ∨ P̅) therefor :
    -

    - - -

    -(Q ∨ P̅) ⇔ (P̅ ∨ Q), which is true because of commutativity
    -

    - -
      -
    1. not(P ⇒ Q) ⇔ P ∧ Q̅
    2. -
    - - -

    -Okaaaay so, let’s first get rid of the implication, because I don’t like it : not(P̅ ∨ Q)
    -

    - - -

    -Now that we got rid of it, we can negate the whole disjunction not(P̅ ∨ Q) ⇔ (P ∧ Q̅). Which is the equivalence we needed to prove
    -

    - -
      -
    1. -P ⇒ (Q ∧ R) ⇔ (P ⇒ Q) ∧ (P ⇒ R)
      -

      - -

      -One might be tempted to replace P with P̅ to get rid of the implication…sadly this isnt it. All we have to do here is resort to Distributivity, because yeah, we can distribute an implication across a {con/dis}junction
      -

    2. - -
    3. -P ∧ (Q ∨ R) ⇔ (P ∧ Q) ∨ (P ∧ R)
      -

      - -

      -Literally the same as above 🩷
      -

    4. -
    -
    -
  • -
  • Exercice 2: Dire si les propositions suivantes sont vraies ou fausses, et les nier:
    -
    -
      -
    1. -∀x ∈ ℝ ,∃y ∈ ℝ*+, tels que e^x = y
      -

      - -

      -For each x from the set of Real numbers, there exists a number y from the set of non-zero positive Real numbers that satisfies the equation : e^x = y
      -

    2. -
    - - -

    -“The function f(x)=e^x is always positive and non-null”, the very definition of an exponential function !!!!
    -

    - - -

    -So the proposition is true
    -

    - - -
      -
    1. ∃x ∈ ℝ, tels que x^2 < x < x^3
    2. -
    - - -

    -We just need to find a value that satisifies this condition…thankfully its easy….
    -

    - -

    -x² < x < x³ , we divide the three terms by x so we get :
    -

    - - -

    -x < 1 < x² , or :
    -

    - - -

    -x < 1 ; 1 < x²x < 1 ; 1 < x We square root both sides
    -

    - - -

    -We end up with a contradiction, therefor its wrong
    -

    - - -
      -
    1. ∀x ∈ ℝ, ∃y ∈ ℝ tels que y = 3x - 8
    2. -
    - - -

    -I dont really understand this one, so let me translate it “For any value of x from the set of Real numbers, 3x - 8 is a Real number”…. i mean….yeah, we are substracting a Real number from an other real number…
    -

    - -

    -Since substraction is an Internal composition law in ℝ, therefor all results of a substraction between two Real numbers is…Real
    -

    - -
      -
    1. -∃x ∈ ℕ, ∀y ∈ ℕ, x > y ⇒ x + y < 8
      -

      - -

      -“There exists a number x from the set of Natural numbers such as for all values of y from the set of Natural numbers, x > y implies x + y < 8”
      -

    2. -
    - - -

    -Let’s get rid of the implication :
    -

    - -

    -∃x ∈ ℕ, ∀y ∈ ℕ, (y > x) ∨ (x + y < 8) There exists a number x from the set of Natural numbers such as for all values of y from the set of Natural numbers y > x OR x + y < 8
    -

    - -

    -This proposition is true, because there exists a value of x that satisfies this condition, it’s all numbers under 8 let’s take 3 as an example:
    -

    - - -

    -x = 3 , if y > 3 then the first condition is true ; if y < 3 then the second one is true
    -

    - - -

    -Meaning that the two propositions CAN NOT BE WRONG TOGETHER, either one is wrong, or the other
    -

    - - -

    -y > x
    -

    - - -

    -y - x > 0
    -

    - - -

    -y + x < 8
    -

    - - -

    -y < 8 - x This one is always true for all values of x below 8, since we are working in the set ℕ
    -

    - - -
      -
    1. -∀x ∈ ℝ, x² ≥ 1 ⇔ x ≥ 1
      -

      - -

      -….This is getting stupid. of course it’s true it’s part of the definition of the power of 2
      -

    2. -
    -
    -
  • -
-
-
-
-
-

2éme cours Oct 2

-
-
-
-

Quantifiers

-
-

-A propriety P can depend on a parameter x
-

- - -

-∀ is the universal quantifier which stands for “For any value of…”
-

- - -

-∃ is the existential quantifier which stands for “There exists at least one…”
-

-
-
    -
  • Example
    -
    -

    -P(x) : x+1≥0
    -

    - -

    -P(X) is True or False depending on the values of x
    -

    -
    -
  • -
-
-

Proprieties

-
-
-
    -
  • Propriety Number 1:
    -
    -

    -The negation of the universal quantifier is the existential quantifier, and vice-versa :
    -

    - -
      -
    • not(∀x ∈ E , P(x)) ⇔ ∃ x ∈ E, not(P(x))
    • -
    • not(∃x ∈ E , P(x)) ⇔ ∀ x ∈ E, not(P(x))
    • -
    -
    -
      -
    • Example:
      -
      -

      -∀ x ≥ 1 x² > 5 ⇔ ∃ x ≥ 1 x² < 5
      -

      -
      -
    • -
    -
  • -
  • Propriety Number 2:
    -
    -

    -∀x ∈ E, [P(x) ∧ Q(x)] ⇔ [∀ x ∈ E, P(x)] ∧ [∀ x ∈ E, Q(x)]
    -

    - - -

    -The propriety “For any value of x from a set E , P(x) and Q(x)” is equivalent to “For any value of x from a set E, P(x) AND for any value of x from a set E, Q(x)”
    -

    -
    -
      -
    • Example :
      -
      -

      -P(x) : sqrt(x) > 0 ; Q(x) : x ≥ 1
      -

      - - -

      -∀x ∈ ℝ*+, [sqrt(x) > 0 , x ≥ 1] ⇔ [∀x ∈ R*+, sqrt(x) > 0] ∧ [∀x ∈ R*+, x ≥ 1]
      -

      - - -

      -Which is true
      -

      -
      -
    • -
    -
  • -
  • Propriety Number 3:
    -
    -

    -∃ x ∈ E, [P(x) ∧ Q(x)] [∃ x ∈ E, P(x)] ∧ [∃ x ∈ E, Q(x)]
    -

    - - -

    -Here its an implication and not an equivalence
    -

    -
    -
      -
    • Example of why it’s NOT an equivalence :
      -
      -

      -P(x) : x > 5 ; Q(x) : x < 5
      -

      - - -

      -Of course there is no value of x such as its inferior and superior to 5 at the same time, so obviously the proposition is false. However, the two propositions separated are correct on their own, because there is a value of x such as its superior to 5, and there is also a value of x such as its inferior to 5. This is why it’s an implication and NOT AN EQUIVALENCE!!!
      -

      -
      -
    • -
    -
  • -
  • Propriety Number 4:
    -
    -

    -[∀ x ∈ E, P(x)] ∨ [∀ x ∈ E, Q(x)] ∀x ∈ E, [P(x) ∨ Q(x)]
    -

    - - -

    -Same here, implication and NOT en equivalence
    -

    -
    -
  • -
-
-
-
-

Multi-parameter proprieties :

-
-

-A propriety P can depend on two or more parameters, for convenience we call them x,y,z…etc
-

-
-
    -
  • Example :
    -
    -

    -P(x,y): x+y > 0
    -

    - - -

    -P(0,1) is a True proposition
    -

    - - -

    -P(-2,-1) is a False one
    -

    -
    -
  • -
  • WARNING :
    -
    -

    -∀x ∈ E, ∃y ∈ F , P(x,y)
    -

    - - -

    -∃y ∈ F, ∀x ∈ E , P(x,y)
    -

    - - -

    -Are different because in the first one y depends on x, while in the second one, it doesn’t
    -

    -
    -
      -
    • Example :
      -
      -

      -∀ x ∈ ℕ , ∃ y ∈ ℕ y > x -–— True
      -

      - - -

      -∃ y ∈ ℕ , ∀ x ∈ ℕ y > x -–— False
      -

      -
      -
    • -
    -
  • -
-
  • Proprieties :
    -
    -
      -
    1. not(∀x ∈ E ,∃y ∈ F P(x,y)) ⇔ ∃x ∈ E, ∀y ∈ F not(P(x,y))
    2. -
    3. not(∃x ∈ E ,∀y ∈ F P(x,y)) ⇔ ∀x ∈ E, ∃y ∈ F not(P(x,y))
    4. -
    -
    -
  • - -
    -
    -

    Methods of mathematical reasoning :

    -
    -
    -
    -

    Direct reasoning :

    -
    -

    -To show that an implication P ⇒ Q is true, we suppose that P is true and we show that Q is true
    -

    -
    -
      -
    • Example:
      -
      -

      -Let a,b be two Real numbers, we have to prove that a² + b² = 1 ⇒ |a + b| ≤ 2
      -

      - - -

      -We suppose that a²+b² = 1 and we prove that |a + b| ≤ 2
      -

      - - -

      -a²+b²=1 ⇒ b² = 1 - a² ; a² = 1 - b²
      -

      - - -

      -a²+b²=1 ⇒ 1 - a² ≥ 0 ; 1 - b² ≥ 0
      -

      - - -

      -a²+b²=1 ⇒ a² ≤ 1 ; b² ≤ 1
      -

      - - -

      -a²+b²=1 ⇒ -1 ≤ a ≤ 1 ; -1 ≤ b ≤ 1
      -

      - - -

      -a²+b²=1 ⇒ -2 ≤ a + b ≤ 2
      -

      - - -

      -a²+b²=1 ⇒ |a + b| ≤ 2 Which is what we wanted to prove, therefor the implication is correct
      -

      -
      -
    • -
    -
    -
    -

    Reasoning by the Absurd:

    -
    -

    -To prove that a proposition is True, we suppose that it’s False and we must come to a contradiction
    -

    - - -

    -And to prove that an implication P ⇒ Q is true using the reasoning by the absurd, we suppose that P ∧ not(Q) is true, and then we come to a contradiction as well
    -

    -
    -
      -
    • Example:
      -
      -

      -Prove that this proposition is correct using the reasoning by the absurd : ∀x ∈ ℝ* , sqrt(1+x²) ≠ 1 + x²/2
      -

      - - -

      -We assume that ∃ x ℝ* , sqrt(1+x²) = 1 + x²/2
      -

      - - -

      -sqrt(1+x²) = 1 + x²/2 ; 1 + x² = (1+x²/2)² ; 1 + x² = 1 + x^4/4 + x² ; x^(4)/4 = 0 … Which contradicts with our proposition, since x = 4 and we are working on the ℝ* set
      -

      -
      -
    • -
    -
    -
    -

    Reasoning by contraposition:

    -
    -

    -If an implication P ⇒ Q is too hard to prove, we just have to prove not(Q) ⇒ not(P) is true !!! or in other words that both not(P) and not(Q) are true
    -

    -
    -
    -
    -

    Reasoning by counter example:

    -
    -

    -To prove that a proposition ∀x ∈ E, P(x) is false, all we have to do is find a single value of x from E such as not(P(x)) is true
    -

    -
    -
    -
    -
    -
    -

    3eme Cours : Oct 9

    -
    -
    -
    -

    Reasoning by recurrence :

    -
    -

    -P is a propriety dependent of n ∈ ℕ. If for n0 ∈ ℕ P(n0) is true, and if for n ≥ n0 (P(n) ⇒ P(n+1)) is true. Then P(n) is true for n ≥ n0
    -

    -
    -
      -
    • Example:
      -
      -

      -Let’s prove that ∀ n ≥ 1 , (n,k=1)Σk = [n(n+1)]/2
      -

      - - -

      -P(n) : (n,k=1)Σk = [n(n+1)]/2
      -

      - - - -

      -Pour n = 1: (1,k=1)Σk = 1 ; [n(n+1)]/2 = 1 . So P(1) is true
      -

      - - - -

      -For n ≥ 1. We assume that P(n) is true, OR : (n, k=1)Σk = n(n+1)/2. We now have to prove that P(n+1) is true, Or : (n+1, k=1)Σk = (n+1)(n+2)/2
      -

      - - -

      -(n+1, k=1)Σk = 1 + 2 + …. + n + (n+1) ; (n+1, k=1)Σk = (n, k=1)Σk + (n+1) ; = n(n+1)/2 + (n+1) ; = [n(n+1) + 2(n+1)]/2 ; = [(n+2)(n+1)]/2 WHICH IS WHAT WE NEEDED TO FIND
      -

      - - -

      -Conclusion: ∀n ≥ 1 , (n,k=1)Σk = n(n+1)/2
      -

      -
      -
    • -
    -
    -
    -
    -

    4eme Cours : Chapitre 2 : Sets and Operations

    -
    -
    -
    -

    Definition of a set :

    -
    -

    -A set is a collection of objects that share the sane propriety
    -

    -
    -
    -
    -

    Belonging, inclusion, and equality :

    -
    -
      -
    1. Let E be a set. If x is an element of E, we say that x belongs to E we write x ∈ E, and if it doesn’t, we write x ∉ E
    2. -
    3. A set E is included in a set F if all elements of E are elements of F and we write E ⊂ F ⇔ (∀x , x ∈ E ⇒ x ∈ F). We say that E is a subset of F, or a part of F. The negation of this propriety is : E ⊄ F ⇔ ∃x , x ∈ E and x ⊄ F
    4. -
    5. E and F are equal if E is included in F and F is included in E, and we write E = F ⇔ (E ⊂ F) et (F ⊂ E)
    6. -
    7. The empty set (symbolized by ∅) is a set without elements, and is included in all sets (by convention) : ∅ ⊂ E
    8. -
    -
    -
    -
    -

    Intersections and reunions :

    -
    -
    -
    -

    Intersection:

    -
    -

    -E ∩ F = {x / x ∈ E AND x ∈ F} ; x ∈ E ∩ F ⇔ x ∈ F AND x ∈ F
    -

    - - -

    -x ∉ E ∩ F ⇔ x ∉ E OR x ∉ F
    -

    -
    -
    -
    -

    Union:

    -
    -

    -E ∪ F = {x / x ∈ E OR x ∈ F} ; x ∈ E ∪ F ⇔ x ∈ F OR x ∈ F
    -

    - - -

    -x ∉ E ∪ F ⇔ x ∉ E AND x ∉ F
    -

    -
    -
    -
    -

    Difference between two sets:

    -
    -

    -E(Which is also written as : E - F) = {x / x ∈ E and x ∉ F}
    -

    -
    -
    -
    -

    Complimentary set:

    -
    -

    -If F ⊂ E. E - F is the complimentary of F in E.
    -

    - - -

    -FCE = {x /x ∈ E AND x ∉ F} ONLY WHEN F IS A SUBSET OF E
    -

    -
    -
    -
    -

    Symmetrical difference

    -
    -

    -E Δ F = (E - F) ∪ (F - E) ; = (E ∪ F) - (E ∩ F)
    -

    -
    -
    -
    -
    -

    Proprieties :

    -
    -

    -Let E,F and G be 3 sets. We have :
    -

    -
    -
    -

    Commutativity:

    -
    -

    -E ∩ F = F ∩ E
    -E ∪ F = F ∪ E
    -

    -
    -
    -
    -

    Associativity:

    -
    -

    -E ∩ (F ∩ G) = (E ∩ F) ∩ G
    -E ∪ (F ∪ G) = (E ∪ F) ∪ G
    -

    -
    -
    -
    -

    Distributivity:

    -
    -

    -E ∩ (F ∪ G) = (E ∩ F) ∪ (E ∩ G)
    -E ∪ (F ∩ G) = (E ∪ F) ∩ (E ∪ G)
    -

    -
    -
    -
    -

    Lois de Morgan:

    -
    -

    -If E ⊂ G and F ⊂ G ;
    -

    - -

    -(E ∩ F)CG = ECG ∪ FCG ; (E ∪ F)CG = ECG ∩ FCG
    -

    -
    -
    -
    -

    An other one:

    -
    -

    -E - (F ∩ G) = (E-F) ∪ (E-G) ; E - (F ∪ G) = (E-F) ∩ (E-G)
    -

    -
    -
    -
    -

    An other one:

    -
    -

    -E ∩ ∅ = ∅ ; E ∪ ∅ = E
    -

    -
    -
    -
    -

    And an other one:

    -
    -

    -E ∩ (F Δ G) = (E ∩ F) Δ (E ∩ G)
    -

    -
    -
    -
    -

    And the last one:

    -
    -

    -E Δ ∅ = E ; E Δ E = ∅
    -

    -
    -
    -
    -
    -
    -

    5eme cours: L’ensemble des parties d’un ensemble Oct 16

    -
    -

    -Let E be a set. We define P(E) as the set of all parts of E : P(E) = {X/X ⊂ E}
    -

    -
    -
    -

    Notes :

    -
    -

    -∅ ∈ P(E) ; E ∈ P(E)
    -

    - - -

    -cardinal E = n The number of terms in E , cardinal P(E) = 2^n The number of all parts of E
    -

    -
    -
    -
    -

    Examples :

    -
    -

    -E = {a,b,c} ; P(E)={∅, {a}, {b}, {c}, {a,b}, {b,c}, {a,c}, {a,b,c}}
    -

    -
    -
    -
    -

    Partition of a set :

    -
    -

    -We say that A is a partition of E if:
    -

    -
      -
    1. ∀ x ∈ A , x ≠ 0
    2. -
    3. All the elements of A are two by two disjoint. Or in other terms, there should not be two elements that intersects with each other.
    4. -
    5. The reunion of all elements of A is equal to E
    6. -
    -
    -
    -
    -

    Cartesian products :

    -
    -

    -Let E and F be two sets, the set EXF = {(x,y)/ x ∈ E AND y ∈ F} is called the Cartesian product of E and F
    -

    -
    -
    -

    Example :

    -
    -

    -A = {4,5} ; B= {4,5,6} ; AxB = {(4,4), (4,5), (4,6), (5,4), (5,5), (5,6)}
    -

    - - -

    -BxA = {(4,4), (4,5), (5,4), (5,5), (6,4), (6,5)} ; Therefore AxB ≠ BxA
    -

    -
    -
    -
    -

    Some proprieties:

    -
    -
      -
    1. ExF = ∅ ⇔ E=∅ OR F=∅
    2. -
    3. ExF = FxE ⇔ E=F OR E=∅ OR F=∅
    4. -
    5. E x (F∪G) = (ExF) ∪ (ExG)
    6. -
    7. (E∪F) x G = (ExG) ∪ (FxG)
    8. -
    9. (E∪F) ∩ (GxH) = (E ∩ G) x (F ∩ H)
    10. -
    11. Generally speaking : (ExF) ∪ (GxH) ≠ (E∪G) x (F∪H)
    12. -
    -
    -
    -
    -
    -
    -

    Binary relations in a set :

    -
    -
    -
    -

    Definition :

    -
    -

    -Let E be a set and x,y ∈ E. If there exists a link between x and y, we say that they are tied by a relation R and we write xRy
    -

    -
    -
    -
    -

    Proprieties :

    -
    -

    -Let E be a set and R a relation defined in E
    -

    -
      -
    1. We say that R is reflexive if ∀ x ∈ E, xRx (for any element x in E,x is related to itself)
    2. -
    3. We say that R is symmetrical if ∀ x,y ∈ E , xRy ⇒ yRx
    4. -
    5. We say that R is transitive if ∀ x,y,z ∈ E (xRy , yRz) ⇒ xRz
    6. -
    7. We say that R is anti-symmetrical if ∀ x,y ∈ E xRy AND yRx ⇒ x = y
    8. -
    -
    -
    -
    -

    Equivalence relationship :

    -
    -

    -We say that R is a relation of equivalence in E if its reflexive, symetrical and transitive
    -

    -
    -
    -

    Equivalence class :

    -
    -

    -Let R be a relation of equivalence in E and a ∈ E, we call equivalence class of a, and we write ̅a or ȧ, or cl a the following set :
    -

    - - -

    -a̅ = {y ∈ E/ y R a}
    -

    -
    -
      -
    • The quotient set :
      -
      -

      -E/R = {̅a , a ∈ E}
      -

      -
      -
    • -
    -
    -
    -
    -

    Order relationship :

    -
    -

    -Let E be a set and R be a relation defined in E. We say that R is a relation of order if its reflexive, anti-symetrical and transitive.
    -

    -
      -
    1. The order R is called total if ∀ x,y ∈ E xRy OR yRx
    2. -
    3. The order R is called partial if ∃ x,y ∈ E xR̅y AND yR̅x
    4. -
    -
    -
    -

    TODO Examples :

    -
    -

    -∀x,y ∈ ℝ , xRy ⇔ x²-y²=x-y
    -

    -
      -
    1. Prove that R is an equivalence relation
    2. -
    3. Let a ∈ ℝ, find ̅a
    4. -
    -
    -
    -
    -
    -
    -

    TP exercices Oct 20 :

    -
    -
    -
    -

    Exercice 3 :

    -
    -
    -
    -

    Question 3

    -
    -

    -Montrer par l’absurde que P : ∀x ∈ ℝ*, √(4+x³) ≠ 2 + x³/4 est vraies
    -

    - -

    -On suppose que ∃ x ∈ ℝ* , √(4+x³) = 2 + x³/4
    -4+x³ = (2 + x³/4)²
    -4+x³ = 4 + x⁶/16 + 4*(x³/4)
    -4+x³ = 4 + x⁶/16 + x³
    -x⁶/16 = 0
    -x⁶ = 0
    -x = 0 . Or, x appartiens a ℝ\{0}, donc P̅ est fausse. Ce qui est equivalent a dire que P est vraie
    -

    -
    -
    -
    -
    -

    Exercice 4 :

    -
    -
    -
    -

    DONE Question 1 :

    -
    -

    -∀ n ∈ ℕ* , (n ,k=1)Σ1/k(k+1) = 1 - 1/1+n
    -P(n) : (n ,k=1)Σ1/k(k+1) = 1 - 1/1+n
    -1. On vérifie P(n) pour n = 1
    -(1 ,k=1)Σ1/k(k+1) = 1/1(1+1)
    -                  = 1/2 — (1)
    -1 - 1/1+1 = 1 - 1/2
    -                  = 1/2 — (2)
    -De (1) et (2), P(0) est vraie -— (a)
    -
    -2. On suppose que P(n) est vraie pour n ≥ n1 puis on vérifie pour n+1
    -(n ,k=1)Σ1/k(k+1) = 1 - 1/1+n
    -(n ,k=1)Σ1/k(k+1) + 1/(n+1)(n+2) = 1 - (1/(1+n)) + 1/(n+1)(n+2)
    -(n+1 ,k=1)Σ1/k(k+1) = 1 - 1/(n+1) + 1/[(n+1)(n+2)]
    -(n+1 ,k=1)Σ1/k(k+1) = 1 + 1/[(n+1)(n+2)] - (n+2)/[(n+1)(n+2)]
    -(n+1 ,k=1)Σ1/k(k+1) = 1 + [1-(n+2)]/[(n+1)(n+2)]
    -(n+1 ,k=1)Σ1/k(k+1) = 1 + [-n-1]/[(n+1)(n+2)]
    -(n+1 ,k=1)Σ1/k(k+1) = 1 - [n+1]/[(n+1)(n+2)]
    -(n+1 ,k=1)Σ1/k(k+1) = 1 - 1/(n+1+1) CQFD
    -
    -Donc P(n+1) est vraie. -— (b)
    -De (a) et (b) on conclus que la proposition de départ est vraie
    -

    -
    -
    -
    -
    -
    -

    Chapter 3 : Applications

    -
    -
    -
    -

    3.1 Generalities about applications :

    -
    -
    -
    -

    Definition :

    -
    -

    -Let E and F be two sets.
    -

    -
      -
    1. We call a function of the set E to the set F any relation from E to F such as for any element of E, we can find at most one element of F that corresponds to it.
    2. -
    3. We call an application of the set E to the set F a relation from E to F such as for any element of E, we can find one and only one element of F that corresponds to it.
    4. -
    5. -f: E1 —> F1 ; g: E2 —> F2 ; f ≡ g ⇔ [E1 = E2 ; F1 = F2 ; f(x) = g(x) ∀x ∈ E1
      -

      - -

      -Generally speaking, we schematize a function or an application by this writing :
      -

      -

      -f : E —> F
      -    x —> f(x)=y
      -   Γ = {(x , f(x))/ x ∈ E ; f(x) ∈ F} is the graph of f
      -

    6. -
    -
    -
      -
    • Some examples :
      -
        -
      • Ex1:
        -
        -

        -f : ℝ —> ℝ
        -    x —> f(x) = (x-1)/x
        -is a function, because 0 does NOT have a corresponding element using that relation.
        -

        -
        -
      • -
      • Ex2:
        -
        -

        -f : ℝ* —> ℝ
        -    x —> f(x)= (x-1)/x
        -is, however, an application
        -

        -
        -
      • -
      -
    • -
    -
    -
    -

    Restriction and prolongation of an application :

    -
    -

    -Let f : E -> F an application and E1 ⊂ E therefore :
    -

    -

    -g : E1 -> F
    -g(x) = f(x) ∀x ∈ E1
    -
    -g is called the restriction of f to E1. And f is called the prolongation of g to E.
    -

    -
    -
      -
    • Example
      -
      -

      -f : ℝ —> ℝ
      -    x —> f(x) = x2
      -
      -g : [0 , ∞[ —> ℝ
      -    x —> g(x) = x²
      -
      -g is called the restriction of f to ℝ^{
      }. And f is called the prolongation of g to ℝ.
      -

      -
      -
    • -
    -
    -
    -

    Composition of applications :

    -
    -

    -Let E,F, and G be three sets, f: E -> F and g: F -> G are two applications. We define their composition, symbolized by gof as follow :
    -

    - - -

    -gof : E -> G . ∀x ∈ E (gof)(x)= g(f(x))
    -

    -
    -
    -
    -
    -

    3.2 Injection, surjection and bijection :

    -
    -

    -Let f: E -> F be an application :
    -

    -
      -
    1. We say that f is injective if : ∀x,x’ ∈ E : f(x) = f(x’) ⇒ x = x’
    2. -
    3. We say that f is surjective if : ∀ y ∈ F , ∃ x ∈ E : y = f(x)
    4. -
    5. We say that if is bijective if it’s both injective and surjective at the same time.
    6. -
    -
    -
    -

    Proposition :

    -
    -

    -Let f : E -> F be an application. Therefore:
    -

    -
      -
    1. f is injective ⇔ y = f(x) has at most one solution.
    2. -
    3. f is surjective ⇔ y = f(x) has at least one solution.
    4. -
    5. f is bijective ⇔ y = f(x) has a single and unique solution.
    6. -
    -
    -
    -
    -
    -

    3.3 Reciprocal applications :

    -
    -
    -
    -

    Def :

    -
    -

    -Let f : E -> F a bijective application. So there exists an application named f-1 : F -> E such as : y = f(x) ⇔ x = f-1(y)
    -

    -
    -
    -
    -

    Theorem :

    -
    -

    -Let f : E -> F be a bijective application. Therefore its reciprocal f-1 verifies : f-1of=IdE ; fof-1=IdF Or :
    -

    - - -

    -IdE : E -> E ; x -> IdE(x) = x
    -

    -
    -
    -
    -

    Some proprieties :

    -
    -
      -
    1. (f-1)-1 = f
    2. -
    3. (gof)⁻¹ = f⁻¹og⁻¹
    4. -
    5. The graphs of f and f⁻¹ are symmetrical to each other by the first bis-sectrice of the equation y = x
    6. -
    -
    -
    -
    -
    -

    3.4 Direct Image and reciprocal Image :

    -
    -
    -
    -

    Direct Image :

    -
    -

    -Let f: E-> F be an application and A ⊂ E. We call a direct image of A by f, and we symbolize as f(A) the subset of F defined by :
    -

    - - -

    -f(A) = {f(x)/ x ∈ A} ; = { y ∈ F ∃ x ∈ A y=f(x)}
    -

    -
    -
      -
    • Example :
      -
      -

      -f: ℝ -> ℝ
      -   x -> f(x) = x²
      -A = {0,4}
      -f(A) = {f(0), f(4)} = {0, 16}
      -

      -
      -
    • -
    -
    -
    -

    Reciprocal image :

    -
    -

    -Let f: E -> F be an application and B ⊂ F. We call the reciprocal image of E by F the subset f-1(B) :
    -

    - - -

    -f-1(B) = {x ∈ E/f(x) ∈ B} ; x ∈ f-1(B) ⇔ f(x) ∈ B
    -

    -
    -
      -
    • Example :
      -
      -

      -f: ℝ -> ℝ
      -   x -> f(x) = x²
      -B = {1,9,4}
      -f-1(B) = {1,-1,2,-2,3,-3}
      -      = {x ∈ ℝ/x² ∈ {1,4,9}}
      -

      -
      -
    • -
    -
    -
    -
    -
    -
    -

    Author: Crystal

    -

    Created: 2023-11-01 Wed 20:17

    -
    - - \ No newline at end of file diff --git a/uni_notes/alsd.html b/uni_notes/alsd.html deleted file mode 100755 index 804d386..0000000 --- a/uni_notes/alsd.html +++ /dev/null @@ -1,109 +0,0 @@ - - - - - - - -ALSD1 - - - - - - - -
    - UP - | - HOME -
    -

    ALSD1

    - -
    -

    Contenu de la Matiére

    -
    -
    -
    -

    Chapitre 1: Elements de Base

    -
    -
      -
    • Algorithmique, procésseur, action.
    • -
    • Programme et languages de programmation.
    • -
    • Analyse des problémes.
    • -
    -
    -
    -
    -

    Chapitre 2: Présentation du formalisme Algorithmique

    -
    -
    -

    Chapitre 3: Eléments de base du language C

    -
    -
    -

    Chapitre 4: Modularité( Fonction et Procédure )

    -
    -
    -

    Chapitre 5: Les structures des données statiques

    -
    -
    -
    -

    Premier cours : Algorithmes Oct 1 :

    -
    -
    -
    -

    Définition d’un algorithm :

    -
    -

    -Un ensemble d’opérations ecrites dans le language naturel.
    -

    -
    -
    -

    Example d’un Algo : Résolution d’une équation du second ordre (ax²+bx+c=0)

    -
    -
      -
    1. Si a=0 ET b=0 alors l’équation n’est pas du 2nd ordre.
    2. -
    3. Si a=0 et b≠0 alors x= -c/5 .
    4. -
    5. Si a≠0 alors calculer Δ= b²-4ac :
      -
        -
      1. Si Δ=0 alors x=-b/2a.
      2. -
      3. Si Δ<0 alors l’équation n’as pas de solution.
      4. -
      5. Si Δ>0 alors x=[-b±sqrt(Δ)]/2a
      6. -
    6. -
    -
    -
    -
    -
    -
    -
    -

    Author: Crystal

    -

    Created: 2023-11-01 Wed 20:17

    -
    - - \ No newline at end of file diff --git a/uni_notes/analyse.html b/uni_notes/analyse.html deleted file mode 100755 index 0c2f952..0000000 --- a/uni_notes/analyse.html +++ /dev/null @@ -1,1624 +0,0 @@ - - - - - - - -Analyse 1 - - - - - - - -
    - UP - | - HOME -
    -

    Analyse 1

    -
    -

    Table of Contents

    -
    - -
    -
    -
    -

    Contenu de la Matiére

    -
    -
    -
    -

    Chapitre 1 : Quelque propriétés de ℝ

    -
    -
      -
    • Structure algébrique de ℝ
    • -
    • L’ordre dans ℝ
    • -
    • Majorant, minorant, borne superieure, borne inférieure
    • -
    -
    -
    -
    -

    Chapitre 2 : Les suites numériques réelles

    -
    -
      -
    • Définition : convergence, opérations sur les suites convergentes
    • -
    • Theoréme de convergence, Theoréme de _ suites, sans suites, extension au limites infinies
    • -
    • Suites de cauchy, suites adjacentes et suites récurentes
    • -
    -
    -
    -
    -

    Chapitre 3 : Limites et continuité des fonctions réelles d’une variable réelle

    -
    -
      -
    • Les limites : définition, opérations sur les limites, les formes inditerminées
    • -
    • La continuité : définition, Theorémes fondamentaux
    • -
    • La continuité informe les fonctions Lepchitziennes
    • -
    -
    -
    -
    -

    Chapitre 4 : La dérivabilité et son interprétation géometrique

    -
    -
      -
    • Opérations sur les fonctions dérivales, Theoréme de Rolle, Theoréme des accroissements finis, régle de L’Hopital et formule de Taylor
    • -
    -
    -
    -
    -

    Chapitre 5 : Les fonctions trigonométriques réciproques, fonctions hypérboliques réciproques

    -
    -
      -
    • Comparaison asymptotique
    • -
    • Symbole de lamdau (lambda ?), et notions des fonctions équivalentes
    • -
    • Développements limites polynominaux (D.L) et opérations sur les D.L
    • -
    • Généralisations des D.L
    • -
    • Application au calcul de limite et l’étude des branches infinies
    • -
    -
    -
    -
    -
    -

    Premier cours : Quelque propriétés de ℝ Sep 26 :

    -
    -
    -
    -

    La loi de composition interne dans E :

    -
    -

    -@ : E x E —> E
    - (x,y) —> x @ y
    -

    - -

    -@ est une lois de composition interne seulement si :
    -

    - -

    -∀ x,y ε E
    -

    -
    -
    -

    Example : Addition

    -
    -

    -Est ce que l’addition (+) est L.C.I dans ℕ ?
    -

    - -

    -ℕ x ℕ —> ℕ
    -

    - -

    -(x,y) —> x + y ? En gros : Pour que l’addition soit une L.C.I dans ℕ, il faut que: quand on additionne n’importe quel chiffre x et y de N, il faut que le résultat appertiens aussi a ℕ
    -

    - -

    -∀ x,y ∈ ℕ , x + y ∈ ℕ En gros: Pour TOUTE valeur de x et y appartenant a ℕ, leur somme est toujours dans ℕ
    -

    - -

    -Donc : + est L.C.I dans ℕ
    -

    -
    -
    -
    -

    Example : soustraction

    -
    -

    -Est ce que la soustraction (-) est L.C.I dans ℕ?
    -

    - -

    -ℕ x ℕ —> ℕ
    -

    - -

    -(x,y) —> x - y ?
    -

    - - -

    -∃ x , y ∈ ℕ , x - y ∉ ℕ En gros: il existe au moins une valeur de x et y dans ℕ tel que leur différence n’est PAS dans ℕ . tel que : si x est 5, et y c’est 9. Leur différence est -4, qui appartiens pas a ℕ
    -

    -
    -
    -
    -
    -

    La loi de composition externe dans E :

    -
    -

    -@ est L.C.E dans E, K est un corps
    -

    - -

    -K x E —> E
    -

    - -

    -(a,x) —> a @ x
    -

    - -

    -∀ (a , x) ∈ K x E , a @ x ∈ E
    -

    -
    -
    -
    -

    Groupes :

    -
    -

    -Soit E un ensemble, soit @ une L.C.I dans E
    -

    - -

    -(E, @) est un groupe Si :
    -

    -
    -
    -

    Il contiens un élement neutre

    -
    -

    -∀ x ∈ E ; ∃ e ∈ E
    -

    - -

    -x @ e = e @ x = x
    -

    - -

    -On appelle e élement neutre
    -

    - -

    -Ex: (ℕ,+) accepte un élement neutre, qui est 0, parceque x + 0 = 0 + x = x….cependent (ℕ,+) n’est pas un groupe. La raison est dans la prochaine condition
    -

    -
    -
    -
    -

    Il contiens un élément symétrique

    -
    -

    -∀ x ∈ E ; ∃ x’ ∈ E ; x @ x’ = x’ @ x = e
    -

    - -

    -On appelle x’ élèment symétrique
    -

    - -

    -Dans l’example en haut, on remarque qu’il n’y ya pas de chiffre x’ pour chaque chiffre x, qui est, l’hors de leur addition est egal a e (0), tout simplement car:
    -

    - -

    -x + x’ = e ; x + x’ = 0 ; x = -x’
    -

    - -

    -Or, Dans ℕ, on a pas de nombres négatifs
    -

    -
    -
    -
    -

    @ est cummutative :

    -
    -

    -∀ (x , x’) ∈ E x E ; x @ x’ = x’ @ x
    -

    - -

    -L’addition est cummutative, la soustraction ne l’es pas. 5 + 3 ou 3 + 5 est pareil, mais 5 - 3 et 3 - 5 sont différents
    -

    -
    -
    -
    -
    -

    Anneaux :

    -
    -

    -Soit E un ensemble, (E , @ , !) est un anneau si :
    -

    -
    -
    -

    (E ; @) est un groupe cummutatif

    -
    -
    -

    ! est une loi associative :

    -
    -

    -∀ x , y , z ∈ E
    -

    - -

    -(x ! y) ! z = x ! (y ! z)
    -

    -
    -
    -
    -

    Distribution de ! par rapport à @ :

    -
    -

    -∀ x , y , z ∈ E
    -

    - -

    -(x @ y) ! z = ( x ! z ) @ ( y ! z )
    -

    -
    -
    -
    -

    L’existance d’un élèment neutre de ! :

    -
    -

    -∀ x ∈ E , ∃ e ∈ E , x ! e = e ! x = x
    -

    -
    -
    -
    -

    ! est cummutative :

    -
    -

    -∀ x , y ∈ E , x ! y = y ! x
    -

    -
    -
    -
    -
    -

    Corps :

    -
    -

    -(E , @ , !) est un corps si les 5 conditions en haut sont vérifiées + cette condition :
    -

    -
    -
    -

    La symétrie :

    -
    -

    -∀ x ∈ E ; ∃ x’ ∈ E , x ! x’ = x’ ! x = e
    -

    - -

    -x’ est l’élément symétrique de x par rapport à !
    -(sauf élément neutre première lois )
    -

    -
    -
    -
    -
    -

    Exercice : (ℝ, +, x) corps ou pas ?

    -
    -
    -
    -

    Est-ce un Anneau ?

    -
    -
      -
    • (ℝ, +) est un groupe commutatif
    • -
    • x est une loi associative : (a x b) x c = a x (b x c)
    • -
    • On peut distribuer x par rapport a + : (a + b) x c = (a x c) + (b x c)
    • -
    • Il existe un élément neutre de x which is 1 : a x 1 = 1 x a = a
    • -
    • La multiplication est commutative : a x b = b x a
    • -
    - -

    -Oui c’est un anneau
    -

    -
    -
    -
    -

    Est-ce un corps ?

    -
    -
      -
    • Oui : ∀ x ∈ ℝ\{e} ; x * x’ = 1
    • -
    -
    -
    -
    -
    -
    -

    2nd cours :L’ordre dans ℝ, Majorant, minorant, borne superieure, borne inférieure Oct 3 :

    -
    -
    -
    -

    L’ordre dans ℝ

    -
    -

    -(ℝ, +, x) est un corps, Soit R une relation d’ordre dans ℝ si :
    -

    - -
      -
    1. -R est antisymétrique :
      -

      - -

      -∀ x, y ℝ ; (x R y et y R x) ⇒ (x = y)
      -

    2. - -
    3. -R est reflexive :
      -

      - -

      -∀ x ∈ ℝ ; x R x
      -

    4. - -
    5. R est transitive :
      -∀ x, y, z ∈ ℝ , (x R y and y R z) ⇒ x R z
    6. -
    -
    -
    -

    Exemples :

    -
    -
    -
      -
    • Exemple numéro 1:
      -
      -

      -(ℝ , +, x) est un corps. Est ce la relation < est une relation d’ordre dans ℝ ?
      -

      - - -

      -Non, pourquoi ? parce que elle est pas réflexive : ∀ x ∈ ℝ, x < x is obviously false
      -

      -
      -
    • -
    • Exemple numéro 2:
      -
      -

      -(ℝ , +, x) est un corps. Est ce la relation ≥ est une relation d’ordre dans ℝ ?
      -

      - -
        -
      1. (Antisymétrique) ∀ x, y ℝ ; (x ≥ y AND y ≥ x) ⇒ x = y is true
      2. -
      3. (Réflexive) ∀ x, y ℝ ; x ≥ x is true
      4. -
      5. (Transitive) ∀ x, y, z ℝ ; (x ≥ y AND y ≥ z) ⇒ x ≥ z is also true
      6. -
      -
      -
    • -
    -
    -
    -
    -

    Majorant, minorant, borne supérieure, borne inférieure

    -
    -
    -
    -

    Majorant:

    -
    -

    -Soit E un sous-ensemble de ℝ (E ⊆ ℝ)
    -

    - - -

    -Soit a ∈ ℝ, a est un majorant de E Si :∀ x ∈ E , x ≤ a
    -

    -
    -
    -
    -

    Minorant:

    -
    -

    -Soit E un sous-ensemble de ℝ (E ⊆ ℝ)
    -

    - - -

    -Soit b ∈ ℝ, b est un minorant de E Si :∀ x ∈ E , x ≥ b
    -

    -
    -
    -
    -

    Borne supérieure:

    -
    -

    -La borne supérieure est le plus petit des majorants Sup(E) = Borne supérieure
    -

    -
    -
    -
    -

    Borne inférieure:

    -
    -

    -La borne inférieure est le plus grand des minorant Inf (E) = Borne inférieure
    -

    -
    -
    -
    -

    Maximum :

    -
    -

    -E ⊆ ℝ, a est un maximum de E (Max(E)) Si : a ∈ E ; ∀x ∈ E, x ≤ a.
    -

    -
    -
    -
    -

    Minimum :

    -
    -

    -E ⊆ ℝ, b est un minimum de E (Min(E)) Si : b ∈ E ; ∀x ∈ E, x ≥ b.
    -

    -
    -
    -
    -

    Remarques :

    -
    -

    -A et B deux ensembles bornés (Minoré et Majoré) :
    -

    -
      -
    1. A ∪ B est borné
    2. -
    3. A ∩ B est borné
    4. -
    5. Sup(A ∪ B)= Max(sup A, sup B)
    6. -
    7. Inf (A ∩ B)= Min(inf A, inf B)
    8. -
    9. Sup(A ∩ B)= Min(sup A, sup B) Le plus petit des Supérieur de A et B
    10. -
    11. Inf (A ∩ B)= Max(inf A, inf B) Le plus grand des inférieur de A et B
    12. -
    -
    -
    -
    -
    -
    -

    3rd cours :Les suites numériques Oct 5 :

    -
    -
    -
    -

    Définition :

    -
    -

    -Soit (Un)n ∈ ℕ une suite numérique , (Un)n est une application de ℕ dans ℝ:
    -

    - - -

    -ℕ -—> ℝ
    -

    - - -

    -n -—> U(n) = Un
    -

    - -
      -
    1. (Un) ou (Un)n ∈ ℝ : une suite
    2. -
    3. Un : terme général
    4. -
    -
    -
      -
    • Exemple :
      -
      -

      -U : ℕ* -—> ℝ
      -

      - - -

      -n -—> 1/n
      -

      - - -

      -(Un) est une suite définit par Un = 1/n
      -

      -
      -
    • -
    -
    -
    -

    Définition N°2 :

    -
    -

    -On peut définir une suite â partir d’une relation de récurrence entre deux termes successifs et le premier terme.
    -

    -
    -
      -
    • Exemple :
      -
      -

      -U(n+1) = Un /2
      -

      - - -

      -U(1)= 1
      -

      -
      -
    • -
    -
    -
    -

    Opérations sur les suites :

    -
    -
    -
    -

    La somme :

    -
    -

    -Soient (Un) et (Vn) deux suites, la somme de (Un) et (Vn) est une suite de terme général Un + Vn
    -

    -
    -
    -
    -

    Le produit :

    -
    -

    -Soient (Un)n et (Vn)n deux suites alors (Un) x (Vn) est une autre suite de terme général Un x Vn
    -

    -
    -
    -
    -

    Inverse d’une suite :

    -
    -

    -Soit Un une suite de terme général Un alors l’inverse de (Un) est une autre suite (Vn) = 1/(Un) de terme général de Vn = 1/Un
    -

    -
    -
    -
    -

    Produit d’une suite par un scalaire :

    -
    -

    -Soit (Un) une suite de T.G Un
    -

    - - -

    -∀ λ ∈ ℝ , λ(Un) n ∈ ℕ est une suite de T.G Vn= λUn
    -

    -
    -
    -
    -
    -

    Suite bornée :

    -
    -

    -Une suite (Un) est bornée si (Un) majorée et minorée
    -

    -
    -
    -
    -

    Suite majorée :

    -
    -

    -Soit (Un) une suite
    -

    - - -

    -U : (Un) est majorée par M ∈ ℝ ; ∀ n ∈ ℕ ; ∃ M ∈ ℝ , Un ≤ M
    -

    -
    -
    -
    -

    Suite minorée :

    -
    -

    -Soit (Un) une suite
    -

    - - -

    -U : (Un) est minorée par M ∈ ℝ ; ∀ n ∈ ℕ ; ∃ M ∈ ℝ , Un ≥ M
    -

    -
    -
    -
    -

    Suites monotones :

    -
    -
    -
    -

    Les suites croissantes :

    -
    -

    -Soit (Un)n est une suite
    -

    - - -

    -(Un) est croissante si : ∀ n ∈ ℕ ; U(n+1) - Un ≥ 0 ⇔ Un+1 ≥ Un
    -

    -
    -
    -
    -

    Les suites décroissantes :

    -
    -

    -Soit (Un)n est une suite
    -

    - - -

    -(Un) est décroissante si : ∀ n ∈ ℕ ; U(n+1) - Un ≤ 0 ⇔ Un+1 ≤ Un
    -

    -
    -
    -
    -
    -
    -

    Série TD N°1 : Oct 6

    -
    -
    -
    -

    Exo 1 :

    -
    -
    -
    -

    Ensemble A :

    -
    -

    -A = {-1/n , n ∈ ℕ *}
    -

    -
    -
      -
    • Borne inférieure
      -
      -

      -∀ n ∈ ℕ* , -1/n ≥ -1 . -1 est la borne inférieure de l’ensemble A
      -

      -
      -
    • -
    • Minimum :
      -
      -

      -∀ n ∈ ℕ* , -1/n ≥ -1 . -1 est le Minimum de l’ensemble A
      -

      -
      -
    • -
    • Borne supérieure :
      -
      -

      -∀ n ∈ ℕ* , -1/n ≤ 0 . 0 est la borne supérieure de l’ensemble A
      -

      -
      -
    • -
    • Maximum :
      -
      -

      -L’ensemble A n’as pas de maximum
      -

      -
      -
    • -
    -
    -
    -

    Ensemble B :

    -
    -

    -B = [-1 , 3[ ∩ ℚ
    -

    -
    -
      -
    • Borne inférieure :
      -
      -

      -Inf (B) = Max(inf ([-1 , 3[) , inf (ℚ))
      -

      - - -

      -Puisse que ℚ n’as pas de Borne inférieure, donc par convention c’est -∞,
      -

      - - -

      -Inf (B) = -1
      -

      -
      -
    • -
    • Borne supérieure :
      -
      -

      -Sup(B) = Min(sup([-1 ,3[) , sup(ℚ))
      -

      - - -

      -Puisse que ℚ n’as pas de Borne supérieure, donc par convention c’est +∞,
      -

      - - -

      -Sup(B) = 3
      -

      -
      -
    • -
    • Minimum :
      -
      -

      -Min(B) = -1
      -

      -
      -
    • -
    • Maximum :
      -
      -

      -L’ensemble B n’as pas de Maximum
      -

      -
      -
    • -
    -
    -
    -

    Ensemble C :

    -
    -

    -C = {3n ,n ∈ ℕ}
    -

    -
    -
      -
    • Borne inférieure :
      -
      -

      -Inf (C) = 0
      -

      -
      -
    • -
    • Borne supérieure :
      -
      -

      -Sup(C) = +∞
      -

      -
      -
    • -
    • Minimum :
      -
      -

      -Min(C) = 0
      -

      -
      -
    • -
    • Maximum :
      -
      -

      -L’ensemble C n’as pas de Maximum
      -

      -
      -
    • -
    -
    -
    -

    Ensemble D :

    -
    -

    -D = {1 - 1/n , n ∈ ℕ*}
    -

    -
    -
      -
    • Borne inférieure :
      -
      -

      -Inf (D)= 0
      -

      -
      -
    • -
    • Borne supérieure :
      -
      -

      -Sup(D)= 1
      -

      -
      -
    • -
    • Minimum :
      -
      -

      -Min(D)= 0
      -

      -
      -
    • -
    • Maximum :
      -
      -

      -L’ensemble D n’as pas de Maximum
      -

      -
      -
    • -
    -
    -
    -

    Ensemble E :

    -
    -

    -E = { [2n + (-1)^n]/ n + 1 , n ∈ ℕ }
    -

    - - -

    -Les valeurs que E peut prendre sont : “(2n + 1)/(n+1)” Si n est pair, et “(2n - 1)/(n+1)” si n est impair
    -

    - - -

    -On définit un ensemble F et G : F = { (2n + 1)/ (n+1) , n ∈ 2k}, G = { (2n - 1)/(n+1), n ∈ 2k+1}
    -

    - - -

    -Donc E = F ∪ G
    -

    -
    -
      -
    • Borne inférieure :
      -
      -

      -Inf (E) = Min(inf (F), inf (G))
      -

      - - -

      -Inf (F) = 1 ; Inf (G) = -1
      -

      - - -

      -Inf (E)= -1
      -

      -
      -
    • -
    • Borne supérieure :
      -
      -

      -Sup(E) = Max(sup(F), sup(G))
      -

      - - -

      -sup(F) = +∞ ; sup(G) = +∞
      -

      - - -

      -Sup(E)= +∞
      -

      -
      -
    • -
    • Minimum :
      -
      -

      -Min(E)= -1
      -

      -
      -
    • -
    • Maximum :
      -
      -

      -E n’as pas de maximum
      -

      -
      -
    • -
    -
    -
    -
    -

    Exo 2 :

    -
    -
    -
    -

    Ensemble A :

    -
    -

    -A = {x ∈ ℝ , 0 < x <√3}
    -

    -
    -
      -
    • Borné
      -
      -

      -Oui, Inf (A)= 0 ; Sup(A)=√3
      -

      -
      -
    • -
    -
    -
    -

    Ensemble B :

    -
    -

    -B = { x ∈ ℝ , 1/2 < sin x <√3/2} ;
    -

    -
    -
      -
    • Borné
      -
      -

      -∀ x ∈ B, sin x > 1/2 ∴ Inf (B)= 1/2
      -

      - - -

      -∀ x ∈ B, sin x < √3/2 ∴ Sup(B)= √3/2
      -

      -
      -
    • -
    -
    -
    -

    Ensemble C :

    -
    -

    -C = {x ∈ ℝ , x³ > 3}
    -

    -
    -
      -
    • Minoré
      -
      -

      -∀ x ∈ C, x³ > 3 ∴ Inf (C)= 3
      -

      -
      -
    • -
    -
    -
    -

    Ensemble D :

    -
    -

    -D = {x ∈ ℝ , e^x < 1/2}
    -

    -
    -
      -
    • Borné
      -
      -

      -∀ x ∈ C, e^x > 0 ∴ Inf (C)= 0
      -

      - - -

      -∀ x ∈ C, e^x < 1/2 ∴ Sup(C)= 1/2
      -

      -
      -
    • -
    -
    -
    -

    Ensemble E :

    -
    -

    -E = {x ∈ ℝ , ∃ p ∈ ℕ* : x = √2/p}
    -

    -
    -
      -
    • Majoré
      -
      -

      -p = √2/x . Donc : Sup(E)=1
      -

      -
      -
    • -
    -
    -
    -
    -

    Exo 3 :

    -
    -

    -U0 = 3/2 ; U(n+1) = (Un - 1)² + 1
    -

    -
    -
    -

    Question 1 :

    -
    -

    -Montrer que : ∀ n ∈ ℕ , 1 < Un < 2 .
    -

    - - -

    -(Un - 1)² ≥ 0 Parce que c’est un carré
    -

    - - -

    -(Un - 1)² + 1 > 1 ; U(n+1) ≥ 1
    -

    -
    -
      -
    • Raisonnement par récurrence :
      -
      -

      -P(n) : ∀ n ∈ ℕ ; 1 < Un < 2
      -

      - - -

      -P(0) est vraie : 1 < 3/2 < 2
      -

      - - -

      -On suppose que P(n) est vraie et on vérifie P(n+1) pour une contradiction
      -

      - - -

      -1< Un < 2 ; 0 < Un - 1 < 1 ; 0 < (Un - 1)² < 1 ; 1 < (Un - 1)² + 1< 2 ; 1 < U(n+1) < 2 Donc elle est correcte
      -

      -
      -
    • -
    -
    -
    -

    Question 2 :

    -
    -

    -Montrer que (Un)n est strictement monotone :
    -

    - - -

    -U(n+1) - Un = (Un - 1)² + 1 - Un ; U(n+1) - Un = Un² + 1 - 2Un + 1 - Un ; U(n+1) - Un = Un² - 3Un + 2
    -

    - - -

    -On étudie Un² - 3Un + 2 sur l’intervalle ]1, 2[ : Un² - 3Un + 2 = 0 est une équation du 2nd ordre, Δ = 1 , elle accepte deux solutions : Un = 1 et Un = 2
    -

    - - -

    -On déduit que Un² - 3Un + 2 est négatif sur [1 , 2] et positif en dehors, donc ∀ 1 < Un < 2 , Un² - 3Un + 2 < 0 ; ∀ 1 < Un < 2 , U(n+1) - Un < 0 ; ∀ 1 < Un < 2 , U(n+1) < Un Donc (Un)n est une suite strictement monotonne décroissante
    -

    -
    -
    -
    -
    -
    -

    4th cours (Suite) : Oct 10

    -
    -
    -
    -

    Les suites convergentes

    -
    -

    -Soit (Un)n est une suite convergente si lim Un n–> +∞ = l
    -

    -
    -
    -

    Remarque :

    -
    -
      -
    1. Un est une suite convergente alors Un est bornee
    2. -
    3. Un est une suite convergente lim Un n—> +∞ = l ⇔ lim |Un| n—> +∞ = |l|
    4. -
    5. Un est une suite majoree et croissante ⇒ Un converge
    6. -
    7. Un est une suite minoree et decroissante ⇒ Un converge
    8. -
    9. Soient (Un) et (Vn) deux suites convergentes, alors
      -
        -
      1. Un + Vn est convergente
      2. -
      3. Un * Vn est convergente
      4. -
      5. ∀λ ∈ ℝ , (λUn) converge
      6. -
    10. -
    11. Soit Un est une suite bornee et soit Vn une suite. lim Vn n->+∞ = 0 Alors lim Vn * Un n-> +∞ = 0
    12. -
    -
    -
    -
    -
    -

    Theoreme d’encadrement

    -
    -

    -Soient Un Vn et Wn trois suites ∀n ∈ ℕ, Un ≤ Vn ≤ Wn . et lim Un n->∞ = lim Wn n-> +∞ = l ⇒ lim Vn n-> +∞ = l
    -

    -
    -
    -
    -

    Suites arithmetiques

    -
    -

    -Un est une suite arithmetique si : U(n+1) = Un + r ; r etant la raison de la suite
    -

    -
    -
    -

    Forme general

    -
    -

    -Un = U0 + nr ; Un = Up + (n - p)r
    -

    -
    -
    -
    -

    Somme des n premiers termes

    -
    -

    -Un est une suite arithmetique, Sn = [(U0 + Un)(n + 1)]/2
    -

    - - -

    -Sn = (n, k = 0)ΣUk est une somme partielle et lim Sn n->+∞ = k≥0ΣUk est une serie
    -

    -
    -
    -
    -
    -

    Suites géométriques

    -
    -
    -
    -

    Forme general

    -
    -

    -Un = U0 x r^n
    -

    -
    -
    -
    -

    Somme des n premiers termes

    -
    -

    -n ∈ ℕ\{1} Sn = U0 (1 - r^(n+1))/1-r
    -

    -
    -
    -
    -
    -
    -

    5th cours (suite) : Oct 12

    -
    -
    -
    -

    Suites adjacentes:

    -
    -

    -Soient (Un) et (Vn) deux suites, elles sont adjacentes si:
    -

    -
      -
    1. (Un) est croissante et (Vn) est décroissante
    2. -
    3. Un ≤ Vn
    4. -
    5. lim (Un - Vn) n->+∞ = 0
    6. -
    -
    -
    -
    -

    Suites extraites (sous-suites):

    -
    -

    -Soit (Un) une suite: ;U: ℕ -—> ℝ ; n -—> Un ;ϕ: ℕ -—> ℕ ; n -—> ϕn ;(U(ϕ(n))) est appelée une sous suite de (Un) ou bien une suite extraite.
    -

    -
    -
    -

    Remarques:

    -
    -
      -
    1. Si (Un) converge ⇒ ∀ n ∈ ℕ , U(ϕ(n)) converge aussi.
    2. -
    3. Mais le contraire n’es pas toujours vrais.
    4. -
    5. U(2n) et U(2n+1) convergent vers la même limite (l), alors Un aussi converge vers l
    6. -
    -
    -
    -
    -
    -

    Suites de Cauchy:

    -
    -

    -(Un) n ∈ ℕ est une suite de Cauchy Si ; ;∀ ε > 0 , ∃ N ∈ ℕ ; ∀ n > m > N ; |Un - Um| < ε
    -

    -
    -
    -

    Remarque :

    -
    -
      -
    1. Toute suite convergente est une suite de Cauchy et toute suite Cauchy est une suite convergente
    2. -
    -
    -
    -
    -
    -

    Théorème de Bolzano Weirstrass:

    -
    -

    -On peut extraire une sous suite convergente de toute suite bornée
    -

    -
    -
    -
    -
    -

    Chapitre 3 : Les limites et la continuité Nov 14

    -
    -
    -
    -

    Fonction réelle à variable réelle :

    -
    -

    -Soit f : I –> ℝ , I ⊂= ℝ
    - x –> f (x)
    -

    -
    -
    -

    L’ensemble de départ :

    -
    -

    -L’ensemble de définition (Df)
    -

    -
    -
      -
    • Propriétés:
      -
      -

      -Soit f et g deux fonctions :
      -f : I –> ℝ
      - x –> f (x)
      -

      - -

      -g : I –> ℝ
      - x –> g(x)
      -

      -
      -
        -
      • 1) f+g
        -
        -

        -(g+f): I –> ℝ
        - x –> (f+g)(x) = f (x) + g(x)
        -

        -
        -
      • -
      • 2) λf
        -
        -

        -∀λ ∈ ℝ : λf : I –> ℝ
        - x –> (λf)(x) = λf (x)
        -

        -
        -
      • -
      • 3) f*g
        -
        -

        -(f*g): I –> ℝ
        - x –> (f*g)(x) = f (x) x g(x)
        -

        -
        -
      • -
      • 4) f/g
        -
        -

        -f/g : I –> ℝ
        - x –> f (x)/g(x) , g(x) ≠ 0
        -

        -
        -
      • -
      -
    • -
    -
    -
    -

    Les Limites :

    -
    -

    -f : I –> ℝ
    - x –> f (x)
    - x0 ∈ I ; x0 extrémité de l’intervalle.
    -

    - -

    -Limx –> x0 f (x) est a Limite de f (x) quand x tend vers x0
    -

    -
    -
      -
    • Limx –> x0 f (x) = l
      -
      -

      -=> |x - x0| < ẟ , |f (x) - l| < ε
      -

      -
      -
    • -
    -
    -
    -

    La continuité :

    -
    -

    -Soit f : I –> ℝ I = Df
    - x –> f (x) x0 ∈ I
    -f est continue en x0 ⇔ Limx –> x0 f (x) = f (x0)
    -∀ε > 0 , ∃ẟ > 0 , |x - x0| < ẟ ⇒ |f (x) - f (x0)| < ε
    -

    -
    -
    -
    -

    Prolongement par continuité :

    -
    -

    -Soit f : I/ {x0} –> ℝ
    - x –> f (x)
    -

    - -

    -Si limx –> x0 f (x) = l Alors f est prolongéable par continuité en x0
    -

    - -

    -On défini :
    -f~ = f (x) si x ≠ x0
    -ET
    -l si x = x0
    - f~ : I –> ℝ
    - x –> f (x)
    -

    -
    -
    -
    -

    Théorème des valeurs intermédiaires :

    -
    -

    -f : [a,b] –> ℝ
    -Si f est continue sur [a,b]
    -Alors ∀y ∈ f ([a,b]) ⇒ ∃x ∈ [a,b] ; y = f (x)
    -

    - -
      -
    1. Si f est continue sur [a,b]
    2. -
    3. Si f (a) * f (b) < 0
    4. -
    -

    -Donc ∃ c ∈ ]a,b[ , f (c) = 0
    -

    -
    -
    -
    -

    Fonction croissante :

    -
    -

    -f : I –> J
    - f est croissante si ∀ x1,x2 ∈ I
    - x1 < x2 ⇒ f (x1) ≤ f (x2)
    -

    - -

    -f est strictement croissante si ∀ x1,x2 ∈ I
    - x1 < x2 ⇒ f (x1) < f (x2)
    -

    - -

    -Si f est croissante ou décroissante, alors elle est bornée.
    -

    -
    -
    -
    -

    Injection = Strictement monotonne :

    -
    -

    -f : I –> J
    -f est injective si ∀ x1,x2 ∈ I , f (x1) = f (x2) ⇒ x1 = x2
    -

    -
    -
    -
    -

    Surjection = Continuité :

    -
    -

    -f est surjective si ∀ y ∈ J, ∃ x ∈ I , y = f (x)
    -

    -
    -
    -
    -

    Bijection :

    -
    -

    -Si f est injective et surjective, alors f est bijective
    -f est bijective donc elle admet une bijection réciproque
    -

    -
    -
    -
    -

    Théorème de bijection :

    -
    -

    -Si f est continue et strictement monotone alors elle est bijective.
    -f admet une bijection réciproque f{-1}.
    -f{-1} a le même sens de variation que f.
    -

    -
    -
    -
    -
    -
    -
    -

    Author: Crystal

    -

    Created: 2023-11-14 Tue 23:06

    -
    - - \ No newline at end of file diff --git a/uni_notes/architecture.html b/uni_notes/architecture.html deleted file mode 100755 index 290e923..0000000 --- a/uni_notes/architecture.html +++ /dev/null @@ -1,968 +0,0 @@ - - - - - - - -Architecture 1 - - - - - - - -
    - UP - | - HOME -
    -

    Architecture 1

    - -
    -

    Premier cours : Les systémes de numération Sep 27 :

    -
    -

    -Un système de numération est une méthode pour représenter des nombres à l’aide de symboles et de règles. Chaque système, comme le décimal (base 10) ou le binaire (base 2), utilise une base définie pour représenter des valeurs numériques. Il est caractérisé par 3 entitiés mathématiques importantes:
    -

    - -
      -
    1. Une base (genre 10, ou 2)
    2. -
    3. Un ensemble de chiffres
    4. -
    5. Des régles de représentations des nombres
    6. -
    -
    -
    -

    Examples :

    -
    -

    -B10 est un systéme de numération caractérisé par:
    -

    -
      -
    • Base = 10
    • -
    • Un ensemble de chiffres : (0,1,2,3,4,5,6,7,8,9)
    • -
    - -

    -B16 est un autre systéme de numération caractérisé par:
    -

    -
      -
    • Base = 16
    • -
    • -Un ensemble de chiffres : (0,1,2,3,4,5,6,7,8,9,A,B,C,D,E,F)
      -

      - -

      -Puisse-qu’on peut pas utiliser des nombres a deux chiffres, on utilise des lettres aprés 9, en leur donnant des valeurs tel que :
      -

      - -

      -A : 10 ; B : 11 ; C : 12 ; D : 13 ; E : 14 ; F : 15
      -

    • -
    -
    -
    -
    -

    Comment passer d’un systéme a base 10 a un autre

    -
    -

    -On symbolise un chiffre dans la base x par : (Nombre)x
    -

    -
    -
    -

    Pour les chiffres entiers :

    -
    -

    -On fait une division successive, on prends le nombre 3257 comme exemple, on veut le faire passer d’une base décimale á une base 16:
    -

    - - -

    -(3257)10 -—> (?)16
    -

    - - -

    -On dévise 3257 par 16, et les restants de la division serra la valeur en base16:
    -

    - -

    -3257/16 = 203 + 9 / 16
    -

    - -

    -203/16 = 12 + B / 16 REMARQUE, 11 N’APPARTIENS PAS A L’ENSEMBLE DES CHIFFRES EN BASE16, CE QUI VEUT DIRE QU’ON LE REMPLACE PAR SON EQUIVALENT, DANS CE CAS LA: B
    -

    - -

    -12/16 = 0 + C / 16 Pareil ici, 12 n’existe pas, donc c’est C. Autre note : La division s’arréte quand le résultat de la division est nul
    -

    -
    -
      -
    • Conclusion:
      -
      -

      -(3257)10 -—> (CB9)16
      -

      -
      -
    • -
    -
    -
    -

    Pour les chiffres non entiers :

    -
    -

    -On fait la division successive pour la partie entiére, et une multiplication successive pour la partie rationelle:
    -

    - -

    -(3257,32)10 -—> (?)16
    -

    - -

    -On a déja la partie entiére donc on s’occupe de la partie aprés la virgule:
    -

    - -

    -0,32 x 16 = 5,12
    -

    - -

    -0,12 x 16 = 1,92
    -

    - -

    -0,92 x 16 = E,72 On a pas de 15 donc c’est un E
    -

    - -

    -0,72 x 16 = B,52
    -

    - -

    -0,52 x 16 = 8,32
    -

    - -

    -0,32 x 16 = 5,12
    -

    - -

    -…
    -

    - -

    -On s’arréte quand on trouve un chiffre entier, et si on trouve pas, on s’arréte quand on remarque une répetition, dans ce cas la, la séquance 51EB8 vas se répéter indéfiniment, donc on se contente d’écrire la partie qui se répéte avec une barre en haut
    -

    - - -

    -(3257,32)10 -—> (CB9, 51EB8)16
    -

    -
    -
    -
    -
    -
    -

    2nd cours : Les systèmes de numération (Suite) Oct 3 :

    -
    -
    -
    -

    Comment passer d’une base N a la base 10 :

    -
    -

    -Prenons comme exemple le nombre (11210,0011)3 , chaque chiffre dans ce nombre a un rang qui commence par 0 au premier chiffre (a gauche de la virgule) et qui augmente d’un plus qu’on avance a gauche, et diminue si on part a droite. Dans ce cas la :
    -

    - - -

    -(11210,0011)3 ; le 0 est de rang 0, le 1 est de rang 1, le 2 est de rang 2, le 1 est de rang 3, le 1 est de rang 4. Et si on part du coté de la virgule, 0 est de rang -1, 0 est de rang -2, le 1 est de rang -3, et le 1 est de rang -4.
    -

    - - -

    -Et pour passer a la base 10, il suffit d’appliquer cette formule : Chiffre x Base^(rang) + 2emeChiffre x Base^(rang)… etc, donc dans notre example:
    -

    - - -

    -0 x 3° + 1 x 3¹ + 2 x 3² + 1 x 3³ + 1 x 3^4 + 0 x 3¯¹ + 0 x 3¯² + 1 x 3¯³ + 1 x 3^(-4) ≈ (129,05)10
    -

    -
    -
    -
    -

    Comment passer d’une base N a une base N^(n) :

    -
    -

    -Si il ya une relation entre une base et une autre, on peut directement transformer vers cette base.
    -

    -
    -
    -

    Exemple :

    -
    -

    -Pour passer de la base 2 a la base 8 (8 qui est 2³) on découpe les chiffres 3 par 3
    -

    - - -

    -(1 101 011, 011)2 ; Pour le dernier 1 qui est seul tout comme moi il suffit d’ajouter des 0 à gauche (car on peut) pour compléter le découpage.
    -

    - - -

    -(001 101 011, 011)2; Next step c’est de dessiner le tableau de conversion de la base 2 a la base 8 ( un tableau a 3 bits )
    -

    - - - - - --- -- -- -- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    N   
    0000
    1001
    2010
    3011
    4100
    5101
    6110
    7111
    - - -

    -Pour remplir on a qu’a diviser les chiffres en deux, et mettre des 0 dans la première partie et des 1 dans la 2éme, et en faire de même pour les autres colonnes .
    -

    - - -

    -Maintenant il suffit de trouver l’équivalent de la base2 en base8 :
    -

    - - -

    -001 c’est 1 ; 101 c’est 5 ; 011 c’est 3 ; donc (1101011,011)2 —> (153,3)8
    -

    -
    -
    -
    -
    -

    L’arithmétique binaire :

    -
    -
    -
    -

    L’addition :

    -
    -

    -0 + 0 = 0 On retiens 0
    -

    - - -

    -1 + 0 = 1 On retiens 0
    -

    - - -

    -0 + 1 = 1 On retiens 0
    -

    - - -

    -1 + 1 = 0 On retiens 1
    -

    - - -

    -1 + 1 + 1 = 1 On retiens 1
    -

    - - -

    -Donc 0110 + 1101 = 10011
    -

    -
    -
    -
    -

    La soustraction :

    -
    -

    -0 - 0 = 0 On emprunt = 0
    -

    - - -

    -1 - 0 = 1 On emprunt = 0
    -

    - - -

    -0 - 1 = 1 On emprunt = 1
    -

    - - -

    -1 - 1 = 0 On emprunt = 0
    -

    -
    -
    -
    -
    -

    TP N°1 :

    -
    -
    -
    -

    Exo1:

    -
    - - - --- -- -- -- -- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    Base 10Base 2Base 3Base 8Base 16
    22,7510110,11211, 2026,6F6,C
    684,1251010101100,001221100, 011254,12AC,2
    3931,625111101011011,1011101121, 127533,5F5B,A
    52,38110100,0111221,10164,334,6147
    10,671010,10123,512,5A,AB85
    -
    -
      -
    • (10110,11)2
      -
      -

      -0 x 2° + 1 x 2¹ + 1 x 2² + 0 x 2³ + 1 x 2^(4) + 1 x 2¯¹ + 1 x 2¯² = (22.75)10
      -

      -
      -
        -
      • (22,75)10 -—> (3)
        -
        -

        -22/3 = 7 R 1 ; 7/3 = 2 R 1 ; 2/3 = 0 R 2
        -

        - - -

        -0,75 x 3 = 2.25 ; 0,25 x 3 = 0.75 …..
        -

        - - -

        -(22,75)10 -—> (211, 20)
        -

        -
        -
      • -
      • (10110,11)2 -—> (8)
        -
        -

        -8 = 2³ ; (010 110,110)2 -—> (?)8
        -

        - - -

        -En utilisant le tableau 3bits :
        -

        - - -

        -010 : 2 ; 110 : 6 ; 110 : 6
        -

        - - -

        -(10110,11)2 -—> (26,6)8
        -

        -
        -
      • -
      • (22,75)10 -—> (16)
        -
        -

        -22/16 = 1 R 6 ; 1/16 : 0 R F
        -

        - - -

        -0,75 x 16 = C
        -

        - - -

        -(22,75)10 -—> (F6,C)16
        -

        -
        -
      • -
      -
    • -
    • (1254,1)8
      -
      -

      -4 x 8° + 5 x 8¹ + 2 x 8² + 1 x 8³ + 1 x 8¯¹ = (684,125)10
      -

      -
      -
        -
      • (1254,1)8 -—> (?)2
        -
        -

        -En utilisant le tableau 3bits :
        -

        - - -

        -001 010 101 100,001 We will get rid of the leading zeros
        -

        - - -

        -(1010101100,001)2
        -

        -
        -
      • -
      • (684,125)10 -—> (?)3
        -
        -

        -684/3 = 228 R 0 ; 228/3 = 76 R 0 ; 76/3 = 25 R 1 ; 25/3 = 8 R 1 ; 8/3 = 2 R 2 ; 2/3 = 0 R 2
        -

        - - -

        -0,125 x 3 = 0,375 ; 0,375 x 3 = 1,125
        -

        - - -

        -(221100, 01)3
        -

        -
        -
      • -
      • (684,125)10 -—> (?)16
        -
        -

        -684/16 = 42 R C ; 42/16 = 2 R A ; 2/16 0 R 2
        -

        - - -

        -0,125 x 16 = 2
        -

        - - -

        -(2AC,2)16
        -

        -
        -
      • -
      -
    • -
    • (F5B,A)16
      -
      -

      -11 x 16° + 5 x 16 + 15 x 16² + 10 x 16¯¹ = (3931,625)10
      -

      -
      -
        -
      • (3931,625)10 -—> (8)
        -
        -

        -3931/8 = 491 R 3 ; 491/8 = 61 R 3 ; 61/8 = 7 R 5 ; 7/8 = 0 R 7
        -

        - - -

        -0,625 x 8 = 5
        -

        - - -

        -(7533,5)8
        -

        -
        -
      • -
      • (7533,5)8 -—> (2)
        -
        -

        -En utilisant le tableau 3bits
        -

        - -

        -(111 101 011 011,101)2
        -

        -
        -
      • -
      • (3931,625)10 -—> (3)
        -
        -

        -3931/3 = 1310 R 1 ; 1310/3 = 436 R 2 ; 436/3 = 145 R 1 ; 145/3 = 48 R 1 ; 48/3 = 16 R 0 ; 16/3 = 5 R 1 ; 5/3 = 1 R 2 ; 1/3 = 0 R 1
        -

        - - -

        -0.625 x 3 = 1,875 ; 0,875 x 3 = 2,625
        -

        - - -

        -(1101121, 12)3
        -

        -
        -
      • -
      -
    • -
    • (52,38)10
      -
      -

      -52/2 = 26 R 0 ; 26/2 = 13 R 0 ; 13/2 = 6 R 1 ; 6/2 = 3 R 0 ; 3/2 = 1 R 1 ; 1/2 = 0 R 1
      -

      - - -

      -0,38 x 2 = 0,76 ; 0,76 x 2 = 1,52 ; 0,52 x 2 = 1,04 ; 0,04 x 2 = 0,08 ….
      -

      - - -

      -(110100,0110)2
      -

      -
      -
        -
      • (52,38)10 -—> (3)
        -
        -

        -52/3 = 17 R 1 ; 17/3 = 5 R 2 ; 5/3 = 1 R 2 ; 1/3 = 0 R 1
        -

        - - -

        -0,38 x 3 = 1.14 ; 0,14 x 3 = 0.42 ; 0,42 x 3 = 1.26 ; 0.26 x 3 = 0.78 …
        -

        - - -

        -(1221,101)3
        -

        -
        -
      • -
      • (110100,011)2 -—> (8)
        -
        -

        -En utilisant le tableau 3bits:
        -

        - - -

        -(110 100,011)2 -—> (64,3)8
        -

        -
        -
      • -
      • (52,38)10 -—> (16)
        -
        -

        -52/16 = 3 R 4 ; 3/16 = 0 R 3
        -

        - - -

        -0,38 x 16 = 6,08 ; 0,08 x 16 = 1,28 ; 0,28 x 16 = 4,48 ; 0,48 x 16 = 7,68 ….
        -

        - - -

        -(34,6147)16
        -

        -
        -
      • -
      -
    • -
    • (23,5)3
      -
      -

      -3 x 3° + 2 x 3 + 5 x 3¯¹ = (10.67)10
      -

      -
      -
        -
      • (10,67)10 -—> (2)
        -
        -

        -10/2 = 5 R 0 ; 5/2 = 2 R 1 ; 2/2 = 1 R 0 ; 1/2 = 0 R 1
        -

        - - -

        -0,67 x 2 = 1,34 ; 0,34 x 2 = 0,68 ; 0,68 x 2 = 1,36 ; 0,36 x 2 = 0,72 …
        -

        - - -

        -(1010,101)2
        -

        -
        -
      • -
      • (001 010,101)2 -—> (8)
        -
        -

        -Ô Magic 3bits table, save me soul, me children and me maiden:
        -

        - - -

        -(12,5)8
        -

        -
        -
      • -
      • (10,67)10 -—> (16)
        -
        -

        -10/16 = 0 R A
        -

        - - -

        -0,67 x 16 = A,72 ; 0,72 x 16 = B,52 ; 0,52 x 16 = 8,32 ; 0,32 x 16 = 5,12 …
        -

        - - -

        -(A,AB85)16
        -

        -
        -
      • -
      -
    • -
    -
    -
    -

    Exo2:

    -
    -
    -
      -
    • (34)? = (22)10
      -
      -

      -(34)a = (22)10 ; 4 x a° + 3 x a = 22 ; 4 + 3a = 22 ; 3a = 18
      -

      - - -

      -a = 6
      -

      -
      -
    • -
    • (75)? = (117)10
      -
      -

      -(75)b = (117)10 ; 5 x b° + 7 x b¹ = 117 ; 5 + 7b = 117 ; 7b = 112
      -

      - - -

      -b = 16
      -

      -
      -
    • -
    -
    -
    -

    Exo3:

    -
    -
    -
      -
    • (101011)2 + (111011)2
      -
      -

      -101011 + 111011 = 1100110
      -

      -
      -
    • -
    • (1011,1101)2 + (11,1)2
      -
      -

      -1011,1101 + 11,1000 = 1111,0101
      -

      -
      -
    • -
    • (1010,0101)2 - (110,1001)2
      -
      -

      -1010,0101 - 110,1001 = 11,1100
      -

      -
      -
    • -
    -
    -
    -
    -

    L’arithmétique binaire (Suite): Oct 4

    -
    -
    -
    -

    La multiplication :

    -
    -

    -0 x 0 = 0
    -

    - - -

    -0 x 1 = 0
    -

    - - -

    -1 x 0 = 0
    -

    - - -

    -1 x 1 = 1
    -

    -
    -
    -
    -

    La division :

    -
    -

    -On divise de la manière la plus normale du monde !!!
    -

    -
    -
    -
    -
    -
    -

    4th cours : Le codage Oct 10

    -
    -
    -
    -

    Le codage des entiers positifs

    -
    -

    -Le codage sur n bits permet de representer tout les entiers naturels compris entre [0, 2^n - 1]. On peut coder sur 8bits les entiers entre [0;2^8 - 1(255)]
    -

    -
    -
    -
    -

    Le codage des nombres relatifs

    -
    -
    -
    -

    Remarque

    -
    -

    -Quelque soit le codage utilise, par convention le dernier bit est reserve pour le signe. ou 1 est negatif et 0 est positif.
    -

    -
    -
    -
    -

    Le codage en signe + valeur absolue (SVA):

    -
    -

    -Avec n bits le n eme est reserve au signe : [-(2^n-1)-1 , 2^n-1 -1]. Sur 8bits [-127, 127]
    -

    -
    -
    -
    -

    Codage en compliment a 1 (CR):

    -
    -

    -On obtiens le compliment a 1 d’un nombre binaire en inversant chaqu’un de ses bits (1 -> 0 et 0-> 1) les nombres positifs sont la meme que SVA (il reste tel qu’il est)
    -

    -
    -
    -
    -

    Codage en compliment a 2 (CV):

    -
    -

    -C’est literallement CR + 1 pour les negatifs et SVA pour les nombres positifs
    -

    -
    -
    -
    -
    -
    -
    -

    Author: Crystal

    -

    Created: 2023-11-01 Wed 20:16

    -
    - - \ No newline at end of file -- cgit 1.4.1-2-gfad0